diff --git a/Cargo.lock b/Cargo.lock index 7daa4b2..288db2b 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -30,12 +30,24 @@ version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d468802bab17cbc0cc575e9b053f41e72aa36bfa6b7f55e3529ffa43161b97fa" +[[package]] +name = "base64" +version = "0.13.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9e1b586273c5702936fe7b7d6896644d8be71e6314cfe09d3167c95f712589e8" + [[package]] name = "bitflags" version = "1.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" +[[package]] +name = "bumpalo" +version = "3.11.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "572f695136211188308f16ad2ca5c851a712c464060ae6974944458eb83880ba" + [[package]] name = "bytes" version = "1.2.1" @@ -79,6 +91,31 @@ dependencies = [ "os_str_bytes", ] +[[package]] +name = "core-foundation" +version = "0.9.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "194a7a9e6de53fa55116934067c844d9d749312f75c6f6d0980e8c252f8c2146" +dependencies = [ + "core-foundation-sys", + "libc", +] + +[[package]] +name = "core-foundation-sys" +version = "0.8.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5827cebf4670468b8772dd191856768aedcb1b0278a04f989f7766351917b9dc" + +[[package]] +name = "encoding_rs" +version = "0.8.31" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9852635589dc9f9ea1b6fe9f05b50ef208c85c834a562f0c6abb1c475736ec2b" +dependencies = [ + "cfg-if", +] + [[package]] name = "eyre" version = "0.6.8" @@ -89,6 +126,36 @@ dependencies = [ "once_cell", ] +[[package]] +name = "fastrand" +version = "1.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a7a407cfaa3385c4ae6b23e84623d48c2798d06e3e6a1878f7f59f17b3f86499" +dependencies = [ + "instant", +] + +[[package]] +name = "fnv" +version = "1.0.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1" + +[[package]] +name = "foreign-types" +version = "0.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f6f339eb8adc052cd2ca78910fda869aefa38d22d5cb648e6485e4d3fc06f3b1" +dependencies = [ + "foreign-types-shared", +] + +[[package]] +name = "foreign-types-shared" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "00b0228411908ca8685dba7fc2cdd70ec9990a6e753e89b6ac91a84c40fbaf4b" + [[package]] name = "form_urlencoded" version = "1.1.0" @@ -98,6 +165,45 @@ dependencies = [ "percent-encoding", ] +[[package]] +name = "futures-channel" +version = "0.3.25" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "52ba265a92256105f45b719605a571ffe2d1f0fea3807304b522c1d778f79eed" +dependencies = [ + "futures-core", +] + +[[package]] +name = "futures-core" +version = "0.3.25" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "04909a7a7e4633ae6c4a9ab280aeb86da1236243a77b694a49eacd659a4bd3ac" + +[[package]] +name = "futures-sink" +version = "0.3.25" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "39c15cf1a4aa79df40f1bb462fb39676d0ad9e366c2a33b590d7c66f4f81fcf9" + +[[package]] +name = "futures-task" +version = "0.3.25" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2ffb393ac5d9a6eaa9d3fdf37ae2776656b706e200c8e16b1bdb227f5198e6ea" + +[[package]] +name = "futures-util" +version = "0.3.25" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "197676987abd2f9cadff84926f410af1c183608d36641465df73ae8211dc65d6" +dependencies = [ + "futures-core", + "futures-task", + "pin-project-lite", + "pin-utils", +] + [[package]] name = "getrandom" version = "0.2.8" @@ -124,6 +230,25 @@ dependencies = [ "url", ] +[[package]] +name = "h2" +version = "0.3.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5f9f29bc9dda355256b2916cf526ab02ce0aeaaaf2bad60d65ef3f12f11dd0f4" +dependencies = [ + "bytes", + "fnv", + "futures-core", + "futures-sink", + "futures-util", + "http", + "indexmap", + "slab", + "tokio", + "tokio-util", + "tracing", +] + [[package]] name = "hashbrown" version = "0.12.3" @@ -145,6 +270,77 @@ version = "0.4.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7f24254aa9a54b5c858eaee2f5bccdb46aaf0e486a595ed5fd8f86ba55232a70" +[[package]] +name = "http" +version = "0.2.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "75f43d41e26995c17e71ee126451dd3941010b0514a81a9d11f3b341debc2399" +dependencies = [ + "bytes", + "fnv", + "itoa", +] + +[[package]] +name = "http-body" +version = "0.4.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d5f38f16d184e36f2408a55281cd658ecbd3ca05cce6d6510a176eca393e26d1" +dependencies = [ + "bytes", + "http", + "pin-project-lite", +] + +[[package]] +name = "httparse" +version = "1.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d897f394bad6a705d5f4104762e116a75639e470d80901eed05a860a95cb1904" + +[[package]] +name = "httpdate" +version = "1.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c4a1e36c821dbe04574f602848a19f742f4fb3c98d40449f11bcad18d6b17421" + +[[package]] +name = "hyper" +version = "0.14.23" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "034711faac9d2166cb1baf1a2fb0b60b1f277f8492fd72176c17f3515e1abd3c" +dependencies = [ + "bytes", + "futures-channel", + "futures-core", + "futures-util", + "h2", + "http", + "http-body", + "httparse", + "httpdate", + "itoa", + "pin-project-lite", + "socket2", + "tokio", + "tower-service", + "tracing", + "want", +] + +[[package]] +name = "hyper-tls" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d6183ddfa99b85da61a140bea0efc93fdf56ceaa041b37d553518030827f9905" +dependencies = [ + "bytes", + "hyper", + "native-tls", + "tokio", + "tokio-native-tls", +] + [[package]] name = "idna" version = "0.3.0" @@ -171,6 +367,21 @@ dependencies = [ "hashbrown", ] +[[package]] +name = "instant" +version = "0.1.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7a5bbe824c507c5da5956355e86a746d82e0e1464f65d862cc5e71da70e94b2c" +dependencies = [ + "cfg-if", +] + +[[package]] +name = "ipnet" +version = "2.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f88c5561171189e69df9d98bcf18fd5f9558300f7ea7b801eb8a0fd748bd8745" + [[package]] name = "itoa" version = "1.0.4" @@ -186,6 +397,15 @@ dependencies = [ "libc", ] +[[package]] +name = "js-sys" +version = "0.3.60" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "49409df3e3bf0856b916e2ceaca09ee28e6871cf7d9ce97a692cacfdb2a25a47" +dependencies = [ + "wasm-bindgen", +] + [[package]] name = "lazy_static" version = "1.4.0" @@ -272,6 +492,22 @@ version = "2.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2dffe52ecf27772e601905b7522cb4ef790d2cc203488bbd0e2fe85fcb74566d" +[[package]] +name = "mime" +version = "0.3.16" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2a60c7ce501c71e03a9c9c0d35b861413ae925bd979cc7a4e30d060069aaac8d" + +[[package]] +name = "mime_guess" +version = "2.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4192263c238a5f0d0c6bfd21f336a313a4ce1c450542449ca191bb657b4642ef" +dependencies = [ + "mime", + "unicase", +] + [[package]] name = "mio" version = "0.8.5" @@ -281,7 +517,25 @@ dependencies = [ "libc", "log", "wasi", - "windows-sys", + "windows-sys 0.42.0", +] + +[[package]] +name = "native-tls" +version = "0.2.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "07226173c32f2926027b63cce4bcd8076c3552846cbe7925f3aaffeac0a3b92e" +dependencies = [ + "lazy_static", + "libc", + "log", + "openssl", + "openssl-probe", + "openssl-sys", + "schannel", + "security-framework", + "security-framework-sys", + "tempfile", ] [[package]] @@ -356,6 +610,44 @@ version = "1.15.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e82dad04139b71a90c080c8463fe0dc7902db5192d939bd0950f074d014339e1" +[[package]] +name = "openapi" +version = "1.17.3" +dependencies = [ + "reqwest", + "serde", + "serde_derive", + "serde_json", + "url", + "uuid", +] + +[[package]] +name = "openssl" +version = "0.10.43" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "020433887e44c27ff16365eaa2d380547a94544ad509aff6eb5b6e3e0b27b376" +dependencies = [ + "bitflags", + "cfg-if", + "foreign-types", + "libc", + "once_cell", + "openssl-macros", + "openssl-sys", +] + +[[package]] +name = "openssl-macros" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b501e44f11665960c7e7fcf062c7d96a14ade4aa98116c004b2e37b5be7d736c" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + [[package]] name = "openssl-probe" version = "0.1.5" @@ -364,9 +656,9 @@ checksum = "ff011a302c396a5197692431fc1948019154afc178baf7d8e37367442a4601cf" [[package]] name = "openssl-sys" -version = "0.9.77" +version = "0.9.78" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b03b84c3b2d099b81f0953422b4d4ad58761589d0229b5506356afca05a3670a" +checksum = "07d5c8cb6e57b3a3612064d7b18b117912b4ce70955c2504d4b741c9e244b132" dependencies = [ "autocfg", "cc", @@ -407,7 +699,7 @@ dependencies = [ "libc", "redox_syscall", "smallvec", - "windows-sys", + "windows-sys 0.42.0", ] [[package]] @@ -422,6 +714,12 @@ version = "0.2.9" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e0a7ae3ac2f1173085d398531c705756c94a4c56843785df85a60c1a0afac116" +[[package]] +name = "pin-utils" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8b870d8c151b6f2fb93e84a13146138f05d02ed11c7e7c54f8826aaaf7c9f184" + [[package]] name = "pkg-config" version = "0.3.25" @@ -515,18 +813,98 @@ version = "0.6.28" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "456c603be3e8d448b072f410900c09faf164fbce2d480456f50eea6e25f9c848" +[[package]] +name = "remove_dir_all" +version = "0.5.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3acd125665422973a33ac9d3dd2df85edad0f4ae9b00dafb1a05e43a9f5ef8e7" +dependencies = [ + "winapi", +] + +[[package]] +name = "reqwest" +version = "0.11.13" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "68cc60575865c7831548863cc02356512e3f1dc2f3f82cb837d7fc4cc8f3c97c" +dependencies = [ + "base64", + "bytes", + "encoding_rs", + "futures-core", + "futures-util", + "h2", + "http", + "http-body", + "hyper", + "hyper-tls", + "ipnet", + "js-sys", + "log", + "mime", + "mime_guess", + "native-tls", + "once_cell", + "percent-encoding", + "pin-project-lite", + "serde", + "serde_json", + "serde_urlencoded", + "tokio", + "tokio-native-tls", + "tower-service", + "url", + "wasm-bindgen", + "wasm-bindgen-futures", + "web-sys", + "winreg", +] + [[package]] name = "ryu" version = "1.0.11" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4501abdff3ae82a1c1b477a17252eb69cee9e66eb915c1abaa4f44d873df9f09" +[[package]] +name = "schannel" +version = "0.1.20" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "88d6731146462ea25d9244b2ed5fd1d716d25c52e4d54aa4fb0f3c4e9854dbe2" +dependencies = [ + "lazy_static", + "windows-sys 0.36.1", +] + [[package]] name = "scopeguard" version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d29ab0c6d3fc0ee92fe66e2d99f700eab17a8d57d1c1d3b748380fb20baa78cd" +[[package]] +name = "security-framework" +version = "2.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2bc1bb97804af6631813c55739f771071e0f2ed33ee20b68c86ec505d906356c" +dependencies = [ + "bitflags", + "core-foundation", + "core-foundation-sys", + "libc", + "security-framework-sys", +] + +[[package]] +name = "security-framework-sys" +version = "2.6.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0160a13a177a45bfb43ce71c01580998474f556ad854dcbca936dd2841a5c556" +dependencies = [ + "core-foundation-sys", + "libc", +] + [[package]] name = "serde" version = "1.0.147" @@ -558,6 +936,18 @@ dependencies = [ "serde", ] +[[package]] +name = "serde_urlencoded" +version = "0.7.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d3491c14715ca2294c4d6a88f15e84739788c1d030eed8c110436aafdaa2f3fd" +dependencies = [ + "form_urlencoded", + "itoa", + "ryu", + "serde", +] + [[package]] name = "serde_yaml" version = "0.9.14" @@ -589,6 +979,15 @@ dependencies = [ "libc", ] +[[package]] +name = "slab" +version = "0.4.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4614a76b2a8be0058caa9dbbaf66d988527d86d003c11a94fbd335d7661edcef" +dependencies = [ + "autocfg", +] + [[package]] name = "smallvec" version = "1.10.0" @@ -622,6 +1021,20 @@ dependencies = [ "unicode-ident", ] +[[package]] +name = "tempfile" +version = "3.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5cdb1ef4eaeeaddc8fbd371e5017057064af0911902ef36b39801f67cc6d79e4" +dependencies = [ + "cfg-if", + "fastrand", + "libc", + "redox_syscall", + "remove_dir_all", + "winapi", +] + [[package]] name = "termcolor" version = "1.1.3" @@ -686,6 +1099,36 @@ dependencies = [ "syn", ] +[[package]] +name = "tokio-native-tls" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f7d995660bd2b7f8c1568414c1126076c13fbb725c40112dc0120b78eb9b717b" +dependencies = [ + "native-tls", + "tokio", +] + +[[package]] +name = "tokio-util" +version = "0.7.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0bb2e075f03b3d66d8d8785356224ba688d2906a371015e225beeb65ca92c740" +dependencies = [ + "bytes", + "futures-core", + "futures-sink", + "pin-project-lite", + "tokio", + "tracing", +] + +[[package]] +name = "tower-service" +version = "0.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b6bc1c9ce2b5135ac7f93c72918fc37feb872bdc6a5533a8b85eb4b86bfdae52" + [[package]] name = "tracing" version = "0.1.37" @@ -762,6 +1205,21 @@ dependencies = [ "tracing-serde", ] +[[package]] +name = "try-lock" +version = "0.2.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "59547bce71d9c38b83d9c0e92b6066c4253371f15005def0c30d9657f50c7642" + +[[package]] +name = "unicase" +version = "2.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "50f37be617794602aabbeee0be4f259dc1778fabe05e2d67ee8f79326d5cb4f6" +dependencies = [ + "version_check", +] + [[package]] name = "unicode-bidi" version = "0.3.8" @@ -800,6 +1258,15 @@ dependencies = [ "percent-encoding", ] +[[package]] +name = "uuid" +version = "1.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "422ee0de9031b5b948b97a8fc04e3aa35230001a722ddd27943e0be31564ce4c" +dependencies = [ + "serde", +] + [[package]] name = "valuable" version = "0.1.0" @@ -812,12 +1279,104 @@ version = "0.2.15" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "accd4ea62f7bb7a82fe23066fb0957d48ef677f6eeb8215f372f52e48bb32426" +[[package]] +name = "version_check" +version = "0.9.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "49874b5167b65d7193b8aba1567f5c7d93d001cafc34600cee003eda787e483f" + +[[package]] +name = "want" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1ce8a968cb1cd110d136ff8b819a556d6fb6d919363c61534f6860c7eb172ba0" +dependencies = [ + "log", + "try-lock", +] + [[package]] name = "wasi" version = "0.11.0+wasi-snapshot-preview1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423" +[[package]] +name = "wasm-bindgen" +version = "0.2.83" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "eaf9f5aceeec8be17c128b2e93e031fb8a4d469bb9c4ae2d7dc1888b26887268" +dependencies = [ + "cfg-if", + "wasm-bindgen-macro", +] + +[[package]] +name = "wasm-bindgen-backend" +version = "0.2.83" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4c8ffb332579b0557b52d268b91feab8df3615f265d5270fec2a8c95b17c1142" +dependencies = [ + "bumpalo", + "log", + "once_cell", + "proc-macro2", + "quote", + "syn", + "wasm-bindgen-shared", +] + +[[package]] +name = "wasm-bindgen-futures" +version = "0.4.33" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "23639446165ca5a5de86ae1d8896b737ae80319560fbaa4c2887b7da6e7ebd7d" +dependencies = [ + "cfg-if", + "js-sys", + "wasm-bindgen", + "web-sys", +] + +[[package]] +name = "wasm-bindgen-macro" +version = "0.2.83" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "052be0f94026e6cbc75cdefc9bae13fd6052cdcaf532fa6c45e7ae33a1e6c810" +dependencies = [ + "quote", + "wasm-bindgen-macro-support", +] + +[[package]] +name = "wasm-bindgen-macro-support" +version = "0.2.83" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "07bc0c051dc5f23e307b13285f9d75df86bfdf816c5721e573dec1f9b8aa193c" +dependencies = [ + "proc-macro2", + "quote", + "syn", + "wasm-bindgen-backend", + "wasm-bindgen-shared", +] + +[[package]] +name = "wasm-bindgen-shared" +version = "0.2.83" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1c38c045535d93ec4f0b4defec448e4291638ee608530863b1e2ba115d4fff7f" + +[[package]] +name = "web-sys" +version = "0.3.60" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bcda906d8be16e728fd5adc5b729afad4e444e106ab28cd1c7256e54fa61510f" +dependencies = [ + "js-sys", + "wasm-bindgen", +] + [[package]] name = "winapi" version = "0.3.9" @@ -849,6 +1408,19 @@ version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" +[[package]] +name = "windows-sys" +version = "0.36.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ea04155a16a59f9eab786fe12a4a450e75cdb175f9e0d80da1e17db09f55b8d2" +dependencies = [ + "windows_aarch64_msvc 0.36.1", + "windows_i686_gnu 0.36.1", + "windows_i686_msvc 0.36.1", + "windows_x86_64_gnu 0.36.1", + "windows_x86_64_msvc 0.36.1", +] + [[package]] name = "windows-sys" version = "0.42.0" @@ -856,12 +1428,12 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5a3e1820f08b8513f676f7ab6c1f99ff312fb97b553d30ff4dd86f9f15728aa7" dependencies = [ "windows_aarch64_gnullvm", - "windows_aarch64_msvc", - "windows_i686_gnu", - "windows_i686_msvc", - "windows_x86_64_gnu", + "windows_aarch64_msvc 0.42.0", + "windows_i686_gnu 0.42.0", + "windows_i686_msvc 0.42.0", + "windows_x86_64_gnu 0.42.0", "windows_x86_64_gnullvm", - "windows_x86_64_msvc", + "windows_x86_64_msvc 0.42.0", ] [[package]] @@ -870,24 +1442,48 @@ version = "0.42.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "41d2aa71f6f0cbe00ae5167d90ef3cfe66527d6f613ca78ac8024c3ccab9a19e" +[[package]] +name = "windows_aarch64_msvc" +version = "0.36.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9bb8c3fd39ade2d67e9874ac4f3db21f0d710bee00fe7cab16949ec184eeaa47" + [[package]] name = "windows_aarch64_msvc" version = "0.42.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "dd0f252f5a35cac83d6311b2e795981f5ee6e67eb1f9a7f64eb4500fbc4dcdb4" +[[package]] +name = "windows_i686_gnu" +version = "0.36.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "180e6ccf01daf4c426b846dfc66db1fc518f074baa793aa7d9b9aaeffad6a3b6" + [[package]] name = "windows_i686_gnu" version = "0.42.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "fbeae19f6716841636c28d695375df17562ca208b2b7d0dc47635a50ae6c5de7" +[[package]] +name = "windows_i686_msvc" +version = "0.36.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e2e7917148b2812d1eeafaeb22a97e4813dfa60a3f8f78ebe204bcc88f12f024" + [[package]] name = "windows_i686_msvc" version = "0.42.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "84c12f65daa39dd2babe6e442988fc329d6243fdce47d7d2d155b8d874862246" +[[package]] +name = "windows_x86_64_gnu" +version = "0.36.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4dcd171b8776c41b97521e5da127a2d86ad280114807d0b2ab1e462bc764d9e1" + [[package]] name = "windows_x86_64_gnu" version = "0.42.0" @@ -900,8 +1496,23 @@ version = "0.42.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "09d525d2ba30eeb3297665bd434a54297e4170c7f1a44cad4ef58095b4cd2028" +[[package]] +name = "windows_x86_64_msvc" +version = "0.36.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c811ca4a8c853ef420abd8592ba53ddbbac90410fab6903b3e79972a631f7680" + [[package]] name = "windows_x86_64_msvc" version = "0.42.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f40009d85759725a34da6d89a94e63d7bdc50a862acf0dbc7c8e488f1edcb6f5" + +[[package]] +name = "winreg" +version = "0.10.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "80d0f4e272c85def139476380b12f9ac60926689dd2e01d4923222f40580869d" +dependencies = [ + "winapi", +] diff --git a/Cargo.toml b/Cargo.toml index 2d0b8c2..d25d334 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -10,6 +10,7 @@ members = [ "crates/octopush_cli", "crates/octopush_infra", "crates/octopush_core", + "crates/gitea_raw_client", ] [workspace.dependencies] diff --git a/crates/gitea_raw_client/.gitignore b/crates/gitea_raw_client/.gitignore new file mode 100644 index 0000000..6aa1064 --- /dev/null +++ b/crates/gitea_raw_client/.gitignore @@ -0,0 +1,3 @@ +/target/ +**/*.rs.bk +Cargo.lock diff --git a/crates/gitea_raw_client/.openapi-generator-ignore b/crates/gitea_raw_client/.openapi-generator-ignore new file mode 100644 index 0000000..7484ee5 --- /dev/null +++ b/crates/gitea_raw_client/.openapi-generator-ignore @@ -0,0 +1,23 @@ +# OpenAPI Generator Ignore +# Generated by openapi-generator https://github.com/openapitools/openapi-generator + +# Use this file to prevent files from being overwritten by the generator. +# The patterns follow closely to .gitignore or .dockerignore. + +# As an example, the C# client generator defines ApiClient.cs. +# You can make changes and tell OpenAPI Generator to ignore just this file by uncommenting the following line: +#ApiClient.cs + +# You can match any string of characters against a directory, file or extension with a single asterisk (*): +#foo/*/qux +# The above matches foo/bar/qux and foo/baz/qux, but not foo/bar/baz/qux + +# You can recursively match patterns against a directory, file or extension with a double asterisk (**): +#foo/**/qux +# This matches foo/bar/qux, foo/baz/qux, and foo/bar/baz/qux + +# You can also negate patterns with an exclamation (!). +# For example, you can ignore all files in a docs folder with the file extension .md: +#docs/*.md +# Then explicitly reverse the ignore rule for a single file: +#!docs/README.md diff --git a/crates/gitea_raw_client/.openapi-generator/FILES b/crates/gitea_raw_client/.openapi-generator/FILES new file mode 100644 index 0000000..4621419 --- /dev/null +++ b/crates/gitea_raw_client/.openapi-generator/FILES @@ -0,0 +1,335 @@ +.gitignore +.travis.yml +Cargo.toml +README.md +docs/AccessToken.md +docs/AddCollaboratorOption.md +docs/AddTimeOption.md +docs/AdminApi.md +docs/AnnotatedTag.md +docs/AnnotatedTagObject.md +docs/ApiError.md +docs/Attachment.md +docs/Branch.md +docs/BranchProtection.md +docs/CombinedStatus.md +docs/Comment.md +docs/Commit.md +docs/CommitAffectedFiles.md +docs/CommitDateOptions.md +docs/CommitMeta.md +docs/CommitStats.md +docs/CommitStatus.md +docs/CommitUser.md +docs/ContentsResponse.md +docs/CreateAccessTokenOption.md +docs/CreateBranchProtectionOption.md +docs/CreateBranchRepoOption.md +docs/CreateEmailOption.md +docs/CreateFileOptions.md +docs/CreateForkOption.md +docs/CreateGpgKeyOption.md +docs/CreateHookOption.md +docs/CreateIssueCommentOption.md +docs/CreateIssueOption.md +docs/CreateKeyOption.md +docs/CreateLabelOption.md +docs/CreateMilestoneOption.md +docs/CreateOAuth2ApplicationOptions.md +docs/CreateOrgOption.md +docs/CreatePullRequestOption.md +docs/CreatePullReviewComment.md +docs/CreatePullReviewOptions.md +docs/CreateReleaseOption.md +docs/CreateRepoOption.md +docs/CreateStatusOption.md +docs/CreateTagOption.md +docs/CreateTeamOption.md +docs/CreateUserOption.md +docs/CreateWikiPageOptions.md +docs/Cron.md +docs/DeleteEmailOption.md +docs/DeleteFileOptions.md +docs/DeployKey.md +docs/DismissPullReviewOptions.md +docs/EditAttachmentOptions.md +docs/EditBranchProtectionOption.md +docs/EditDeadlineOption.md +docs/EditGitHookOption.md +docs/EditHookOption.md +docs/EditIssueCommentOption.md +docs/EditIssueOption.md +docs/EditLabelOption.md +docs/EditMilestoneOption.md +docs/EditOrgOption.md +docs/EditPullRequestOption.md +docs/EditReactionOption.md +docs/EditReleaseOption.md +docs/EditRepoOption.md +docs/EditTeamOption.md +docs/EditUserOption.md +docs/Email.md +docs/ExternalTracker.md +docs/ExternalWiki.md +docs/FileCommitResponse.md +docs/FileDeleteResponse.md +docs/FileLinksResponse.md +docs/FileResponse.md +docs/GeneralApiSettings.md +docs/GeneralAttachmentSettings.md +docs/GeneralRepoSettings.md +docs/GeneralUiSettings.md +docs/GenerateRepoOption.md +docs/GitBlobResponse.md +docs/GitEntry.md +docs/GitHook.md +docs/GitObject.md +docs/GitTreeResponse.md +docs/GpgKey.md +docs/GpgKeyEmail.md +docs/Hook.md +docs/Identity.md +docs/InternalTracker.md +docs/Issue.md +docs/IssueApi.md +docs/IssueDeadline.md +docs/IssueLabelsOption.md +docs/IssueTemplate.md +docs/Label.md +docs/MarkdownOption.md +docs/MergePullRequestOption.md +docs/MigrateRepoForm.md +docs/MigrateRepoOptions.md +docs/Milestone.md +docs/MiscellaneousApi.md +docs/NodeInfo.md +docs/NodeInfoServices.md +docs/NodeInfoSoftware.md +docs/NodeInfoUsage.md +docs/NodeInfoUsageUsers.md +docs/Note.md +docs/NotificationApi.md +docs/NotificationCount.md +docs/NotificationSubject.md +docs/NotificationThread.md +docs/OAuth2Application.md +docs/Organization.md +docs/OrganizationApi.md +docs/OrganizationPermissions.md +docs/Package.md +docs/PackageApi.md +docs/PackageFile.md +docs/PayloadCommit.md +docs/PayloadCommitVerification.md +docs/PayloadUser.md +docs/Permission.md +docs/PrBranchInfo.md +docs/PublicKey.md +docs/PullRequest.md +docs/PullRequestMeta.md +docs/PullReview.md +docs/PullReviewComment.md +docs/PullReviewRequestOptions.md +docs/Reaction.md +docs/Reference.md +docs/Release.md +docs/RepoCollaboratorPermission.md +docs/RepoCommit.md +docs/RepoTopicOptions.md +docs/RepoTransfer.md +docs/Repository.md +docs/RepositoryApi.md +docs/RepositoryMeta.md +docs/SearchResults.md +docs/ServerVersion.md +docs/SettingsApi.md +docs/StopWatch.md +docs/SubmitPullReviewOptions.md +docs/Tag.md +docs/Team.md +docs/TeamSearch200Response.md +docs/TimelineComment.md +docs/TopicName.md +docs/TopicResponse.md +docs/TrackedTime.md +docs/TransferRepoOption.md +docs/UpdateFileOptions.md +docs/User.md +docs/UserApi.md +docs/UserHeatmapData.md +docs/UserSearch200Response.md +docs/UserSettings.md +docs/UserSettingsOptions.md +docs/WatchInfo.md +docs/WikiCommit.md +docs/WikiCommitList.md +docs/WikiPage.md +docs/WikiPageMetaData.md +git_push.sh +src/apis/admin_api.rs +src/apis/configuration.rs +src/apis/issue_api.rs +src/apis/miscellaneous_api.rs +src/apis/mod.rs +src/apis/notification_api.rs +src/apis/organization_api.rs +src/apis/package_api.rs +src/apis/repository_api.rs +src/apis/settings_api.rs +src/apis/user_api.rs +src/lib.rs +src/models/access_token.rs +src/models/add_collaborator_option.rs +src/models/add_time_option.rs +src/models/annotated_tag.rs +src/models/annotated_tag_object.rs +src/models/api_error.rs +src/models/attachment.rs +src/models/branch.rs +src/models/branch_protection.rs +src/models/combined_status.rs +src/models/comment.rs +src/models/commit.rs +src/models/commit_affected_files.rs +src/models/commit_date_options.rs +src/models/commit_meta.rs +src/models/commit_stats.rs +src/models/commit_status.rs +src/models/commit_user.rs +src/models/contents_response.rs +src/models/create_access_token_option.rs +src/models/create_branch_protection_option.rs +src/models/create_branch_repo_option.rs +src/models/create_email_option.rs +src/models/create_file_options.rs +src/models/create_fork_option.rs +src/models/create_gpg_key_option.rs +src/models/create_hook_option.rs +src/models/create_issue_comment_option.rs +src/models/create_issue_option.rs +src/models/create_key_option.rs +src/models/create_label_option.rs +src/models/create_milestone_option.rs +src/models/create_o_auth2_application_options.rs +src/models/create_org_option.rs +src/models/create_pull_request_option.rs +src/models/create_pull_review_comment.rs +src/models/create_pull_review_options.rs +src/models/create_release_option.rs +src/models/create_repo_option.rs +src/models/create_status_option.rs +src/models/create_tag_option.rs +src/models/create_team_option.rs +src/models/create_user_option.rs +src/models/create_wiki_page_options.rs +src/models/cron.rs +src/models/delete_email_option.rs +src/models/delete_file_options.rs +src/models/deploy_key.rs +src/models/dismiss_pull_review_options.rs +src/models/edit_attachment_options.rs +src/models/edit_branch_protection_option.rs +src/models/edit_deadline_option.rs +src/models/edit_git_hook_option.rs +src/models/edit_hook_option.rs +src/models/edit_issue_comment_option.rs +src/models/edit_issue_option.rs +src/models/edit_label_option.rs +src/models/edit_milestone_option.rs +src/models/edit_org_option.rs +src/models/edit_pull_request_option.rs +src/models/edit_reaction_option.rs +src/models/edit_release_option.rs +src/models/edit_repo_option.rs +src/models/edit_team_option.rs +src/models/edit_user_option.rs +src/models/email.rs +src/models/external_tracker.rs +src/models/external_wiki.rs +src/models/file_commit_response.rs +src/models/file_delete_response.rs +src/models/file_links_response.rs +src/models/file_response.rs +src/models/general_api_settings.rs +src/models/general_attachment_settings.rs +src/models/general_repo_settings.rs +src/models/general_ui_settings.rs +src/models/generate_repo_option.rs +src/models/git_blob_response.rs +src/models/git_entry.rs +src/models/git_hook.rs +src/models/git_object.rs +src/models/git_tree_response.rs +src/models/gpg_key.rs +src/models/gpg_key_email.rs +src/models/hook.rs +src/models/identity.rs +src/models/internal_tracker.rs +src/models/issue.rs +src/models/issue_deadline.rs +src/models/issue_labels_option.rs +src/models/issue_template.rs +src/models/label.rs +src/models/markdown_option.rs +src/models/merge_pull_request_option.rs +src/models/migrate_repo_form.rs +src/models/migrate_repo_options.rs +src/models/milestone.rs +src/models/mod.rs +src/models/node_info.rs +src/models/node_info_services.rs +src/models/node_info_software.rs +src/models/node_info_usage.rs +src/models/node_info_usage_users.rs +src/models/note.rs +src/models/notification_count.rs +src/models/notification_subject.rs +src/models/notification_thread.rs +src/models/o_auth2_application.rs +src/models/organization.rs +src/models/organization_permissions.rs +src/models/package.rs +src/models/package_file.rs +src/models/payload_commit.rs +src/models/payload_commit_verification.rs +src/models/payload_user.rs +src/models/permission.rs +src/models/pr_branch_info.rs +src/models/public_key.rs +src/models/pull_request.rs +src/models/pull_request_meta.rs +src/models/pull_review.rs +src/models/pull_review_comment.rs +src/models/pull_review_request_options.rs +src/models/reaction.rs +src/models/reference.rs +src/models/release.rs +src/models/repo_collaborator_permission.rs +src/models/repo_commit.rs +src/models/repo_topic_options.rs +src/models/repo_transfer.rs +src/models/repository.rs +src/models/repository_meta.rs +src/models/search_results.rs +src/models/server_version.rs +src/models/stop_watch.rs +src/models/submit_pull_review_options.rs +src/models/tag.rs +src/models/team.rs +src/models/team_search_200_response.rs +src/models/timeline_comment.rs +src/models/topic_name.rs +src/models/topic_response.rs +src/models/tracked_time.rs +src/models/transfer_repo_option.rs +src/models/update_file_options.rs +src/models/user.rs +src/models/user_heatmap_data.rs +src/models/user_search_200_response.rs +src/models/user_settings.rs +src/models/user_settings_options.rs +src/models/watch_info.rs +src/models/wiki_commit.rs +src/models/wiki_commit_list.rs +src/models/wiki_page.rs +src/models/wiki_page_meta_data.rs diff --git a/crates/gitea_raw_client/.openapi-generator/VERSION b/crates/gitea_raw_client/.openapi-generator/VERSION new file mode 100644 index 0000000..d6b4ec4 --- /dev/null +++ b/crates/gitea_raw_client/.openapi-generator/VERSION @@ -0,0 +1 @@ +6.3.0-SNAPSHOT \ No newline at end of file diff --git a/crates/gitea_raw_client/.travis.yml b/crates/gitea_raw_client/.travis.yml new file mode 100644 index 0000000..22761ba --- /dev/null +++ b/crates/gitea_raw_client/.travis.yml @@ -0,0 +1 @@ +language: rust diff --git a/crates/gitea_raw_client/Cargo.toml b/crates/gitea_raw_client/Cargo.toml index a6e37b4..425c23c 100644 --- a/crates/gitea_raw_client/Cargo.toml +++ b/crates/gitea_raw_client/Cargo.toml @@ -1,8 +1,17 @@ [package] name = "gitea_raw_client" -version = "0.1.0" -edition = "2021" - -# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html +version = "1.17.3" +authors = ["OpenAPI Generator team and contributors"] +description = "This documentation describes the Gitea API." +license = "MIT" +edition = "2018" [dependencies] +serde = "^1.0" +serde_derive = "^1.0" +serde_json = "^1.0" +url = "^2.2" +uuid = { version = "^1.0", features = ["serde"] } +[dependencies.reqwest] +version = "^0.11" +features = ["json", "multipart"] diff --git a/crates/gitea_raw_client/README.md b/crates/gitea_raw_client/README.md new file mode 100644 index 0000000..b4b5ef0 --- /dev/null +++ b/crates/gitea_raw_client/README.md @@ -0,0 +1,499 @@ +# Rust API client for gitea_raw_client + +This documentation describes the Gitea API. + + +## Overview + +This API client was generated by the [OpenAPI Generator](https://openapi-generator.tech) project. By using the [openapi-spec](https://openapis.org) from a remote server, you can easily generate an API client. + +- API version: 1.17.3 +- Package version: 1.17.3 +- Build package: `org.openapitools.codegen.languages.RustClientCodegen` + +## Installation + +Put the package under your project folder in a directory named `gitea_raw_client` and add the following to `Cargo.toml` under `[dependencies]`: + +``` +gitea_raw_client = { path = "./gitea_raw_client" } +``` + +## Documentation for API Endpoints + +All URIs are relative to */api/v1* + +Class | Method | HTTP request | Description +------------ | ------------- | ------------- | ------------- +*AdminApi* | [**admin_adopt_repository**](docs/AdminApi.md#admin_adopt_repository) | **POST** /admin/unadopted/{owner}/{repo} | Adopt unadopted files as a repository +*AdminApi* | [**admin_create_org**](docs/AdminApi.md#admin_create_org) | **POST** /admin/users/{username}/orgs | Create an organization +*AdminApi* | [**admin_create_public_key**](docs/AdminApi.md#admin_create_public_key) | **POST** /admin/users/{username}/keys | Add a public key on behalf of a user +*AdminApi* | [**admin_create_repo**](docs/AdminApi.md#admin_create_repo) | **POST** /admin/users/{username}/repos | Create a repository on behalf of a user +*AdminApi* | [**admin_create_user**](docs/AdminApi.md#admin_create_user) | **POST** /admin/users | Create a user +*AdminApi* | [**admin_cron_list**](docs/AdminApi.md#admin_cron_list) | **GET** /admin/cron | List cron tasks +*AdminApi* | [**admin_cron_run**](docs/AdminApi.md#admin_cron_run) | **POST** /admin/cron/{task} | Run cron task +*AdminApi* | [**admin_delete_unadopted_repository**](docs/AdminApi.md#admin_delete_unadopted_repository) | **DELETE** /admin/unadopted/{owner}/{repo} | Delete unadopted files +*AdminApi* | [**admin_delete_user**](docs/AdminApi.md#admin_delete_user) | **DELETE** /admin/users/{username} | Delete a user +*AdminApi* | [**admin_delete_user_public_key**](docs/AdminApi.md#admin_delete_user_public_key) | **DELETE** /admin/users/{username}/keys/{id} | Delete a user's public key +*AdminApi* | [**admin_edit_user**](docs/AdminApi.md#admin_edit_user) | **PATCH** /admin/users/{username} | Edit an existing user +*AdminApi* | [**admin_get_all_orgs**](docs/AdminApi.md#admin_get_all_orgs) | **GET** /admin/orgs | List all organizations +*AdminApi* | [**admin_get_all_users**](docs/AdminApi.md#admin_get_all_users) | **GET** /admin/users | List all users +*AdminApi* | [**admin_unadopted_list**](docs/AdminApi.md#admin_unadopted_list) | **GET** /admin/unadopted | List unadopted repositories +*IssueApi* | [**issue_add_label**](docs/IssueApi.md#issue_add_label) | **POST** /repos/{owner}/{repo}/issues/{index}/labels | Add a label to an issue +*IssueApi* | [**issue_add_subscription**](docs/IssueApi.md#issue_add_subscription) | **PUT** /repos/{owner}/{repo}/issues/{index}/subscriptions/{user} | Subscribe user to issue +*IssueApi* | [**issue_add_time**](docs/IssueApi.md#issue_add_time) | **POST** /repos/{owner}/{repo}/issues/{index}/times | Add tracked time to a issue +*IssueApi* | [**issue_check_subscription**](docs/IssueApi.md#issue_check_subscription) | **GET** /repos/{owner}/{repo}/issues/{index}/subscriptions/check | Check if user is subscribed to an issue +*IssueApi* | [**issue_clear_labels**](docs/IssueApi.md#issue_clear_labels) | **DELETE** /repos/{owner}/{repo}/issues/{index}/labels | Remove all labels from an issue +*IssueApi* | [**issue_create_comment**](docs/IssueApi.md#issue_create_comment) | **POST** /repos/{owner}/{repo}/issues/{index}/comments | Add a comment to an issue +*IssueApi* | [**issue_create_issue**](docs/IssueApi.md#issue_create_issue) | **POST** /repos/{owner}/{repo}/issues | Create an issue. If using deadline only the date will be taken into account, and time of day ignored. +*IssueApi* | [**issue_create_label**](docs/IssueApi.md#issue_create_label) | **POST** /repos/{owner}/{repo}/labels | Create a label +*IssueApi* | [**issue_create_milestone**](docs/IssueApi.md#issue_create_milestone) | **POST** /repos/{owner}/{repo}/milestones | Create a milestone +*IssueApi* | [**issue_delete**](docs/IssueApi.md#issue_delete) | **DELETE** /repos/{owner}/{repo}/issues/{index} | Delete an issue +*IssueApi* | [**issue_delete_comment**](docs/IssueApi.md#issue_delete_comment) | **DELETE** /repos/{owner}/{repo}/issues/comments/{id} | Delete a comment +*IssueApi* | [**issue_delete_comment_deprecated**](docs/IssueApi.md#issue_delete_comment_deprecated) | **DELETE** /repos/{owner}/{repo}/issues/{index}/comments/{id} | Delete a comment +*IssueApi* | [**issue_delete_comment_reaction**](docs/IssueApi.md#issue_delete_comment_reaction) | **DELETE** /repos/{owner}/{repo}/issues/comments/{id}/reactions | Remove a reaction from a comment of an issue +*IssueApi* | [**issue_delete_issue_reaction**](docs/IssueApi.md#issue_delete_issue_reaction) | **DELETE** /repos/{owner}/{repo}/issues/{index}/reactions | Remove a reaction from an issue +*IssueApi* | [**issue_delete_label**](docs/IssueApi.md#issue_delete_label) | **DELETE** /repos/{owner}/{repo}/labels/{id} | Delete a label +*IssueApi* | [**issue_delete_milestone**](docs/IssueApi.md#issue_delete_milestone) | **DELETE** /repos/{owner}/{repo}/milestones/{id} | Delete a milestone +*IssueApi* | [**issue_delete_stop_watch**](docs/IssueApi.md#issue_delete_stop_watch) | **DELETE** /repos/{owner}/{repo}/issues/{index}/stopwatch/delete | Delete an issue's existing stopwatch. +*IssueApi* | [**issue_delete_subscription**](docs/IssueApi.md#issue_delete_subscription) | **DELETE** /repos/{owner}/{repo}/issues/{index}/subscriptions/{user} | Unsubscribe user from issue +*IssueApi* | [**issue_delete_time**](docs/IssueApi.md#issue_delete_time) | **DELETE** /repos/{owner}/{repo}/issues/{index}/times/{id} | Delete specific tracked time +*IssueApi* | [**issue_edit_comment**](docs/IssueApi.md#issue_edit_comment) | **PATCH** /repos/{owner}/{repo}/issues/comments/{id} | Edit a comment +*IssueApi* | [**issue_edit_comment_deprecated**](docs/IssueApi.md#issue_edit_comment_deprecated) | **PATCH** /repos/{owner}/{repo}/issues/{index}/comments/{id} | Edit a comment +*IssueApi* | [**issue_edit_issue**](docs/IssueApi.md#issue_edit_issue) | **PATCH** /repos/{owner}/{repo}/issues/{index} | Edit an issue. If using deadline only the date will be taken into account, and time of day ignored. +*IssueApi* | [**issue_edit_issue_deadline**](docs/IssueApi.md#issue_edit_issue_deadline) | **POST** /repos/{owner}/{repo}/issues/{index}/deadline | Set an issue deadline. If set to null, the deadline is deleted. If using deadline only the date will be taken into account, and time of day ignored. +*IssueApi* | [**issue_edit_label**](docs/IssueApi.md#issue_edit_label) | **PATCH** /repos/{owner}/{repo}/labels/{id} | Update a label +*IssueApi* | [**issue_edit_milestone**](docs/IssueApi.md#issue_edit_milestone) | **PATCH** /repos/{owner}/{repo}/milestones/{id} | Update a milestone +*IssueApi* | [**issue_get_comment**](docs/IssueApi.md#issue_get_comment) | **GET** /repos/{owner}/{repo}/issues/comments/{id} | Get a comment +*IssueApi* | [**issue_get_comment_reactions**](docs/IssueApi.md#issue_get_comment_reactions) | **GET** /repos/{owner}/{repo}/issues/comments/{id}/reactions | Get a list of reactions from a comment of an issue +*IssueApi* | [**issue_get_comments**](docs/IssueApi.md#issue_get_comments) | **GET** /repos/{owner}/{repo}/issues/{index}/comments | List all comments on an issue +*IssueApi* | [**issue_get_comments_and_timeline**](docs/IssueApi.md#issue_get_comments_and_timeline) | **GET** /repos/{owner}/{repo}/issues/{index}/timeline | List all comments and events on an issue +*IssueApi* | [**issue_get_issue**](docs/IssueApi.md#issue_get_issue) | **GET** /repos/{owner}/{repo}/issues/{index} | Get an issue +*IssueApi* | [**issue_get_issue_reactions**](docs/IssueApi.md#issue_get_issue_reactions) | **GET** /repos/{owner}/{repo}/issues/{index}/reactions | Get a list reactions of an issue +*IssueApi* | [**issue_get_label**](docs/IssueApi.md#issue_get_label) | **GET** /repos/{owner}/{repo}/labels/{id} | Get a single label +*IssueApi* | [**issue_get_labels**](docs/IssueApi.md#issue_get_labels) | **GET** /repos/{owner}/{repo}/issues/{index}/labels | Get an issue's labels +*IssueApi* | [**issue_get_milestone**](docs/IssueApi.md#issue_get_milestone) | **GET** /repos/{owner}/{repo}/milestones/{id} | Get a milestone +*IssueApi* | [**issue_get_milestones_list**](docs/IssueApi.md#issue_get_milestones_list) | **GET** /repos/{owner}/{repo}/milestones | Get all of a repository's opened milestones +*IssueApi* | [**issue_get_repo_comments**](docs/IssueApi.md#issue_get_repo_comments) | **GET** /repos/{owner}/{repo}/issues/comments | List all comments in a repository +*IssueApi* | [**issue_list_issues**](docs/IssueApi.md#issue_list_issues) | **GET** /repos/{owner}/{repo}/issues | List a repository's issues +*IssueApi* | [**issue_list_labels**](docs/IssueApi.md#issue_list_labels) | **GET** /repos/{owner}/{repo}/labels | Get all of a repository's labels +*IssueApi* | [**issue_post_comment_reaction**](docs/IssueApi.md#issue_post_comment_reaction) | **POST** /repos/{owner}/{repo}/issues/comments/{id}/reactions | Add a reaction to a comment of an issue +*IssueApi* | [**issue_post_issue_reaction**](docs/IssueApi.md#issue_post_issue_reaction) | **POST** /repos/{owner}/{repo}/issues/{index}/reactions | Add a reaction to an issue +*IssueApi* | [**issue_remove_label**](docs/IssueApi.md#issue_remove_label) | **DELETE** /repos/{owner}/{repo}/issues/{index}/labels/{id} | Remove a label from an issue +*IssueApi* | [**issue_replace_labels**](docs/IssueApi.md#issue_replace_labels) | **PUT** /repos/{owner}/{repo}/issues/{index}/labels | Replace an issue's labels +*IssueApi* | [**issue_reset_time**](docs/IssueApi.md#issue_reset_time) | **DELETE** /repos/{owner}/{repo}/issues/{index}/times | Reset a tracked time of an issue +*IssueApi* | [**issue_search_issues**](docs/IssueApi.md#issue_search_issues) | **GET** /repos/issues/search | Search for issues across the repositories that the user has access to +*IssueApi* | [**issue_start_stop_watch**](docs/IssueApi.md#issue_start_stop_watch) | **POST** /repos/{owner}/{repo}/issues/{index}/stopwatch/start | Start stopwatch on an issue. +*IssueApi* | [**issue_stop_stop_watch**](docs/IssueApi.md#issue_stop_stop_watch) | **POST** /repos/{owner}/{repo}/issues/{index}/stopwatch/stop | Stop an issue's existing stopwatch. +*IssueApi* | [**issue_subscriptions**](docs/IssueApi.md#issue_subscriptions) | **GET** /repos/{owner}/{repo}/issues/{index}/subscriptions | Get users who subscribed on an issue. +*IssueApi* | [**issue_tracked_times**](docs/IssueApi.md#issue_tracked_times) | **GET** /repos/{owner}/{repo}/issues/{index}/times | List an issue's tracked times +*MiscellaneousApi* | [**get_node_info**](docs/MiscellaneousApi.md#get_node_info) | **GET** /nodeinfo | Returns the nodeinfo of the Gitea application +*MiscellaneousApi* | [**get_signing_key**](docs/MiscellaneousApi.md#get_signing_key) | **GET** /signing-key.gpg | Get default signing-key.gpg +*MiscellaneousApi* | [**get_version**](docs/MiscellaneousApi.md#get_version) | **GET** /version | Returns the version of the Gitea application +*MiscellaneousApi* | [**render_markdown**](docs/MiscellaneousApi.md#render_markdown) | **POST** /markdown | Render a markdown document as HTML +*MiscellaneousApi* | [**render_markdown_raw**](docs/MiscellaneousApi.md#render_markdown_raw) | **POST** /markdown/raw | Render raw markdown as HTML +*NotificationApi* | [**notify_get_list**](docs/NotificationApi.md#notify_get_list) | **GET** /notifications | List users's notification threads +*NotificationApi* | [**notify_get_repo_list**](docs/NotificationApi.md#notify_get_repo_list) | **GET** /repos/{owner}/{repo}/notifications | List users's notification threads on a specific repo +*NotificationApi* | [**notify_get_thread**](docs/NotificationApi.md#notify_get_thread) | **GET** /notifications/threads/{id} | Get notification thread by ID +*NotificationApi* | [**notify_new_available**](docs/NotificationApi.md#notify_new_available) | **GET** /notifications/new | Check if unread notifications exist +*NotificationApi* | [**notify_read_list**](docs/NotificationApi.md#notify_read_list) | **PUT** /notifications | Mark notification threads as read, pinned or unread +*NotificationApi* | [**notify_read_repo_list**](docs/NotificationApi.md#notify_read_repo_list) | **PUT** /repos/{owner}/{repo}/notifications | Mark notification threads as read, pinned or unread on a specific repo +*NotificationApi* | [**notify_read_thread**](docs/NotificationApi.md#notify_read_thread) | **PATCH** /notifications/threads/{id} | Mark notification thread as read by ID +*OrganizationApi* | [**create_org_repo**](docs/OrganizationApi.md#create_org_repo) | **POST** /orgs/{org}/repos | Create a repository in an organization +*OrganizationApi* | [**create_org_repo_deprecated**](docs/OrganizationApi.md#create_org_repo_deprecated) | **POST** /org/{org}/repos | Create a repository in an organization +*OrganizationApi* | [**org_add_team_member**](docs/OrganizationApi.md#org_add_team_member) | **PUT** /teams/{id}/members/{username} | Add a team member +*OrganizationApi* | [**org_add_team_repository**](docs/OrganizationApi.md#org_add_team_repository) | **PUT** /teams/{id}/repos/{org}/{repo} | Add a repository to a team +*OrganizationApi* | [**org_conceal_member**](docs/OrganizationApi.md#org_conceal_member) | **DELETE** /orgs/{org}/public_members/{username} | Conceal a user's membership +*OrganizationApi* | [**org_create**](docs/OrganizationApi.md#org_create) | **POST** /orgs | Create an organization +*OrganizationApi* | [**org_create_hook**](docs/OrganizationApi.md#org_create_hook) | **POST** /orgs/{org}/hooks/ | Create a hook +*OrganizationApi* | [**org_create_label**](docs/OrganizationApi.md#org_create_label) | **POST** /orgs/{org}/labels | Create a label for an organization +*OrganizationApi* | [**org_create_team**](docs/OrganizationApi.md#org_create_team) | **POST** /orgs/{org}/teams | Create a team +*OrganizationApi* | [**org_delete**](docs/OrganizationApi.md#org_delete) | **DELETE** /orgs/{org} | Delete an organization +*OrganizationApi* | [**org_delete_hook**](docs/OrganizationApi.md#org_delete_hook) | **DELETE** /orgs/{org}/hooks/{id} | Delete a hook +*OrganizationApi* | [**org_delete_label**](docs/OrganizationApi.md#org_delete_label) | **DELETE** /orgs/{org}/labels/{id} | Delete a label +*OrganizationApi* | [**org_delete_member**](docs/OrganizationApi.md#org_delete_member) | **DELETE** /orgs/{org}/members/{username} | Remove a member from an organization +*OrganizationApi* | [**org_delete_team**](docs/OrganizationApi.md#org_delete_team) | **DELETE** /teams/{id} | Delete a team +*OrganizationApi* | [**org_edit**](docs/OrganizationApi.md#org_edit) | **PATCH** /orgs/{org} | Edit an organization +*OrganizationApi* | [**org_edit_hook**](docs/OrganizationApi.md#org_edit_hook) | **PATCH** /orgs/{org}/hooks/{id} | Update a hook +*OrganizationApi* | [**org_edit_label**](docs/OrganizationApi.md#org_edit_label) | **PATCH** /orgs/{org}/labels/{id} | Update a label +*OrganizationApi* | [**org_edit_team**](docs/OrganizationApi.md#org_edit_team) | **PATCH** /teams/{id} | Edit a team +*OrganizationApi* | [**org_get**](docs/OrganizationApi.md#org_get) | **GET** /orgs/{org} | Get an organization +*OrganizationApi* | [**org_get_all**](docs/OrganizationApi.md#org_get_all) | **GET** /orgs | Get list of organizations +*OrganizationApi* | [**org_get_hook**](docs/OrganizationApi.md#org_get_hook) | **GET** /orgs/{org}/hooks/{id} | Get a hook +*OrganizationApi* | [**org_get_label**](docs/OrganizationApi.md#org_get_label) | **GET** /orgs/{org}/labels/{id} | Get a single label +*OrganizationApi* | [**org_get_team**](docs/OrganizationApi.md#org_get_team) | **GET** /teams/{id} | Get a team +*OrganizationApi* | [**org_get_user_permissions**](docs/OrganizationApi.md#org_get_user_permissions) | **GET** /users/{username}/orgs/{org}/permissions | Get user permissions in organization +*OrganizationApi* | [**org_is_member**](docs/OrganizationApi.md#org_is_member) | **GET** /orgs/{org}/members/{username} | Check if a user is a member of an organization +*OrganizationApi* | [**org_is_public_member**](docs/OrganizationApi.md#org_is_public_member) | **GET** /orgs/{org}/public_members/{username} | Check if a user is a public member of an organization +*OrganizationApi* | [**org_list_current_user_orgs**](docs/OrganizationApi.md#org_list_current_user_orgs) | **GET** /user/orgs | List the current user's organizations +*OrganizationApi* | [**org_list_hooks**](docs/OrganizationApi.md#org_list_hooks) | **GET** /orgs/{org}/hooks | List an organization's webhooks +*OrganizationApi* | [**org_list_labels**](docs/OrganizationApi.md#org_list_labels) | **GET** /orgs/{org}/labels | List an organization's labels +*OrganizationApi* | [**org_list_members**](docs/OrganizationApi.md#org_list_members) | **GET** /orgs/{org}/members | List an organization's members +*OrganizationApi* | [**org_list_public_members**](docs/OrganizationApi.md#org_list_public_members) | **GET** /orgs/{org}/public_members | List an organization's public members +*OrganizationApi* | [**org_list_repos**](docs/OrganizationApi.md#org_list_repos) | **GET** /orgs/{org}/repos | List an organization's repos +*OrganizationApi* | [**org_list_team_member**](docs/OrganizationApi.md#org_list_team_member) | **GET** /teams/{id}/members/{username} | List a particular member of team +*OrganizationApi* | [**org_list_team_members**](docs/OrganizationApi.md#org_list_team_members) | **GET** /teams/{id}/members | List a team's members +*OrganizationApi* | [**org_list_team_repo**](docs/OrganizationApi.md#org_list_team_repo) | **GET** /teams/{id}/repos/{org}/{repo} | List a particular repo of team +*OrganizationApi* | [**org_list_team_repos**](docs/OrganizationApi.md#org_list_team_repos) | **GET** /teams/{id}/repos | List a team's repos +*OrganizationApi* | [**org_list_teams**](docs/OrganizationApi.md#org_list_teams) | **GET** /orgs/{org}/teams | List an organization's teams +*OrganizationApi* | [**org_list_user_orgs**](docs/OrganizationApi.md#org_list_user_orgs) | **GET** /users/{username}/orgs | List a user's organizations +*OrganizationApi* | [**org_publicize_member**](docs/OrganizationApi.md#org_publicize_member) | **PUT** /orgs/{org}/public_members/{username} | Publicize a user's membership +*OrganizationApi* | [**org_remove_team_member**](docs/OrganizationApi.md#org_remove_team_member) | **DELETE** /teams/{id}/members/{username} | Remove a team member +*OrganizationApi* | [**org_remove_team_repository**](docs/OrganizationApi.md#org_remove_team_repository) | **DELETE** /teams/{id}/repos/{org}/{repo} | Remove a repository from a team +*OrganizationApi* | [**team_search**](docs/OrganizationApi.md#team_search) | **GET** /orgs/{org}/teams/search | Search for teams within an organization +*PackageApi* | [**delete_package**](docs/PackageApi.md#delete_package) | **DELETE** /packages/{owner}/{type}/{name}/{version} | Delete a package +*PackageApi* | [**get_package**](docs/PackageApi.md#get_package) | **GET** /packages/{owner}/{type}/{name}/{version} | Gets a package +*PackageApi* | [**list_package_files**](docs/PackageApi.md#list_package_files) | **GET** /packages/{owner}/{type}/{name}/{version}/files | Gets all files of a package +*PackageApi* | [**list_packages**](docs/PackageApi.md#list_packages) | **GET** /packages/{owner} | Gets all packages of an owner +*RepositoryApi* | [**accept_repo_transfer**](docs/RepositoryApi.md#accept_repo_transfer) | **POST** /repos/{owner}/{repo}/transfer/accept | Accept a repo transfer +*RepositoryApi* | [**create_current_user_repo**](docs/RepositoryApi.md#create_current_user_repo) | **POST** /user/repos | Create a repository +*RepositoryApi* | [**create_fork**](docs/RepositoryApi.md#create_fork) | **POST** /repos/{owner}/{repo}/forks | Fork a repository +*RepositoryApi* | [**generate_repo**](docs/RepositoryApi.md#generate_repo) | **POST** /repos/{template_owner}/{template_repo}/generate | Create a repository using a template +*RepositoryApi* | [**get_annotated_tag**](docs/RepositoryApi.md#get_annotated_tag) | **GET** /repos/{owner}/{repo}/git/tags/{sha} | Gets the tag object of an annotated tag (not lightweight tags) +*RepositoryApi* | [**get_blob**](docs/RepositoryApi.md#get_blob) | **GET** /repos/{owner}/{repo}/git/blobs/{sha} | Gets the blob of a repository. +*RepositoryApi* | [**get_tree**](docs/RepositoryApi.md#get_tree) | **GET** /repos/{owner}/{repo}/git/trees/{sha} | Gets the tree of a repository. +*RepositoryApi* | [**list_forks**](docs/RepositoryApi.md#list_forks) | **GET** /repos/{owner}/{repo}/forks | List a repository's forks +*RepositoryApi* | [**reject_repo_transfer**](docs/RepositoryApi.md#reject_repo_transfer) | **POST** /repos/{owner}/{repo}/transfer/reject | Reject a repo transfer +*RepositoryApi* | [**repo_add_collaborator**](docs/RepositoryApi.md#repo_add_collaborator) | **PUT** /repos/{owner}/{repo}/collaborators/{collaborator} | Add a collaborator to a repository +*RepositoryApi* | [**repo_add_team**](docs/RepositoryApi.md#repo_add_team) | **PUT** /repos/{owner}/{repo}/teams/{team} | Add a team to a repository +*RepositoryApi* | [**repo_add_topic**](docs/RepositoryApi.md#repo_add_topic) | **PUT** /repos/{owner}/{repo}/topics/{topic} | Add a topic to a repository +*RepositoryApi* | [**repo_apply_diff_patch**](docs/RepositoryApi.md#repo_apply_diff_patch) | **POST** /repos/{owner}/{repo}/diffpatch | Apply diff patch to repository +*RepositoryApi* | [**repo_cancel_scheduled_auto_merge**](docs/RepositoryApi.md#repo_cancel_scheduled_auto_merge) | **DELETE** /repos/{owner}/{repo}/pulls/{index}/merge | Cancel the scheduled auto merge for the given pull request +*RepositoryApi* | [**repo_check_collaborator**](docs/RepositoryApi.md#repo_check_collaborator) | **GET** /repos/{owner}/{repo}/collaborators/{collaborator} | Check if a user is a collaborator of a repository +*RepositoryApi* | [**repo_check_team**](docs/RepositoryApi.md#repo_check_team) | **GET** /repos/{owner}/{repo}/teams/{team} | Check if a team is assigned to a repository +*RepositoryApi* | [**repo_create_branch**](docs/RepositoryApi.md#repo_create_branch) | **POST** /repos/{owner}/{repo}/branches | Create a branch +*RepositoryApi* | [**repo_create_branch_protection**](docs/RepositoryApi.md#repo_create_branch_protection) | **POST** /repos/{owner}/{repo}/branch_protections | Create a branch protections for a repository +*RepositoryApi* | [**repo_create_file**](docs/RepositoryApi.md#repo_create_file) | **POST** /repos/{owner}/{repo}/contents/{filepath} | Create a file in a repository +*RepositoryApi* | [**repo_create_hook**](docs/RepositoryApi.md#repo_create_hook) | **POST** /repos/{owner}/{repo}/hooks | Create a hook +*RepositoryApi* | [**repo_create_key**](docs/RepositoryApi.md#repo_create_key) | **POST** /repos/{owner}/{repo}/keys | Add a key to a repository +*RepositoryApi* | [**repo_create_pull_request**](docs/RepositoryApi.md#repo_create_pull_request) | **POST** /repos/{owner}/{repo}/pulls | Create a pull request +*RepositoryApi* | [**repo_create_pull_review**](docs/RepositoryApi.md#repo_create_pull_review) | **POST** /repos/{owner}/{repo}/pulls/{index}/reviews | Create a review to an pull request +*RepositoryApi* | [**repo_create_pull_review_requests**](docs/RepositoryApi.md#repo_create_pull_review_requests) | **POST** /repos/{owner}/{repo}/pulls/{index}/requested_reviewers | create review requests for a pull request +*RepositoryApi* | [**repo_create_release**](docs/RepositoryApi.md#repo_create_release) | **POST** /repos/{owner}/{repo}/releases | Create a release +*RepositoryApi* | [**repo_create_release_attachment**](docs/RepositoryApi.md#repo_create_release_attachment) | **POST** /repos/{owner}/{repo}/releases/{id}/assets | Create a release attachment +*RepositoryApi* | [**repo_create_status**](docs/RepositoryApi.md#repo_create_status) | **POST** /repos/{owner}/{repo}/statuses/{sha} | Create a commit status +*RepositoryApi* | [**repo_create_tag**](docs/RepositoryApi.md#repo_create_tag) | **POST** /repos/{owner}/{repo}/tags | Create a new git tag in a repository +*RepositoryApi* | [**repo_create_wiki_page**](docs/RepositoryApi.md#repo_create_wiki_page) | **POST** /repos/{owner}/{repo}/wiki/new | Create a wiki page +*RepositoryApi* | [**repo_delete**](docs/RepositoryApi.md#repo_delete) | **DELETE** /repos/{owner}/{repo} | Delete a repository +*RepositoryApi* | [**repo_delete_branch**](docs/RepositoryApi.md#repo_delete_branch) | **DELETE** /repos/{owner}/{repo}/branches/{branch} | Delete a specific branch from a repository +*RepositoryApi* | [**repo_delete_branch_protection**](docs/RepositoryApi.md#repo_delete_branch_protection) | **DELETE** /repos/{owner}/{repo}/branch_protections/{name} | Delete a specific branch protection for the repository +*RepositoryApi* | [**repo_delete_collaborator**](docs/RepositoryApi.md#repo_delete_collaborator) | **DELETE** /repos/{owner}/{repo}/collaborators/{collaborator} | Delete a collaborator from a repository +*RepositoryApi* | [**repo_delete_file**](docs/RepositoryApi.md#repo_delete_file) | **DELETE** /repos/{owner}/{repo}/contents/{filepath} | Delete a file in a repository +*RepositoryApi* | [**repo_delete_git_hook**](docs/RepositoryApi.md#repo_delete_git_hook) | **DELETE** /repos/{owner}/{repo}/hooks/git/{id} | Delete a Git hook in a repository +*RepositoryApi* | [**repo_delete_hook**](docs/RepositoryApi.md#repo_delete_hook) | **DELETE** /repos/{owner}/{repo}/hooks/{id} | Delete a hook in a repository +*RepositoryApi* | [**repo_delete_key**](docs/RepositoryApi.md#repo_delete_key) | **DELETE** /repos/{owner}/{repo}/keys/{id} | Delete a key from a repository +*RepositoryApi* | [**repo_delete_pull_review**](docs/RepositoryApi.md#repo_delete_pull_review) | **DELETE** /repos/{owner}/{repo}/pulls/{index}/reviews/{id} | Delete a specific review from a pull request +*RepositoryApi* | [**repo_delete_pull_review_requests**](docs/RepositoryApi.md#repo_delete_pull_review_requests) | **DELETE** /repos/{owner}/{repo}/pulls/{index}/requested_reviewers | cancel review requests for a pull request +*RepositoryApi* | [**repo_delete_release**](docs/RepositoryApi.md#repo_delete_release) | **DELETE** /repos/{owner}/{repo}/releases/{id} | Delete a release +*RepositoryApi* | [**repo_delete_release_attachment**](docs/RepositoryApi.md#repo_delete_release_attachment) | **DELETE** /repos/{owner}/{repo}/releases/{id}/assets/{attachment_id} | Delete a release attachment +*RepositoryApi* | [**repo_delete_release_by_tag**](docs/RepositoryApi.md#repo_delete_release_by_tag) | **DELETE** /repos/{owner}/{repo}/releases/tags/{tag} | Delete a release by tag name +*RepositoryApi* | [**repo_delete_tag**](docs/RepositoryApi.md#repo_delete_tag) | **DELETE** /repos/{owner}/{repo}/tags/{tag} | Delete a repository's tag by name +*RepositoryApi* | [**repo_delete_team**](docs/RepositoryApi.md#repo_delete_team) | **DELETE** /repos/{owner}/{repo}/teams/{team} | Delete a team from a repository +*RepositoryApi* | [**repo_delete_topic**](docs/RepositoryApi.md#repo_delete_topic) | **DELETE** /repos/{owner}/{repo}/topics/{topic} | Delete a topic from a repository +*RepositoryApi* | [**repo_delete_wiki_page**](docs/RepositoryApi.md#repo_delete_wiki_page) | **DELETE** /repos/{owner}/{repo}/wiki/page/{pageName} | Delete a wiki page +*RepositoryApi* | [**repo_dismiss_pull_review**](docs/RepositoryApi.md#repo_dismiss_pull_review) | **POST** /repos/{owner}/{repo}/pulls/{index}/reviews/{id}/dismissals | Dismiss a review for a pull request +*RepositoryApi* | [**repo_download_commit_diff_or_patch**](docs/RepositoryApi.md#repo_download_commit_diff_or_patch) | **GET** /repos/{owner}/{repo}/git/commits/{sha}.{diffType} | Get a commit's diff or patch +*RepositoryApi* | [**repo_download_pull_diff_or_patch**](docs/RepositoryApi.md#repo_download_pull_diff_or_patch) | **GET** /repos/{owner}/{repo}/pulls/{index}.{diffType} | Get a pull request diff or patch +*RepositoryApi* | [**repo_edit**](docs/RepositoryApi.md#repo_edit) | **PATCH** /repos/{owner}/{repo} | Edit a repository's properties. Only fields that are set will be changed. +*RepositoryApi* | [**repo_edit_branch_protection**](docs/RepositoryApi.md#repo_edit_branch_protection) | **PATCH** /repos/{owner}/{repo}/branch_protections/{name} | Edit a branch protections for a repository. Only fields that are set will be changed +*RepositoryApi* | [**repo_edit_git_hook**](docs/RepositoryApi.md#repo_edit_git_hook) | **PATCH** /repos/{owner}/{repo}/hooks/git/{id} | Edit a Git hook in a repository +*RepositoryApi* | [**repo_edit_hook**](docs/RepositoryApi.md#repo_edit_hook) | **PATCH** /repos/{owner}/{repo}/hooks/{id} | Edit a hook in a repository +*RepositoryApi* | [**repo_edit_pull_request**](docs/RepositoryApi.md#repo_edit_pull_request) | **PATCH** /repos/{owner}/{repo}/pulls/{index} | Update a pull request. If using deadline only the date will be taken into account, and time of day ignored. +*RepositoryApi* | [**repo_edit_release**](docs/RepositoryApi.md#repo_edit_release) | **PATCH** /repos/{owner}/{repo}/releases/{id} | Update a release +*RepositoryApi* | [**repo_edit_release_attachment**](docs/RepositoryApi.md#repo_edit_release_attachment) | **PATCH** /repos/{owner}/{repo}/releases/{id}/assets/{attachment_id} | Edit a release attachment +*RepositoryApi* | [**repo_edit_wiki_page**](docs/RepositoryApi.md#repo_edit_wiki_page) | **PATCH** /repos/{owner}/{repo}/wiki/page/{pageName} | Edit a wiki page +*RepositoryApi* | [**repo_get**](docs/RepositoryApi.md#repo_get) | **GET** /repos/{owner}/{repo} | Get a repository +*RepositoryApi* | [**repo_get_all_commits**](docs/RepositoryApi.md#repo_get_all_commits) | **GET** /repos/{owner}/{repo}/commits | Get a list of all commits from a repository +*RepositoryApi* | [**repo_get_archive**](docs/RepositoryApi.md#repo_get_archive) | **GET** /repos/{owner}/{repo}/archive/{archive} | Get an archive of a repository +*RepositoryApi* | [**repo_get_assignees**](docs/RepositoryApi.md#repo_get_assignees) | **GET** /repos/{owner}/{repo}/assignees | Return all users that have write access and can be assigned to issues +*RepositoryApi* | [**repo_get_branch**](docs/RepositoryApi.md#repo_get_branch) | **GET** /repos/{owner}/{repo}/branches/{branch} | Retrieve a specific branch from a repository, including its effective branch protection +*RepositoryApi* | [**repo_get_branch_protection**](docs/RepositoryApi.md#repo_get_branch_protection) | **GET** /repos/{owner}/{repo}/branch_protections/{name} | Get a specific branch protection for the repository +*RepositoryApi* | [**repo_get_by_id**](docs/RepositoryApi.md#repo_get_by_id) | **GET** /repositories/{id} | Get a repository by id +*RepositoryApi* | [**repo_get_combined_status_by_ref**](docs/RepositoryApi.md#repo_get_combined_status_by_ref) | **GET** /repos/{owner}/{repo}/commits/{ref}/status | Get a commit's combined status, by branch/tag/commit reference +*RepositoryApi* | [**repo_get_contents**](docs/RepositoryApi.md#repo_get_contents) | **GET** /repos/{owner}/{repo}/contents/{filepath} | Gets the metadata and contents (if a file) of an entry in a repository, or a list of entries if a dir +*RepositoryApi* | [**repo_get_contents_list**](docs/RepositoryApi.md#repo_get_contents_list) | **GET** /repos/{owner}/{repo}/contents | Gets the metadata of all the entries of the root dir +*RepositoryApi* | [**repo_get_editor_config**](docs/RepositoryApi.md#repo_get_editor_config) | **GET** /repos/{owner}/{repo}/editorconfig/{filepath} | Get the EditorConfig definitions of a file in a repository +*RepositoryApi* | [**repo_get_git_hook**](docs/RepositoryApi.md#repo_get_git_hook) | **GET** /repos/{owner}/{repo}/hooks/git/{id} | Get a Git hook +*RepositoryApi* | [**repo_get_hook**](docs/RepositoryApi.md#repo_get_hook) | **GET** /repos/{owner}/{repo}/hooks/{id} | Get a hook +*RepositoryApi* | [**repo_get_issue_templates**](docs/RepositoryApi.md#repo_get_issue_templates) | **GET** /repos/{owner}/{repo}/issue_templates | Get available issue templates for a repository +*RepositoryApi* | [**repo_get_key**](docs/RepositoryApi.md#repo_get_key) | **GET** /repos/{owner}/{repo}/keys/{id} | Get a repository's key by id +*RepositoryApi* | [**repo_get_languages**](docs/RepositoryApi.md#repo_get_languages) | **GET** /repos/{owner}/{repo}/languages | Get languages and number of bytes of code written +*RepositoryApi* | [**repo_get_note**](docs/RepositoryApi.md#repo_get_note) | **GET** /repos/{owner}/{repo}/git/notes/{sha} | Get a note corresponding to a single commit from a repository +*RepositoryApi* | [**repo_get_pull_request**](docs/RepositoryApi.md#repo_get_pull_request) | **GET** /repos/{owner}/{repo}/pulls/{index} | Get a pull request +*RepositoryApi* | [**repo_get_pull_request_commits**](docs/RepositoryApi.md#repo_get_pull_request_commits) | **GET** /repos/{owner}/{repo}/pulls/{index}/commits | Get commits for a pull request +*RepositoryApi* | [**repo_get_pull_review**](docs/RepositoryApi.md#repo_get_pull_review) | **GET** /repos/{owner}/{repo}/pulls/{index}/reviews/{id} | Get a specific review for a pull request +*RepositoryApi* | [**repo_get_pull_review_comments**](docs/RepositoryApi.md#repo_get_pull_review_comments) | **GET** /repos/{owner}/{repo}/pulls/{index}/reviews/{id}/comments | Get a specific review for a pull request +*RepositoryApi* | [**repo_get_raw_file**](docs/RepositoryApi.md#repo_get_raw_file) | **GET** /repos/{owner}/{repo}/raw/{filepath} | Get a file from a repository +*RepositoryApi* | [**repo_get_raw_file_or_lfs**](docs/RepositoryApi.md#repo_get_raw_file_or_lfs) | **GET** /repos/{owner}/{repo}/media/{filepath} | Get a file or it's LFS object from a repository +*RepositoryApi* | [**repo_get_release**](docs/RepositoryApi.md#repo_get_release) | **GET** /repos/{owner}/{repo}/releases/{id} | Get a release +*RepositoryApi* | [**repo_get_release_attachment**](docs/RepositoryApi.md#repo_get_release_attachment) | **GET** /repos/{owner}/{repo}/releases/{id}/assets/{attachment_id} | Get a release attachment +*RepositoryApi* | [**repo_get_release_by_tag**](docs/RepositoryApi.md#repo_get_release_by_tag) | **GET** /repos/{owner}/{repo}/releases/tags/{tag} | Get a release by tag name +*RepositoryApi* | [**repo_get_repo_permissions**](docs/RepositoryApi.md#repo_get_repo_permissions) | **GET** /repos/{owner}/{repo}/collaborators/{collaborator}/permission | Get repository permissions for a user +*RepositoryApi* | [**repo_get_reviewers**](docs/RepositoryApi.md#repo_get_reviewers) | **GET** /repos/{owner}/{repo}/reviewers | Return all users that can be requested to review in this repo +*RepositoryApi* | [**repo_get_single_commit**](docs/RepositoryApi.md#repo_get_single_commit) | **GET** /repos/{owner}/{repo}/git/commits/{sha} | Get a single commit from a repository +*RepositoryApi* | [**repo_get_tag**](docs/RepositoryApi.md#repo_get_tag) | **GET** /repos/{owner}/{repo}/tags/{tag} | Get the tag of a repository by tag name +*RepositoryApi* | [**repo_get_wiki_page**](docs/RepositoryApi.md#repo_get_wiki_page) | **GET** /repos/{owner}/{repo}/wiki/page/{pageName} | Get a wiki page +*RepositoryApi* | [**repo_get_wiki_page_revisions**](docs/RepositoryApi.md#repo_get_wiki_page_revisions) | **GET** /repos/{owner}/{repo}/wiki/revisions/{pageName} | Get revisions of a wiki page +*RepositoryApi* | [**repo_get_wiki_pages**](docs/RepositoryApi.md#repo_get_wiki_pages) | **GET** /repos/{owner}/{repo}/wiki/pages | Get all wiki pages +*RepositoryApi* | [**repo_list_all_git_refs**](docs/RepositoryApi.md#repo_list_all_git_refs) | **GET** /repos/{owner}/{repo}/git/refs | Get specified ref or filtered repository's refs +*RepositoryApi* | [**repo_list_branch_protection**](docs/RepositoryApi.md#repo_list_branch_protection) | **GET** /repos/{owner}/{repo}/branch_protections | List branch protections for a repository +*RepositoryApi* | [**repo_list_branches**](docs/RepositoryApi.md#repo_list_branches) | **GET** /repos/{owner}/{repo}/branches | List a repository's branches +*RepositoryApi* | [**repo_list_collaborators**](docs/RepositoryApi.md#repo_list_collaborators) | **GET** /repos/{owner}/{repo}/collaborators | List a repository's collaborators +*RepositoryApi* | [**repo_list_git_hooks**](docs/RepositoryApi.md#repo_list_git_hooks) | **GET** /repos/{owner}/{repo}/hooks/git | List the Git hooks in a repository +*RepositoryApi* | [**repo_list_git_refs**](docs/RepositoryApi.md#repo_list_git_refs) | **GET** /repos/{owner}/{repo}/git/refs/{ref} | Get specified ref or filtered repository's refs +*RepositoryApi* | [**repo_list_hooks**](docs/RepositoryApi.md#repo_list_hooks) | **GET** /repos/{owner}/{repo}/hooks | List the hooks in a repository +*RepositoryApi* | [**repo_list_keys**](docs/RepositoryApi.md#repo_list_keys) | **GET** /repos/{owner}/{repo}/keys | List a repository's keys +*RepositoryApi* | [**repo_list_pull_requests**](docs/RepositoryApi.md#repo_list_pull_requests) | **GET** /repos/{owner}/{repo}/pulls | List a repo's pull requests +*RepositoryApi* | [**repo_list_pull_reviews**](docs/RepositoryApi.md#repo_list_pull_reviews) | **GET** /repos/{owner}/{repo}/pulls/{index}/reviews | List all reviews for a pull request +*RepositoryApi* | [**repo_list_release_attachments**](docs/RepositoryApi.md#repo_list_release_attachments) | **GET** /repos/{owner}/{repo}/releases/{id}/assets | List release's attachments +*RepositoryApi* | [**repo_list_releases**](docs/RepositoryApi.md#repo_list_releases) | **GET** /repos/{owner}/{repo}/releases | List a repo's releases +*RepositoryApi* | [**repo_list_stargazers**](docs/RepositoryApi.md#repo_list_stargazers) | **GET** /repos/{owner}/{repo}/stargazers | List a repo's stargazers +*RepositoryApi* | [**repo_list_statuses**](docs/RepositoryApi.md#repo_list_statuses) | **GET** /repos/{owner}/{repo}/statuses/{sha} | Get a commit's statuses +*RepositoryApi* | [**repo_list_statuses_by_ref**](docs/RepositoryApi.md#repo_list_statuses_by_ref) | **GET** /repos/{owner}/{repo}/commits/{ref}/statuses | Get a commit's statuses, by branch/tag/commit reference +*RepositoryApi* | [**repo_list_subscribers**](docs/RepositoryApi.md#repo_list_subscribers) | **GET** /repos/{owner}/{repo}/subscribers | List a repo's watchers +*RepositoryApi* | [**repo_list_tags**](docs/RepositoryApi.md#repo_list_tags) | **GET** /repos/{owner}/{repo}/tags | List a repository's tags +*RepositoryApi* | [**repo_list_teams**](docs/RepositoryApi.md#repo_list_teams) | **GET** /repos/{owner}/{repo}/teams | List a repository's teams +*RepositoryApi* | [**repo_list_topics**](docs/RepositoryApi.md#repo_list_topics) | **GET** /repos/{owner}/{repo}/topics | Get list of topics that a repository has +*RepositoryApi* | [**repo_merge_pull_request**](docs/RepositoryApi.md#repo_merge_pull_request) | **POST** /repos/{owner}/{repo}/pulls/{index}/merge | Merge a pull request +*RepositoryApi* | [**repo_migrate**](docs/RepositoryApi.md#repo_migrate) | **POST** /repos/migrate | Migrate a remote git repository +*RepositoryApi* | [**repo_mirror_sync**](docs/RepositoryApi.md#repo_mirror_sync) | **POST** /repos/{owner}/{repo}/mirror-sync | Sync a mirrored repository +*RepositoryApi* | [**repo_pull_request_is_merged**](docs/RepositoryApi.md#repo_pull_request_is_merged) | **GET** /repos/{owner}/{repo}/pulls/{index}/merge | Check if a pull request has been merged +*RepositoryApi* | [**repo_search**](docs/RepositoryApi.md#repo_search) | **GET** /repos/search | Search for repositories +*RepositoryApi* | [**repo_signing_key**](docs/RepositoryApi.md#repo_signing_key) | **GET** /repos/{owner}/{repo}/signing-key.gpg | Get signing-key.gpg for given repository +*RepositoryApi* | [**repo_submit_pull_review**](docs/RepositoryApi.md#repo_submit_pull_review) | **POST** /repos/{owner}/{repo}/pulls/{index}/reviews/{id} | Submit a pending review to an pull request +*RepositoryApi* | [**repo_test_hook**](docs/RepositoryApi.md#repo_test_hook) | **POST** /repos/{owner}/{repo}/hooks/{id}/tests | Test a push webhook +*RepositoryApi* | [**repo_tracked_times**](docs/RepositoryApi.md#repo_tracked_times) | **GET** /repos/{owner}/{repo}/times | List a repo's tracked times +*RepositoryApi* | [**repo_transfer**](docs/RepositoryApi.md#repo_transfer) | **POST** /repos/{owner}/{repo}/transfer | Transfer a repo ownership +*RepositoryApi* | [**repo_un_dismiss_pull_review**](docs/RepositoryApi.md#repo_un_dismiss_pull_review) | **POST** /repos/{owner}/{repo}/pulls/{index}/reviews/{id}/undismissals | Cancel to dismiss a review for a pull request +*RepositoryApi* | [**repo_update_file**](docs/RepositoryApi.md#repo_update_file) | **PUT** /repos/{owner}/{repo}/contents/{filepath} | Update a file in a repository +*RepositoryApi* | [**repo_update_pull_request**](docs/RepositoryApi.md#repo_update_pull_request) | **POST** /repos/{owner}/{repo}/pulls/{index}/update | Merge PR's baseBranch into headBranch +*RepositoryApi* | [**repo_update_topics**](docs/RepositoryApi.md#repo_update_topics) | **PUT** /repos/{owner}/{repo}/topics | Replace list of topics for a repository +*RepositoryApi* | [**topic_search**](docs/RepositoryApi.md#topic_search) | **GET** /topics/search | search topics via keyword +*RepositoryApi* | [**user_current_check_subscription**](docs/RepositoryApi.md#user_current_check_subscription) | **GET** /repos/{owner}/{repo}/subscription | Check if the current user is watching a repo +*RepositoryApi* | [**user_current_delete_subscription**](docs/RepositoryApi.md#user_current_delete_subscription) | **DELETE** /repos/{owner}/{repo}/subscription | Unwatch a repo +*RepositoryApi* | [**user_current_put_subscription**](docs/RepositoryApi.md#user_current_put_subscription) | **PUT** /repos/{owner}/{repo}/subscription | Watch a repo +*RepositoryApi* | [**user_tracked_times**](docs/RepositoryApi.md#user_tracked_times) | **GET** /repos/{owner}/{repo}/times/{user} | List a user's tracked times in a repo +*SettingsApi* | [**get_general_api_settings**](docs/SettingsApi.md#get_general_api_settings) | **GET** /settings/api | Get instance's global settings for api +*SettingsApi* | [**get_general_attachment_settings**](docs/SettingsApi.md#get_general_attachment_settings) | **GET** /settings/attachment | Get instance's global settings for Attachment +*SettingsApi* | [**get_general_repository_settings**](docs/SettingsApi.md#get_general_repository_settings) | **GET** /settings/repository | Get instance's global settings for repositories +*SettingsApi* | [**get_general_ui_settings**](docs/SettingsApi.md#get_general_ui_settings) | **GET** /settings/ui | Get instance's global settings for ui +*UserApi* | [**create_current_user_repo**](docs/UserApi.md#create_current_user_repo) | **POST** /user/repos | Create a repository +*UserApi* | [**get_user_settings**](docs/UserApi.md#get_user_settings) | **GET** /user/settings | Get user settings +*UserApi* | [**get_verification_token**](docs/UserApi.md#get_verification_token) | **GET** /user/gpg_key_token | Get a Token to verify +*UserApi* | [**update_user_settings**](docs/UserApi.md#update_user_settings) | **PATCH** /user/settings | Update user settings +*UserApi* | [**user_add_email**](docs/UserApi.md#user_add_email) | **POST** /user/emails | Add email addresses +*UserApi* | [**user_check_following**](docs/UserApi.md#user_check_following) | **GET** /users/{username}/following/{target} | Check if one user is following another user +*UserApi* | [**user_create_o_auth2_application**](docs/UserApi.md#user_create_o_auth2_application) | **POST** /user/applications/oauth2 | creates a new OAuth2 application +*UserApi* | [**user_create_token**](docs/UserApi.md#user_create_token) | **POST** /users/{username}/tokens | Create an access token +*UserApi* | [**user_current_check_following**](docs/UserApi.md#user_current_check_following) | **GET** /user/following/{username} | Check whether a user is followed by the authenticated user +*UserApi* | [**user_current_check_starring**](docs/UserApi.md#user_current_check_starring) | **GET** /user/starred/{owner}/{repo} | Whether the authenticated is starring the repo +*UserApi* | [**user_current_delete_follow**](docs/UserApi.md#user_current_delete_follow) | **DELETE** /user/following/{username} | Unfollow a user +*UserApi* | [**user_current_delete_gpg_key**](docs/UserApi.md#user_current_delete_gpg_key) | **DELETE** /user/gpg_keys/{id} | Remove a GPG key +*UserApi* | [**user_current_delete_key**](docs/UserApi.md#user_current_delete_key) | **DELETE** /user/keys/{id} | Delete a public key +*UserApi* | [**user_current_delete_star**](docs/UserApi.md#user_current_delete_star) | **DELETE** /user/starred/{owner}/{repo} | Unstar the given repo +*UserApi* | [**user_current_get_gpg_key**](docs/UserApi.md#user_current_get_gpg_key) | **GET** /user/gpg_keys/{id} | Get a GPG key +*UserApi* | [**user_current_get_key**](docs/UserApi.md#user_current_get_key) | **GET** /user/keys/{id} | Get a public key +*UserApi* | [**user_current_list_followers**](docs/UserApi.md#user_current_list_followers) | **GET** /user/followers | List the authenticated user's followers +*UserApi* | [**user_current_list_following**](docs/UserApi.md#user_current_list_following) | **GET** /user/following | List the users that the authenticated user is following +*UserApi* | [**user_current_list_gpg_keys**](docs/UserApi.md#user_current_list_gpg_keys) | **GET** /user/gpg_keys | List the authenticated user's GPG keys +*UserApi* | [**user_current_list_keys**](docs/UserApi.md#user_current_list_keys) | **GET** /user/keys | List the authenticated user's public keys +*UserApi* | [**user_current_list_repos**](docs/UserApi.md#user_current_list_repos) | **GET** /user/repos | List the repos that the authenticated user owns +*UserApi* | [**user_current_list_starred**](docs/UserApi.md#user_current_list_starred) | **GET** /user/starred | The repos that the authenticated user has starred +*UserApi* | [**user_current_list_subscriptions**](docs/UserApi.md#user_current_list_subscriptions) | **GET** /user/subscriptions | List repositories watched by the authenticated user +*UserApi* | [**user_current_post_gpg_key**](docs/UserApi.md#user_current_post_gpg_key) | **POST** /user/gpg_keys | Create a GPG key +*UserApi* | [**user_current_post_key**](docs/UserApi.md#user_current_post_key) | **POST** /user/keys | Create a public key +*UserApi* | [**user_current_put_follow**](docs/UserApi.md#user_current_put_follow) | **PUT** /user/following/{username} | Follow a user +*UserApi* | [**user_current_put_star**](docs/UserApi.md#user_current_put_star) | **PUT** /user/starred/{owner}/{repo} | Star the given repo +*UserApi* | [**user_current_tracked_times**](docs/UserApi.md#user_current_tracked_times) | **GET** /user/times | List the current user's tracked times +*UserApi* | [**user_delete_access_token**](docs/UserApi.md#user_delete_access_token) | **DELETE** /users/{username}/tokens/{token} | delete an access token +*UserApi* | [**user_delete_email**](docs/UserApi.md#user_delete_email) | **DELETE** /user/emails | Delete email addresses +*UserApi* | [**user_delete_o_auth2_application**](docs/UserApi.md#user_delete_o_auth2_application) | **DELETE** /user/applications/oauth2/{id} | delete an OAuth2 Application +*UserApi* | [**user_get**](docs/UserApi.md#user_get) | **GET** /users/{username} | Get a user +*UserApi* | [**user_get_current**](docs/UserApi.md#user_get_current) | **GET** /user | Get the authenticated user +*UserApi* | [**user_get_heatmap_data**](docs/UserApi.md#user_get_heatmap_data) | **GET** /users/{username}/heatmap | Get a user's heatmap +*UserApi* | [**user_get_o_auth2_application**](docs/UserApi.md#user_get_o_auth2_application) | **GET** /user/applications/oauth2/{id} | get an OAuth2 Application +*UserApi* | [**user_get_oauth2_application**](docs/UserApi.md#user_get_oauth2_application) | **GET** /user/applications/oauth2 | List the authenticated user's oauth2 applications +*UserApi* | [**user_get_stop_watches**](docs/UserApi.md#user_get_stop_watches) | **GET** /user/stopwatches | Get list of all existing stopwatches +*UserApi* | [**user_get_tokens**](docs/UserApi.md#user_get_tokens) | **GET** /users/{username}/tokens | List the authenticated user's access tokens +*UserApi* | [**user_list_emails**](docs/UserApi.md#user_list_emails) | **GET** /user/emails | List the authenticated user's email addresses +*UserApi* | [**user_list_followers**](docs/UserApi.md#user_list_followers) | **GET** /users/{username}/followers | List the given user's followers +*UserApi* | [**user_list_following**](docs/UserApi.md#user_list_following) | **GET** /users/{username}/following | List the users that the given user is following +*UserApi* | [**user_list_gpg_keys**](docs/UserApi.md#user_list_gpg_keys) | **GET** /users/{username}/gpg_keys | List the given user's GPG keys +*UserApi* | [**user_list_keys**](docs/UserApi.md#user_list_keys) | **GET** /users/{username}/keys | List the given user's public keys +*UserApi* | [**user_list_repos**](docs/UserApi.md#user_list_repos) | **GET** /users/{username}/repos | List the repos owned by the given user +*UserApi* | [**user_list_starred**](docs/UserApi.md#user_list_starred) | **GET** /users/{username}/starred | The repos that the given user has starred +*UserApi* | [**user_list_subscriptions**](docs/UserApi.md#user_list_subscriptions) | **GET** /users/{username}/subscriptions | List the repositories watched by a user +*UserApi* | [**user_list_teams**](docs/UserApi.md#user_list_teams) | **GET** /user/teams | List all the teams a user belongs to +*UserApi* | [**user_search**](docs/UserApi.md#user_search) | **GET** /users/search | Search for users +*UserApi* | [**user_update_o_auth2_application**](docs/UserApi.md#user_update_o_auth2_application) | **PATCH** /user/applications/oauth2/{id} | update an OAuth2 Application, this includes regenerating the client secret +*UserApi* | [**user_verify_gpg_key**](docs/UserApi.md#user_verify_gpg_key) | **POST** /user/gpg_key_verify | Verify a GPG key + + +## Documentation For Models + + - [AccessToken](docs/AccessToken.md) + - [AddCollaboratorOption](docs/AddCollaboratorOption.md) + - [AddTimeOption](docs/AddTimeOption.md) + - [AnnotatedTag](docs/AnnotatedTag.md) + - [AnnotatedTagObject](docs/AnnotatedTagObject.md) + - [ApiError](docs/ApiError.md) + - [Attachment](docs/Attachment.md) + - [Branch](docs/Branch.md) + - [BranchProtection](docs/BranchProtection.md) + - [CombinedStatus](docs/CombinedStatus.md) + - [Comment](docs/Comment.md) + - [Commit](docs/Commit.md) + - [CommitAffectedFiles](docs/CommitAffectedFiles.md) + - [CommitDateOptions](docs/CommitDateOptions.md) + - [CommitMeta](docs/CommitMeta.md) + - [CommitStats](docs/CommitStats.md) + - [CommitStatus](docs/CommitStatus.md) + - [CommitUser](docs/CommitUser.md) + - [ContentsResponse](docs/ContentsResponse.md) + - [CreateAccessTokenOption](docs/CreateAccessTokenOption.md) + - [CreateBranchProtectionOption](docs/CreateBranchProtectionOption.md) + - [CreateBranchRepoOption](docs/CreateBranchRepoOption.md) + - [CreateEmailOption](docs/CreateEmailOption.md) + - [CreateFileOptions](docs/CreateFileOptions.md) + - [CreateForkOption](docs/CreateForkOption.md) + - [CreateGpgKeyOption](docs/CreateGpgKeyOption.md) + - [CreateHookOption](docs/CreateHookOption.md) + - [CreateIssueCommentOption](docs/CreateIssueCommentOption.md) + - [CreateIssueOption](docs/CreateIssueOption.md) + - [CreateKeyOption](docs/CreateKeyOption.md) + - [CreateLabelOption](docs/CreateLabelOption.md) + - [CreateMilestoneOption](docs/CreateMilestoneOption.md) + - [CreateOAuth2ApplicationOptions](docs/CreateOAuth2ApplicationOptions.md) + - [CreateOrgOption](docs/CreateOrgOption.md) + - [CreatePullRequestOption](docs/CreatePullRequestOption.md) + - [CreatePullReviewComment](docs/CreatePullReviewComment.md) + - [CreatePullReviewOptions](docs/CreatePullReviewOptions.md) + - [CreateReleaseOption](docs/CreateReleaseOption.md) + - [CreateRepoOption](docs/CreateRepoOption.md) + - [CreateStatusOption](docs/CreateStatusOption.md) + - [CreateTagOption](docs/CreateTagOption.md) + - [CreateTeamOption](docs/CreateTeamOption.md) + - [CreateUserOption](docs/CreateUserOption.md) + - [CreateWikiPageOptions](docs/CreateWikiPageOptions.md) + - [Cron](docs/Cron.md) + - [DeleteEmailOption](docs/DeleteEmailOption.md) + - [DeleteFileOptions](docs/DeleteFileOptions.md) + - [DeployKey](docs/DeployKey.md) + - [DismissPullReviewOptions](docs/DismissPullReviewOptions.md) + - [EditAttachmentOptions](docs/EditAttachmentOptions.md) + - [EditBranchProtectionOption](docs/EditBranchProtectionOption.md) + - [EditDeadlineOption](docs/EditDeadlineOption.md) + - [EditGitHookOption](docs/EditGitHookOption.md) + - [EditHookOption](docs/EditHookOption.md) + - [EditIssueCommentOption](docs/EditIssueCommentOption.md) + - [EditIssueOption](docs/EditIssueOption.md) + - [EditLabelOption](docs/EditLabelOption.md) + - [EditMilestoneOption](docs/EditMilestoneOption.md) + - [EditOrgOption](docs/EditOrgOption.md) + - [EditPullRequestOption](docs/EditPullRequestOption.md) + - [EditReactionOption](docs/EditReactionOption.md) + - [EditReleaseOption](docs/EditReleaseOption.md) + - [EditRepoOption](docs/EditRepoOption.md) + - [EditTeamOption](docs/EditTeamOption.md) + - [EditUserOption](docs/EditUserOption.md) + - [Email](docs/Email.md) + - [ExternalTracker](docs/ExternalTracker.md) + - [ExternalWiki](docs/ExternalWiki.md) + - [FileCommitResponse](docs/FileCommitResponse.md) + - [FileDeleteResponse](docs/FileDeleteResponse.md) + - [FileLinksResponse](docs/FileLinksResponse.md) + - [FileResponse](docs/FileResponse.md) + - [GeneralApiSettings](docs/GeneralApiSettings.md) + - [GeneralAttachmentSettings](docs/GeneralAttachmentSettings.md) + - [GeneralRepoSettings](docs/GeneralRepoSettings.md) + - [GeneralUiSettings](docs/GeneralUiSettings.md) + - [GenerateRepoOption](docs/GenerateRepoOption.md) + - [GitBlobResponse](docs/GitBlobResponse.md) + - [GitEntry](docs/GitEntry.md) + - [GitHook](docs/GitHook.md) + - [GitObject](docs/GitObject.md) + - [GitTreeResponse](docs/GitTreeResponse.md) + - [GpgKey](docs/GpgKey.md) + - [GpgKeyEmail](docs/GpgKeyEmail.md) + - [Hook](docs/Hook.md) + - [Identity](docs/Identity.md) + - [InternalTracker](docs/InternalTracker.md) + - [Issue](docs/Issue.md) + - [IssueDeadline](docs/IssueDeadline.md) + - [IssueLabelsOption](docs/IssueLabelsOption.md) + - [IssueTemplate](docs/IssueTemplate.md) + - [Label](docs/Label.md) + - [MarkdownOption](docs/MarkdownOption.md) + - [MergePullRequestOption](docs/MergePullRequestOption.md) + - [MigrateRepoForm](docs/MigrateRepoForm.md) + - [MigrateRepoOptions](docs/MigrateRepoOptions.md) + - [Milestone](docs/Milestone.md) + - [NodeInfo](docs/NodeInfo.md) + - [NodeInfoServices](docs/NodeInfoServices.md) + - [NodeInfoSoftware](docs/NodeInfoSoftware.md) + - [NodeInfoUsage](docs/NodeInfoUsage.md) + - [NodeInfoUsageUsers](docs/NodeInfoUsageUsers.md) + - [Note](docs/Note.md) + - [NotificationCount](docs/NotificationCount.md) + - [NotificationSubject](docs/NotificationSubject.md) + - [NotificationThread](docs/NotificationThread.md) + - [OAuth2Application](docs/OAuth2Application.md) + - [Organization](docs/Organization.md) + - [OrganizationPermissions](docs/OrganizationPermissions.md) + - [Package](docs/Package.md) + - [PackageFile](docs/PackageFile.md) + - [PayloadCommit](docs/PayloadCommit.md) + - [PayloadCommitVerification](docs/PayloadCommitVerification.md) + - [PayloadUser](docs/PayloadUser.md) + - [Permission](docs/Permission.md) + - [PrBranchInfo](docs/PrBranchInfo.md) + - [PublicKey](docs/PublicKey.md) + - [PullRequest](docs/PullRequest.md) + - [PullRequestMeta](docs/PullRequestMeta.md) + - [PullReview](docs/PullReview.md) + - [PullReviewComment](docs/PullReviewComment.md) + - [PullReviewRequestOptions](docs/PullReviewRequestOptions.md) + - [Reaction](docs/Reaction.md) + - [Reference](docs/Reference.md) + - [Release](docs/Release.md) + - [RepoCollaboratorPermission](docs/RepoCollaboratorPermission.md) + - [RepoCommit](docs/RepoCommit.md) + - [RepoTopicOptions](docs/RepoTopicOptions.md) + - [RepoTransfer](docs/RepoTransfer.md) + - [Repository](docs/Repository.md) + - [RepositoryMeta](docs/RepositoryMeta.md) + - [SearchResults](docs/SearchResults.md) + - [ServerVersion](docs/ServerVersion.md) + - [StopWatch](docs/StopWatch.md) + - [SubmitPullReviewOptions](docs/SubmitPullReviewOptions.md) + - [Tag](docs/Tag.md) + - [Team](docs/Team.md) + - [TeamSearch200Response](docs/TeamSearch200Response.md) + - [TimelineComment](docs/TimelineComment.md) + - [TopicName](docs/TopicName.md) + - [TopicResponse](docs/TopicResponse.md) + - [TrackedTime](docs/TrackedTime.md) + - [TransferRepoOption](docs/TransferRepoOption.md) + - [UpdateFileOptions](docs/UpdateFileOptions.md) + - [User](docs/User.md) + - [UserHeatmapData](docs/UserHeatmapData.md) + - [UserSearch200Response](docs/UserSearch200Response.md) + - [UserSettings](docs/UserSettings.md) + - [UserSettingsOptions](docs/UserSettingsOptions.md) + - [WatchInfo](docs/WatchInfo.md) + - [WikiCommit](docs/WikiCommit.md) + - [WikiCommitList](docs/WikiCommitList.md) + - [WikiPage](docs/WikiPage.md) + - [WikiPageMetaData](docs/WikiPageMetaData.md) + + +To get access to the crate's generated documentation, use: + +``` +cargo doc --open +``` + +## Author + + + diff --git a/crates/gitea_raw_client/docs/AccessToken.md b/crates/gitea_raw_client/docs/AccessToken.md new file mode 100644 index 0000000..b810dcc --- /dev/null +++ b/crates/gitea_raw_client/docs/AccessToken.md @@ -0,0 +1,14 @@ +# AccessToken + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | Option<**i64**> | | [optional] +**name** | Option<**String**> | | [optional] +**sha1** | Option<**String**> | | [optional] +**token_last_eight** | Option<**String**> | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/crates/gitea_raw_client/docs/AddCollaboratorOption.md b/crates/gitea_raw_client/docs/AddCollaboratorOption.md new file mode 100644 index 0000000..353eaa4 --- /dev/null +++ b/crates/gitea_raw_client/docs/AddCollaboratorOption.md @@ -0,0 +1,11 @@ +# AddCollaboratorOption + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**permission** | Option<**String**> | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/crates/gitea_raw_client/docs/AddTimeOption.md b/crates/gitea_raw_client/docs/AddTimeOption.md new file mode 100644 index 0000000..e64bdc4 --- /dev/null +++ b/crates/gitea_raw_client/docs/AddTimeOption.md @@ -0,0 +1,13 @@ +# AddTimeOption + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**created** | Option<**String**> | | [optional] +**time** | **i64** | time in seconds | +**user_name** | Option<**String**> | User who spent the time (optional) | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/crates/gitea_raw_client/docs/AdminApi.md b/crates/gitea_raw_client/docs/AdminApi.md new file mode 100644 index 0000000..8cde9b8 --- /dev/null +++ b/crates/gitea_raw_client/docs/AdminApi.md @@ -0,0 +1,426 @@ +# \AdminApi + +All URIs are relative to */api/v1* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**admin_adopt_repository**](AdminApi.md#admin_adopt_repository) | **POST** /admin/unadopted/{owner}/{repo} | Adopt unadopted files as a repository +[**admin_create_org**](AdminApi.md#admin_create_org) | **POST** /admin/users/{username}/orgs | Create an organization +[**admin_create_public_key**](AdminApi.md#admin_create_public_key) | **POST** /admin/users/{username}/keys | Add a public key on behalf of a user +[**admin_create_repo**](AdminApi.md#admin_create_repo) | **POST** /admin/users/{username}/repos | Create a repository on behalf of a user +[**admin_create_user**](AdminApi.md#admin_create_user) | **POST** /admin/users | Create a user +[**admin_cron_list**](AdminApi.md#admin_cron_list) | **GET** /admin/cron | List cron tasks +[**admin_cron_run**](AdminApi.md#admin_cron_run) | **POST** /admin/cron/{task} | Run cron task +[**admin_delete_unadopted_repository**](AdminApi.md#admin_delete_unadopted_repository) | **DELETE** /admin/unadopted/{owner}/{repo} | Delete unadopted files +[**admin_delete_user**](AdminApi.md#admin_delete_user) | **DELETE** /admin/users/{username} | Delete a user +[**admin_delete_user_public_key**](AdminApi.md#admin_delete_user_public_key) | **DELETE** /admin/users/{username}/keys/{id} | Delete a user's public key +[**admin_edit_user**](AdminApi.md#admin_edit_user) | **PATCH** /admin/users/{username} | Edit an existing user +[**admin_get_all_orgs**](AdminApi.md#admin_get_all_orgs) | **GET** /admin/orgs | List all organizations +[**admin_get_all_users**](AdminApi.md#admin_get_all_users) | **GET** /admin/users | List all users +[**admin_unadopted_list**](AdminApi.md#admin_unadopted_list) | **GET** /admin/unadopted | List unadopted repositories + + + +## admin_adopt_repository + +> admin_adopt_repository(owner, repo) +Adopt unadopted files as a repository + +### Parameters + + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**owner** | **String** | owner of the repo | [required] | +**repo** | **String** | name of the repo | [required] | + +### Return type + + (empty response body) + +### Authorization + +[AccessToken](../README.md#AccessToken), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [BasicAuth](../README.md#BasicAuth), [SudoHeader](../README.md#SudoHeader), [SudoParam](../README.md#SudoParam), [TOTPHeader](../README.md#TOTPHeader), [Token](../README.md#Token) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: Not defined + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +## admin_create_org + +> crate::models::Organization admin_create_org(username, organization) +Create an organization + +### Parameters + + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**username** | **String** | username of the user that will own the created organization | [required] | +**organization** | [**CreateOrgOption**](CreateOrgOption.md) | | [required] | + +### Return type + +[**crate::models::Organization**](Organization.md) + +### Authorization + +[AccessToken](../README.md#AccessToken), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [BasicAuth](../README.md#BasicAuth), [SudoHeader](../README.md#SudoHeader), [SudoParam](../README.md#SudoParam), [TOTPHeader](../README.md#TOTPHeader), [Token](../README.md#Token) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +## admin_create_public_key + +> crate::models::PublicKey admin_create_public_key(username, key) +Add a public key on behalf of a user + +### Parameters + + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**username** | **String** | username of the user | [required] | +**key** | Option<[**CreateKeyOption**](CreateKeyOption.md)> | | | + +### Return type + +[**crate::models::PublicKey**](PublicKey.md) + +### Authorization + +[AccessToken](../README.md#AccessToken), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [BasicAuth](../README.md#BasicAuth), [SudoHeader](../README.md#SudoHeader), [SudoParam](../README.md#SudoParam), [TOTPHeader](../README.md#TOTPHeader), [Token](../README.md#Token) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +## admin_create_repo + +> crate::models::Repository admin_create_repo(username, repository) +Create a repository on behalf of a user + +### Parameters + + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**username** | **String** | username of the user. This user will own the created repository | [required] | +**repository** | [**CreateRepoOption**](CreateRepoOption.md) | | [required] | + +### Return type + +[**crate::models::Repository**](Repository.md) + +### Authorization + +[AccessToken](../README.md#AccessToken), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [BasicAuth](../README.md#BasicAuth), [SudoHeader](../README.md#SudoHeader), [SudoParam](../README.md#SudoParam), [TOTPHeader](../README.md#TOTPHeader), [Token](../README.md#Token) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +## admin_create_user + +> crate::models::User admin_create_user(body) +Create a user + +### Parameters + + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**body** | Option<[**CreateUserOption**](CreateUserOption.md)> | | | + +### Return type + +[**crate::models::User**](User.md) + +### Authorization + +[AccessToken](../README.md#AccessToken), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [BasicAuth](../README.md#BasicAuth), [SudoHeader](../README.md#SudoHeader), [SudoParam](../README.md#SudoParam), [TOTPHeader](../README.md#TOTPHeader), [Token](../README.md#Token) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +## admin_cron_list + +> Vec admin_cron_list(page, limit) +List cron tasks + +### Parameters + + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**page** | Option<**i32**> | page number of results to return (1-based) | | +**limit** | Option<**i32**> | page size of results | | + +### Return type + +[**Vec**](Cron.md) + +### Authorization + +[AccessToken](../README.md#AccessToken), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [BasicAuth](../README.md#BasicAuth), [SudoHeader](../README.md#SudoHeader), [SudoParam](../README.md#SudoParam), [TOTPHeader](../README.md#TOTPHeader), [Token](../README.md#Token) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +## admin_cron_run + +> admin_cron_run(task) +Run cron task + +### Parameters + + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**task** | **String** | task to run | [required] | + +### Return type + + (empty response body) + +### Authorization + +[AccessToken](../README.md#AccessToken), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [BasicAuth](../README.md#BasicAuth), [SudoHeader](../README.md#SudoHeader), [SudoParam](../README.md#SudoParam), [TOTPHeader](../README.md#TOTPHeader), [Token](../README.md#Token) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: Not defined + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +## admin_delete_unadopted_repository + +> admin_delete_unadopted_repository(owner, repo) +Delete unadopted files + +### Parameters + + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**owner** | **String** | owner of the repo | [required] | +**repo** | **String** | name of the repo | [required] | + +### Return type + + (empty response body) + +### Authorization + +[AccessToken](../README.md#AccessToken), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [BasicAuth](../README.md#BasicAuth), [SudoHeader](../README.md#SudoHeader), [SudoParam](../README.md#SudoParam), [TOTPHeader](../README.md#TOTPHeader), [Token](../README.md#Token) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: Not defined + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +## admin_delete_user + +> admin_delete_user(username) +Delete a user + +### Parameters + + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**username** | **String** | username of user to delete | [required] | + +### Return type + + (empty response body) + +### Authorization + +[AccessToken](../README.md#AccessToken), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [BasicAuth](../README.md#BasicAuth), [SudoHeader](../README.md#SudoHeader), [SudoParam](../README.md#SudoParam), [TOTPHeader](../README.md#TOTPHeader), [Token](../README.md#Token) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: Not defined + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +## admin_delete_user_public_key + +> admin_delete_user_public_key(username, id) +Delete a user's public key + +### Parameters + + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**username** | **String** | username of user | [required] | +**id** | **i64** | id of the key to delete | [required] | + +### Return type + + (empty response body) + +### Authorization + +[AccessToken](../README.md#AccessToken), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [BasicAuth](../README.md#BasicAuth), [SudoHeader](../README.md#SudoHeader), [SudoParam](../README.md#SudoParam), [TOTPHeader](../README.md#TOTPHeader), [Token](../README.md#Token) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: Not defined + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +## admin_edit_user + +> crate::models::User admin_edit_user(username, body) +Edit an existing user + +### Parameters + + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**username** | **String** | username of user to edit | [required] | +**body** | Option<[**EditUserOption**](EditUserOption.md)> | | | + +### Return type + +[**crate::models::User**](User.md) + +### Authorization + +[AccessToken](../README.md#AccessToken), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [BasicAuth](../README.md#BasicAuth), [SudoHeader](../README.md#SudoHeader), [SudoParam](../README.md#SudoParam), [TOTPHeader](../README.md#TOTPHeader), [Token](../README.md#Token) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +## admin_get_all_orgs + +> Vec admin_get_all_orgs(page, limit) +List all organizations + +### Parameters + + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**page** | Option<**i32**> | page number of results to return (1-based) | | +**limit** | Option<**i32**> | page size of results | | + +### Return type + +[**Vec**](Organization.md) + +### Authorization + +[AccessToken](../README.md#AccessToken), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [BasicAuth](../README.md#BasicAuth), [SudoHeader](../README.md#SudoHeader), [SudoParam](../README.md#SudoParam), [TOTPHeader](../README.md#TOTPHeader), [Token](../README.md#Token) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +## admin_get_all_users + +> Vec admin_get_all_users(page, limit) +List all users + +### Parameters + + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**page** | Option<**i32**> | page number of results to return (1-based) | | +**limit** | Option<**i32**> | page size of results | | + +### Return type + +[**Vec**](User.md) + +### Authorization + +[AccessToken](../README.md#AccessToken), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [BasicAuth](../README.md#BasicAuth), [SudoHeader](../README.md#SudoHeader), [SudoParam](../README.md#SudoParam), [TOTPHeader](../README.md#TOTPHeader), [Token](../README.md#Token) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +## admin_unadopted_list + +> Vec admin_unadopted_list(page, limit, pattern) +List unadopted repositories + +### Parameters + + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**page** | Option<**i32**> | page number of results to return (1-based) | | +**limit** | Option<**i32**> | page size of results | | +**pattern** | Option<**String**> | pattern of repositories to search for | | + +### Return type + +**Vec** + +### Authorization + +[AccessToken](../README.md#AccessToken), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [BasicAuth](../README.md#BasicAuth), [SudoHeader](../README.md#SudoHeader), [SudoParam](../README.md#SudoParam), [TOTPHeader](../README.md#TOTPHeader), [Token](../README.md#Token) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + diff --git a/crates/gitea_raw_client/docs/AnnotatedTag.md b/crates/gitea_raw_client/docs/AnnotatedTag.md new file mode 100644 index 0000000..ce24021 --- /dev/null +++ b/crates/gitea_raw_client/docs/AnnotatedTag.md @@ -0,0 +1,17 @@ +# AnnotatedTag + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**message** | Option<**String**> | | [optional] +**object** | Option<[**crate::models::AnnotatedTagObject**](AnnotatedTagObject.md)> | | [optional] +**sha** | Option<**String**> | | [optional] +**tag** | Option<**String**> | | [optional] +**tagger** | Option<[**crate::models::CommitUser**](CommitUser.md)> | | [optional] +**url** | Option<**String**> | | [optional] +**verification** | Option<[**crate::models::PayloadCommitVerification**](PayloadCommitVerification.md)> | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/crates/gitea_raw_client/docs/AnnotatedTagObject.md b/crates/gitea_raw_client/docs/AnnotatedTagObject.md new file mode 100644 index 0000000..01837b9 --- /dev/null +++ b/crates/gitea_raw_client/docs/AnnotatedTagObject.md @@ -0,0 +1,13 @@ +# AnnotatedTagObject + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**sha** | Option<**String**> | | [optional] +**r#type** | Option<**String**> | | [optional] +**url** | Option<**String**> | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/crates/gitea_raw_client/docs/ApiError.md b/crates/gitea_raw_client/docs/ApiError.md new file mode 100644 index 0000000..94e66d5 --- /dev/null +++ b/crates/gitea_raw_client/docs/ApiError.md @@ -0,0 +1,12 @@ +# ApiError + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**message** | Option<**String**> | | [optional] +**url** | Option<**String**> | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/crates/gitea_raw_client/docs/Attachment.md b/crates/gitea_raw_client/docs/Attachment.md new file mode 100644 index 0000000..98debb9 --- /dev/null +++ b/crates/gitea_raw_client/docs/Attachment.md @@ -0,0 +1,17 @@ +# Attachment + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**browser_download_url** | Option<**String**> | | [optional] +**created_at** | Option<**String**> | | [optional] +**download_count** | Option<**i64**> | | [optional] +**id** | Option<**i64**> | | [optional] +**name** | Option<**String**> | | [optional] +**size** | Option<**i64**> | | [optional] +**uuid** | Option<**String**> | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/crates/gitea_raw_client/docs/Branch.md b/crates/gitea_raw_client/docs/Branch.md new file mode 100644 index 0000000..de407f2 --- /dev/null +++ b/crates/gitea_raw_client/docs/Branch.md @@ -0,0 +1,19 @@ +# Branch + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**commit** | Option<[**crate::models::PayloadCommit**](PayloadCommit.md)> | | [optional] +**effective_branch_protection_name** | Option<**String**> | | [optional] +**enable_status_check** | Option<**bool**> | | [optional] +**name** | Option<**String**> | | [optional] +**protected** | Option<**bool**> | | [optional] +**required_approvals** | Option<**i64**> | | [optional] +**status_check_contexts** | Option<**Vec**> | | [optional] +**user_can_merge** | Option<**bool**> | | [optional] +**user_can_push** | Option<**bool**> | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/crates/gitea_raw_client/docs/BranchProtection.md b/crates/gitea_raw_client/docs/BranchProtection.md new file mode 100644 index 0000000..0e4ae7e --- /dev/null +++ b/crates/gitea_raw_client/docs/BranchProtection.md @@ -0,0 +1,34 @@ +# BranchProtection + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**approvals_whitelist_teams** | Option<**Vec**> | | [optional] +**approvals_whitelist_username** | Option<**Vec**> | | [optional] +**block_on_official_review_requests** | Option<**bool**> | | [optional] +**block_on_outdated_branch** | Option<**bool**> | | [optional] +**block_on_rejected_reviews** | Option<**bool**> | | [optional] +**branch_name** | Option<**String**> | | [optional] +**created_at** | Option<**String**> | | [optional] +**dismiss_stale_approvals** | Option<**bool**> | | [optional] +**enable_approvals_whitelist** | Option<**bool**> | | [optional] +**enable_merge_whitelist** | Option<**bool**> | | [optional] +**enable_push** | Option<**bool**> | | [optional] +**enable_push_whitelist** | Option<**bool**> | | [optional] +**enable_status_check** | Option<**bool**> | | [optional] +**merge_whitelist_teams** | Option<**Vec**> | | [optional] +**merge_whitelist_usernames** | Option<**Vec**> | | [optional] +**protected_file_patterns** | Option<**String**> | | [optional] +**push_whitelist_deploy_keys** | Option<**bool**> | | [optional] +**push_whitelist_teams** | Option<**Vec**> | | [optional] +**push_whitelist_usernames** | Option<**Vec**> | | [optional] +**require_signed_commits** | Option<**bool**> | | [optional] +**required_approvals** | Option<**i64**> | | [optional] +**status_check_contexts** | Option<**Vec**> | | [optional] +**unprotected_file_patterns** | Option<**String**> | | [optional] +**updated_at** | Option<**String**> | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/crates/gitea_raw_client/docs/CombinedStatus.md b/crates/gitea_raw_client/docs/CombinedStatus.md new file mode 100644 index 0000000..7e00d71 --- /dev/null +++ b/crates/gitea_raw_client/docs/CombinedStatus.md @@ -0,0 +1,17 @@ +# CombinedStatus + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**commit_url** | Option<**String**> | | [optional] +**repository** | Option<[**crate::models::Repository**](Repository.md)> | | [optional] +**sha** | Option<**String**> | | [optional] +**state** | Option<**String**> | CommitStatusState holds the state of a CommitStatus It can be \"pending\", \"success\", \"error\", \"failure\", and \"warning\" | [optional] +**statuses** | Option<[**Vec**](CommitStatus.md)> | | [optional] +**total_count** | Option<**i64**> | | [optional] +**url** | Option<**String**> | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/crates/gitea_raw_client/docs/Comment.md b/crates/gitea_raw_client/docs/Comment.md new file mode 100644 index 0000000..53f182a --- /dev/null +++ b/crates/gitea_raw_client/docs/Comment.md @@ -0,0 +1,20 @@ +# Comment + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**body** | Option<**String**> | | [optional] +**created_at** | Option<**String**> | | [optional] +**html_url** | Option<**String**> | | [optional] +**id** | Option<**i64**> | | [optional] +**issue_url** | Option<**String**> | | [optional] +**original_author** | Option<**String**> | | [optional] +**original_author_id** | Option<**i64**> | | [optional] +**pull_request_url** | Option<**String**> | | [optional] +**updated_at** | Option<**String**> | | [optional] +**user** | Option<[**crate::models::User**](User.md)> | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/crates/gitea_raw_client/docs/Commit.md b/crates/gitea_raw_client/docs/Commit.md new file mode 100644 index 0000000..9ce9cc1 --- /dev/null +++ b/crates/gitea_raw_client/docs/Commit.md @@ -0,0 +1,20 @@ +# Commit + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**author** | Option<[**crate::models::User**](User.md)> | | [optional] +**commit** | Option<[**crate::models::RepoCommit**](RepoCommit.md)> | | [optional] +**committer** | Option<[**crate::models::User**](User.md)> | | [optional] +**created** | Option<**String**> | | [optional] +**files** | Option<[**Vec**](CommitAffectedFiles.md)> | | [optional] +**html_url** | Option<**String**> | | [optional] +**parents** | Option<[**Vec**](CommitMeta.md)> | | [optional] +**sha** | Option<**String**> | | [optional] +**stats** | Option<[**crate::models::CommitStats**](CommitStats.md)> | | [optional] +**url** | Option<**String**> | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/crates/gitea_raw_client/docs/CommitAffectedFiles.md b/crates/gitea_raw_client/docs/CommitAffectedFiles.md new file mode 100644 index 0000000..b057767 --- /dev/null +++ b/crates/gitea_raw_client/docs/CommitAffectedFiles.md @@ -0,0 +1,11 @@ +# CommitAffectedFiles + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**filename** | Option<**String**> | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/crates/gitea_raw_client/docs/CommitDateOptions.md b/crates/gitea_raw_client/docs/CommitDateOptions.md new file mode 100644 index 0000000..b118f48 --- /dev/null +++ b/crates/gitea_raw_client/docs/CommitDateOptions.md @@ -0,0 +1,12 @@ +# CommitDateOptions + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**author** | Option<**String**> | | [optional] +**committer** | Option<**String**> | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/crates/gitea_raw_client/docs/CommitMeta.md b/crates/gitea_raw_client/docs/CommitMeta.md new file mode 100644 index 0000000..e026016 --- /dev/null +++ b/crates/gitea_raw_client/docs/CommitMeta.md @@ -0,0 +1,13 @@ +# CommitMeta + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**created** | Option<**String**> | | [optional] +**sha** | Option<**String**> | | [optional] +**url** | Option<**String**> | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/crates/gitea_raw_client/docs/CommitStats.md b/crates/gitea_raw_client/docs/CommitStats.md new file mode 100644 index 0000000..1ebf9e2 --- /dev/null +++ b/crates/gitea_raw_client/docs/CommitStats.md @@ -0,0 +1,13 @@ +# CommitStats + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**additions** | Option<**i64**> | | [optional] +**deletions** | Option<**i64**> | | [optional] +**total** | Option<**i64**> | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/crates/gitea_raw_client/docs/CommitStatus.md b/crates/gitea_raw_client/docs/CommitStatus.md new file mode 100644 index 0000000..571d199 --- /dev/null +++ b/crates/gitea_raw_client/docs/CommitStatus.md @@ -0,0 +1,19 @@ +# CommitStatus + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**context** | Option<**String**> | | [optional] +**created_at** | Option<**String**> | | [optional] +**creator** | Option<[**crate::models::User**](User.md)> | | [optional] +**description** | Option<**String**> | | [optional] +**id** | Option<**i64**> | | [optional] +**status** | Option<**String**> | CommitStatusState holds the state of a CommitStatus It can be \"pending\", \"success\", \"error\", \"failure\", and \"warning\" | [optional] +**target_url** | Option<**String**> | | [optional] +**updated_at** | Option<**String**> | | [optional] +**url** | Option<**String**> | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/crates/gitea_raw_client/docs/CommitUser.md b/crates/gitea_raw_client/docs/CommitUser.md new file mode 100644 index 0000000..cafe69d --- /dev/null +++ b/crates/gitea_raw_client/docs/CommitUser.md @@ -0,0 +1,13 @@ +# CommitUser + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**date** | Option<**String**> | | [optional] +**email** | Option<**String**> | | [optional] +**name** | Option<**String**> | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/crates/gitea_raw_client/docs/ContentsResponse.md b/crates/gitea_raw_client/docs/ContentsResponse.md new file mode 100644 index 0000000..873cbe2 --- /dev/null +++ b/crates/gitea_raw_client/docs/ContentsResponse.md @@ -0,0 +1,24 @@ +# ContentsResponse + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**_links** | Option<[**crate::models::FileLinksResponse**](FileLinksResponse.md)> | | [optional] +**content** | Option<**String**> | `content` is populated when `type` is `file`, otherwise null | [optional] +**download_url** | Option<**String**> | | [optional] +**encoding** | Option<**String**> | `encoding` is populated when `type` is `file`, otherwise null | [optional] +**git_url** | Option<**String**> | | [optional] +**html_url** | Option<**String**> | | [optional] +**name** | Option<**String**> | | [optional] +**path** | Option<**String**> | | [optional] +**sha** | Option<**String**> | | [optional] +**size** | Option<**i64**> | | [optional] +**submodule_git_url** | Option<**String**> | `submodule_git_url` is populated when `type` is `submodule`, otherwise null | [optional] +**target** | Option<**String**> | `target` is populated when `type` is `symlink`, otherwise null | [optional] +**r#type** | Option<**String**> | `type` will be `file`, `dir`, `symlink`, or `submodule` | [optional] +**url** | Option<**String**> | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/crates/gitea_raw_client/docs/CreateAccessTokenOption.md b/crates/gitea_raw_client/docs/CreateAccessTokenOption.md new file mode 100644 index 0000000..7f37ba9 --- /dev/null +++ b/crates/gitea_raw_client/docs/CreateAccessTokenOption.md @@ -0,0 +1,11 @@ +# CreateAccessTokenOption + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**name** | Option<**String**> | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/crates/gitea_raw_client/docs/CreateBranchProtectionOption.md b/crates/gitea_raw_client/docs/CreateBranchProtectionOption.md new file mode 100644 index 0000000..1bea72b --- /dev/null +++ b/crates/gitea_raw_client/docs/CreateBranchProtectionOption.md @@ -0,0 +1,32 @@ +# CreateBranchProtectionOption + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**approvals_whitelist_teams** | Option<**Vec**> | | [optional] +**approvals_whitelist_username** | Option<**Vec**> | | [optional] +**block_on_official_review_requests** | Option<**bool**> | | [optional] +**block_on_outdated_branch** | Option<**bool**> | | [optional] +**block_on_rejected_reviews** | Option<**bool**> | | [optional] +**branch_name** | Option<**String**> | | [optional] +**dismiss_stale_approvals** | Option<**bool**> | | [optional] +**enable_approvals_whitelist** | Option<**bool**> | | [optional] +**enable_merge_whitelist** | Option<**bool**> | | [optional] +**enable_push** | Option<**bool**> | | [optional] +**enable_push_whitelist** | Option<**bool**> | | [optional] +**enable_status_check** | Option<**bool**> | | [optional] +**merge_whitelist_teams** | Option<**Vec**> | | [optional] +**merge_whitelist_usernames** | Option<**Vec**> | | [optional] +**protected_file_patterns** | Option<**String**> | | [optional] +**push_whitelist_deploy_keys** | Option<**bool**> | | [optional] +**push_whitelist_teams** | Option<**Vec**> | | [optional] +**push_whitelist_usernames** | Option<**Vec**> | | [optional] +**require_signed_commits** | Option<**bool**> | | [optional] +**required_approvals** | Option<**i64**> | | [optional] +**status_check_contexts** | Option<**Vec**> | | [optional] +**unprotected_file_patterns** | Option<**String**> | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/crates/gitea_raw_client/docs/CreateBranchRepoOption.md b/crates/gitea_raw_client/docs/CreateBranchRepoOption.md new file mode 100644 index 0000000..a04bc51 --- /dev/null +++ b/crates/gitea_raw_client/docs/CreateBranchRepoOption.md @@ -0,0 +1,12 @@ +# CreateBranchRepoOption + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**new_branch_name** | **String** | Name of the branch to create | +**old_branch_name** | Option<**String**> | Name of the old branch to create from | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/crates/gitea_raw_client/docs/CreateEmailOption.md b/crates/gitea_raw_client/docs/CreateEmailOption.md new file mode 100644 index 0000000..1224abf --- /dev/null +++ b/crates/gitea_raw_client/docs/CreateEmailOption.md @@ -0,0 +1,11 @@ +# CreateEmailOption + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**emails** | Option<**Vec**> | email addresses to add | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/crates/gitea_raw_client/docs/CreateFileOptions.md b/crates/gitea_raw_client/docs/CreateFileOptions.md new file mode 100644 index 0000000..3a03073 --- /dev/null +++ b/crates/gitea_raw_client/docs/CreateFileOptions.md @@ -0,0 +1,18 @@ +# CreateFileOptions + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**author** | Option<[**crate::models::Identity**](Identity.md)> | | [optional] +**branch** | Option<**String**> | branch (optional) to base this file from. if not given, the default branch is used | [optional] +**committer** | Option<[**crate::models::Identity**](Identity.md)> | | [optional] +**content** | **String** | content must be base64 encoded | +**dates** | Option<[**crate::models::CommitDateOptions**](CommitDateOptions.md)> | | [optional] +**message** | Option<**String**> | message (optional) for the commit of this file. if not supplied, a default message will be used | [optional] +**new_branch** | Option<**String**> | new_branch (optional) will make a new branch from `branch` before creating the file | [optional] +**signoff** | Option<**bool**> | Add a Signed-off-by trailer by the committer at the end of the commit log message. | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/crates/gitea_raw_client/docs/CreateForkOption.md b/crates/gitea_raw_client/docs/CreateForkOption.md new file mode 100644 index 0000000..f24a7cc --- /dev/null +++ b/crates/gitea_raw_client/docs/CreateForkOption.md @@ -0,0 +1,12 @@ +# CreateForkOption + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**name** | Option<**String**> | name of the forked repository | [optional] +**organization** | Option<**String**> | organization name, if forking into an organization | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/crates/gitea_raw_client/docs/CreateGpgKeyOption.md b/crates/gitea_raw_client/docs/CreateGpgKeyOption.md new file mode 100644 index 0000000..a96e002 --- /dev/null +++ b/crates/gitea_raw_client/docs/CreateGpgKeyOption.md @@ -0,0 +1,12 @@ +# CreateGpgKeyOption + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**armored_public_key** | **String** | An armored GPG key to add | +**armored_signature** | Option<**String**> | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/crates/gitea_raw_client/docs/CreateHookOption.md b/crates/gitea_raw_client/docs/CreateHookOption.md new file mode 100644 index 0000000..19f3e91 --- /dev/null +++ b/crates/gitea_raw_client/docs/CreateHookOption.md @@ -0,0 +1,15 @@ +# CreateHookOption + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**active** | Option<**bool**> | | [optional][default to false] +**branch_filter** | Option<**String**> | | [optional] +**config** | **::std::collections::HashMap** | CreateHookOptionConfig has all config options in it required are \"content_type\" and \"url\" Required | +**events** | Option<**Vec**> | | [optional] +**r#type** | **String** | | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/crates/gitea_raw_client/docs/CreateIssueCommentOption.md b/crates/gitea_raw_client/docs/CreateIssueCommentOption.md new file mode 100644 index 0000000..74d8dc4 --- /dev/null +++ b/crates/gitea_raw_client/docs/CreateIssueCommentOption.md @@ -0,0 +1,11 @@ +# CreateIssueCommentOption + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**body** | **String** | | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/crates/gitea_raw_client/docs/CreateIssueOption.md b/crates/gitea_raw_client/docs/CreateIssueOption.md new file mode 100644 index 0000000..08e71d6 --- /dev/null +++ b/crates/gitea_raw_client/docs/CreateIssueOption.md @@ -0,0 +1,19 @@ +# CreateIssueOption + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**assignee** | Option<**String**> | deprecated | [optional] +**assignees** | Option<**Vec**> | | [optional] +**body** | Option<**String**> | | [optional] +**closed** | Option<**bool**> | | [optional] +**due_date** | Option<**String**> | | [optional] +**labels** | Option<**Vec**> | list of label ids | [optional] +**milestone** | Option<**i64**> | milestone id | [optional] +**r#ref** | Option<**String**> | | [optional] +**title** | **String** | | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/crates/gitea_raw_client/docs/CreateKeyOption.md b/crates/gitea_raw_client/docs/CreateKeyOption.md new file mode 100644 index 0000000..cdab8a1 --- /dev/null +++ b/crates/gitea_raw_client/docs/CreateKeyOption.md @@ -0,0 +1,13 @@ +# CreateKeyOption + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**key** | **String** | An armored SSH key to add | +**read_only** | Option<**bool**> | Describe if the key has only read access or read/write | [optional] +**title** | **String** | Title of the key to add | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/crates/gitea_raw_client/docs/CreateLabelOption.md b/crates/gitea_raw_client/docs/CreateLabelOption.md new file mode 100644 index 0000000..e81bfb5 --- /dev/null +++ b/crates/gitea_raw_client/docs/CreateLabelOption.md @@ -0,0 +1,13 @@ +# CreateLabelOption + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**color** | **String** | | +**description** | Option<**String**> | | [optional] +**name** | **String** | | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/crates/gitea_raw_client/docs/CreateMilestoneOption.md b/crates/gitea_raw_client/docs/CreateMilestoneOption.md new file mode 100644 index 0000000..b00152e --- /dev/null +++ b/crates/gitea_raw_client/docs/CreateMilestoneOption.md @@ -0,0 +1,14 @@ +# CreateMilestoneOption + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**description** | Option<**String**> | | [optional] +**due_on** | Option<**String**> | | [optional] +**state** | Option<**String**> | | [optional] +**title** | Option<**String**> | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/crates/gitea_raw_client/docs/CreateOAuth2ApplicationOptions.md b/crates/gitea_raw_client/docs/CreateOAuth2ApplicationOptions.md new file mode 100644 index 0000000..7e3ee69 --- /dev/null +++ b/crates/gitea_raw_client/docs/CreateOAuth2ApplicationOptions.md @@ -0,0 +1,12 @@ +# CreateOAuth2ApplicationOptions + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**name** | Option<**String**> | | [optional] +**redirect_uris** | Option<**Vec**> | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/crates/gitea_raw_client/docs/CreateOrgOption.md b/crates/gitea_raw_client/docs/CreateOrgOption.md new file mode 100644 index 0000000..09d75f8 --- /dev/null +++ b/crates/gitea_raw_client/docs/CreateOrgOption.md @@ -0,0 +1,17 @@ +# CreateOrgOption + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**description** | Option<**String**> | | [optional] +**full_name** | Option<**String**> | | [optional] +**location** | Option<**String**> | | [optional] +**repo_admin_change_team_access** | Option<**bool**> | | [optional] +**username** | **String** | | +**visibility** | Option<**String**> | possible values are `public` (default), `limited` or `private` | [optional] +**website** | Option<**String**> | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/crates/gitea_raw_client/docs/CreatePullRequestOption.md b/crates/gitea_raw_client/docs/CreatePullRequestOption.md new file mode 100644 index 0000000..1028806 --- /dev/null +++ b/crates/gitea_raw_client/docs/CreatePullRequestOption.md @@ -0,0 +1,19 @@ +# CreatePullRequestOption + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**assignee** | Option<**String**> | | [optional] +**assignees** | Option<**Vec**> | | [optional] +**base** | Option<**String**> | | [optional] +**body** | Option<**String**> | | [optional] +**due_date** | Option<**String**> | | [optional] +**head** | Option<**String**> | | [optional] +**labels** | Option<**Vec**> | | [optional] +**milestone** | Option<**i64**> | | [optional] +**title** | Option<**String**> | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/crates/gitea_raw_client/docs/CreatePullReviewComment.md b/crates/gitea_raw_client/docs/CreatePullReviewComment.md new file mode 100644 index 0000000..62985a9 --- /dev/null +++ b/crates/gitea_raw_client/docs/CreatePullReviewComment.md @@ -0,0 +1,14 @@ +# CreatePullReviewComment + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**body** | Option<**String**> | | [optional] +**new_position** | Option<**i64**> | if comment to new file line or 0 | [optional] +**old_position** | Option<**i64**> | if comment to old file line or 0 | [optional] +**path** | Option<**String**> | the tree path | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/crates/gitea_raw_client/docs/CreatePullReviewOptions.md b/crates/gitea_raw_client/docs/CreatePullReviewOptions.md new file mode 100644 index 0000000..eb2e602 --- /dev/null +++ b/crates/gitea_raw_client/docs/CreatePullReviewOptions.md @@ -0,0 +1,14 @@ +# CreatePullReviewOptions + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**body** | Option<**String**> | | [optional] +**comments** | Option<[**Vec**](CreatePullReviewComment.md)> | | [optional] +**commit_id** | Option<**String**> | | [optional] +**event** | Option<**String**> | ReviewStateType review state type | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/crates/gitea_raw_client/docs/CreateReleaseOption.md b/crates/gitea_raw_client/docs/CreateReleaseOption.md new file mode 100644 index 0000000..309884b --- /dev/null +++ b/crates/gitea_raw_client/docs/CreateReleaseOption.md @@ -0,0 +1,16 @@ +# CreateReleaseOption + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**body** | Option<**String**> | | [optional] +**draft** | Option<**bool**> | | [optional] +**name** | Option<**String**> | | [optional] +**prerelease** | Option<**bool**> | | [optional] +**tag_name** | **String** | | +**target_commitish** | Option<**String**> | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/crates/gitea_raw_client/docs/CreateRepoOption.md b/crates/gitea_raw_client/docs/CreateRepoOption.md new file mode 100644 index 0000000..057e770 --- /dev/null +++ b/crates/gitea_raw_client/docs/CreateRepoOption.md @@ -0,0 +1,21 @@ +# CreateRepoOption + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**auto_init** | Option<**bool**> | Whether the repository should be auto-initialized? | [optional] +**default_branch** | Option<**String**> | DefaultBranch of the repository (used when initializes and in template) | [optional] +**description** | Option<**String**> | Description of the repository to create | [optional] +**gitignores** | Option<**String**> | Gitignores to use | [optional] +**issue_labels** | Option<**String**> | Label-Set to use | [optional] +**license** | Option<**String**> | License to use | [optional] +**name** | **String** | Name of the repository to create | +**private** | Option<**bool**> | Whether the repository is private | [optional] +**readme** | Option<**String**> | Readme of the repository to create | [optional] +**template** | Option<**bool**> | Whether the repository is template | [optional] +**trust_model** | Option<**String**> | TrustModel of the repository | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/crates/gitea_raw_client/docs/CreateStatusOption.md b/crates/gitea_raw_client/docs/CreateStatusOption.md new file mode 100644 index 0000000..21bf538 --- /dev/null +++ b/crates/gitea_raw_client/docs/CreateStatusOption.md @@ -0,0 +1,14 @@ +# CreateStatusOption + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**context** | Option<**String**> | | [optional] +**description** | Option<**String**> | | [optional] +**state** | Option<**String**> | CommitStatusState holds the state of a CommitStatus It can be \"pending\", \"success\", \"error\", \"failure\", and \"warning\" | [optional] +**target_url** | Option<**String**> | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/crates/gitea_raw_client/docs/CreateTagOption.md b/crates/gitea_raw_client/docs/CreateTagOption.md new file mode 100644 index 0000000..475f578 --- /dev/null +++ b/crates/gitea_raw_client/docs/CreateTagOption.md @@ -0,0 +1,13 @@ +# CreateTagOption + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**message** | Option<**String**> | | [optional] +**tag_name** | **String** | | +**target** | Option<**String**> | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/crates/gitea_raw_client/docs/CreateTeamOption.md b/crates/gitea_raw_client/docs/CreateTeamOption.md new file mode 100644 index 0000000..eb36765 --- /dev/null +++ b/crates/gitea_raw_client/docs/CreateTeamOption.md @@ -0,0 +1,17 @@ +# CreateTeamOption + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**can_create_org_repo** | Option<**bool**> | | [optional] +**description** | Option<**String**> | | [optional] +**includes_all_repositories** | Option<**bool**> | | [optional] +**name** | **String** | | +**permission** | Option<**String**> | | [optional] +**units** | Option<**Vec**> | | [optional] +**units_map** | Option<**::std::collections::HashMap**> | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/crates/gitea_raw_client/docs/CreateUserOption.md b/crates/gitea_raw_client/docs/CreateUserOption.md new file mode 100644 index 0000000..5a11d7c --- /dev/null +++ b/crates/gitea_raw_client/docs/CreateUserOption.md @@ -0,0 +1,20 @@ +# CreateUserOption + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**email** | **String** | | +**full_name** | Option<**String**> | | [optional] +**login_name** | Option<**String**> | | [optional] +**must_change_password** | Option<**bool**> | | [optional] +**password** | **String** | | +**restricted** | Option<**bool**> | | [optional] +**send_notify** | Option<**bool**> | | [optional] +**source_id** | Option<**i64**> | | [optional] +**username** | **String** | | +**visibility** | Option<**String**> | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/crates/gitea_raw_client/docs/CreateWikiPageOptions.md b/crates/gitea_raw_client/docs/CreateWikiPageOptions.md new file mode 100644 index 0000000..3b90c8d --- /dev/null +++ b/crates/gitea_raw_client/docs/CreateWikiPageOptions.md @@ -0,0 +1,13 @@ +# CreateWikiPageOptions + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**content_base64** | Option<**String**> | content must be base64 encoded | [optional] +**message** | Option<**String**> | optional commit message summarizing the change | [optional] +**title** | Option<**String**> | page title. leave empty to keep unchanged | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/crates/gitea_raw_client/docs/Cron.md b/crates/gitea_raw_client/docs/Cron.md new file mode 100644 index 0000000..5fc02c3 --- /dev/null +++ b/crates/gitea_raw_client/docs/Cron.md @@ -0,0 +1,15 @@ +# Cron + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**exec_times** | Option<**i64**> | | [optional] +**name** | Option<**String**> | | [optional] +**next** | Option<**String**> | | [optional] +**prev** | Option<**String**> | | [optional] +**schedule** | Option<**String**> | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/crates/gitea_raw_client/docs/DeleteEmailOption.md b/crates/gitea_raw_client/docs/DeleteEmailOption.md new file mode 100644 index 0000000..0c15e6e --- /dev/null +++ b/crates/gitea_raw_client/docs/DeleteEmailOption.md @@ -0,0 +1,11 @@ +# DeleteEmailOption + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**emails** | Option<**Vec**> | email addresses to delete | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/crates/gitea_raw_client/docs/DeleteFileOptions.md b/crates/gitea_raw_client/docs/DeleteFileOptions.md new file mode 100644 index 0000000..53fd507 --- /dev/null +++ b/crates/gitea_raw_client/docs/DeleteFileOptions.md @@ -0,0 +1,18 @@ +# DeleteFileOptions + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**author** | Option<[**crate::models::Identity**](Identity.md)> | | [optional] +**branch** | Option<**String**> | branch (optional) to base this file from. if not given, the default branch is used | [optional] +**committer** | Option<[**crate::models::Identity**](Identity.md)> | | [optional] +**dates** | Option<[**crate::models::CommitDateOptions**](CommitDateOptions.md)> | | [optional] +**message** | Option<**String**> | message (optional) for the commit of this file. if not supplied, a default message will be used | [optional] +**new_branch** | Option<**String**> | new_branch (optional) will make a new branch from `branch` before creating the file | [optional] +**sha** | **String** | sha is the SHA for the file that already exists | +**signoff** | Option<**bool**> | Add a Signed-off-by trailer by the committer at the end of the commit log message. | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/crates/gitea_raw_client/docs/DeployKey.md b/crates/gitea_raw_client/docs/DeployKey.md new file mode 100644 index 0000000..bf35835 --- /dev/null +++ b/crates/gitea_raw_client/docs/DeployKey.md @@ -0,0 +1,19 @@ +# DeployKey + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**created_at** | Option<**String**> | | [optional] +**fingerprint** | Option<**String**> | | [optional] +**id** | Option<**i64**> | | [optional] +**key** | Option<**String**> | | [optional] +**key_id** | Option<**i64**> | | [optional] +**read_only** | Option<**bool**> | | [optional] +**repository** | Option<[**crate::models::Repository**](Repository.md)> | | [optional] +**title** | Option<**String**> | | [optional] +**url** | Option<**String**> | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/crates/gitea_raw_client/docs/DismissPullReviewOptions.md b/crates/gitea_raw_client/docs/DismissPullReviewOptions.md new file mode 100644 index 0000000..58cbdb7 --- /dev/null +++ b/crates/gitea_raw_client/docs/DismissPullReviewOptions.md @@ -0,0 +1,12 @@ +# DismissPullReviewOptions + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**message** | Option<**String**> | | [optional] +**priors** | Option<**bool**> | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/crates/gitea_raw_client/docs/EditAttachmentOptions.md b/crates/gitea_raw_client/docs/EditAttachmentOptions.md new file mode 100644 index 0000000..7d1d0ad --- /dev/null +++ b/crates/gitea_raw_client/docs/EditAttachmentOptions.md @@ -0,0 +1,11 @@ +# EditAttachmentOptions + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**name** | Option<**String**> | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/crates/gitea_raw_client/docs/EditBranchProtectionOption.md b/crates/gitea_raw_client/docs/EditBranchProtectionOption.md new file mode 100644 index 0000000..04e1d18 --- /dev/null +++ b/crates/gitea_raw_client/docs/EditBranchProtectionOption.md @@ -0,0 +1,31 @@ +# EditBranchProtectionOption + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**approvals_whitelist_teams** | Option<**Vec**> | | [optional] +**approvals_whitelist_username** | Option<**Vec**> | | [optional] +**block_on_official_review_requests** | Option<**bool**> | | [optional] +**block_on_outdated_branch** | Option<**bool**> | | [optional] +**block_on_rejected_reviews** | Option<**bool**> | | [optional] +**dismiss_stale_approvals** | Option<**bool**> | | [optional] +**enable_approvals_whitelist** | Option<**bool**> | | [optional] +**enable_merge_whitelist** | Option<**bool**> | | [optional] +**enable_push** | Option<**bool**> | | [optional] +**enable_push_whitelist** | Option<**bool**> | | [optional] +**enable_status_check** | Option<**bool**> | | [optional] +**merge_whitelist_teams** | Option<**Vec**> | | [optional] +**merge_whitelist_usernames** | Option<**Vec**> | | [optional] +**protected_file_patterns** | Option<**String**> | | [optional] +**push_whitelist_deploy_keys** | Option<**bool**> | | [optional] +**push_whitelist_teams** | Option<**Vec**> | | [optional] +**push_whitelist_usernames** | Option<**Vec**> | | [optional] +**require_signed_commits** | Option<**bool**> | | [optional] +**required_approvals** | Option<**i64**> | | [optional] +**status_check_contexts** | Option<**Vec**> | | [optional] +**unprotected_file_patterns** | Option<**String**> | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/crates/gitea_raw_client/docs/EditDeadlineOption.md b/crates/gitea_raw_client/docs/EditDeadlineOption.md new file mode 100644 index 0000000..2924880 --- /dev/null +++ b/crates/gitea_raw_client/docs/EditDeadlineOption.md @@ -0,0 +1,11 @@ +# EditDeadlineOption + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**due_date** | **String** | | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/crates/gitea_raw_client/docs/EditGitHookOption.md b/crates/gitea_raw_client/docs/EditGitHookOption.md new file mode 100644 index 0000000..01bd2a8 --- /dev/null +++ b/crates/gitea_raw_client/docs/EditGitHookOption.md @@ -0,0 +1,11 @@ +# EditGitHookOption + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**content** | Option<**String**> | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/crates/gitea_raw_client/docs/EditHookOption.md b/crates/gitea_raw_client/docs/EditHookOption.md new file mode 100644 index 0000000..28fb0af --- /dev/null +++ b/crates/gitea_raw_client/docs/EditHookOption.md @@ -0,0 +1,14 @@ +# EditHookOption + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**active** | Option<**bool**> | | [optional] +**branch_filter** | Option<**String**> | | [optional] +**config** | Option<**::std::collections::HashMap**> | | [optional] +**events** | Option<**Vec**> | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/crates/gitea_raw_client/docs/EditIssueCommentOption.md b/crates/gitea_raw_client/docs/EditIssueCommentOption.md new file mode 100644 index 0000000..177e842 --- /dev/null +++ b/crates/gitea_raw_client/docs/EditIssueCommentOption.md @@ -0,0 +1,11 @@ +# EditIssueCommentOption + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**body** | **String** | | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/crates/gitea_raw_client/docs/EditIssueOption.md b/crates/gitea_raw_client/docs/EditIssueOption.md new file mode 100644 index 0000000..b222c0e --- /dev/null +++ b/crates/gitea_raw_client/docs/EditIssueOption.md @@ -0,0 +1,19 @@ +# EditIssueOption + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**assignee** | Option<**String**> | deprecated | [optional] +**assignees** | Option<**Vec**> | | [optional] +**body** | Option<**String**> | | [optional] +**due_date** | Option<**String**> | | [optional] +**milestone** | Option<**i64**> | | [optional] +**r#ref** | Option<**String**> | | [optional] +**state** | Option<**String**> | | [optional] +**title** | Option<**String**> | | [optional] +**unset_due_date** | Option<**bool**> | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/crates/gitea_raw_client/docs/EditLabelOption.md b/crates/gitea_raw_client/docs/EditLabelOption.md new file mode 100644 index 0000000..4dbe6b8 --- /dev/null +++ b/crates/gitea_raw_client/docs/EditLabelOption.md @@ -0,0 +1,13 @@ +# EditLabelOption + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**color** | Option<**String**> | | [optional] +**description** | Option<**String**> | | [optional] +**name** | Option<**String**> | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/crates/gitea_raw_client/docs/EditMilestoneOption.md b/crates/gitea_raw_client/docs/EditMilestoneOption.md new file mode 100644 index 0000000..e266c1c --- /dev/null +++ b/crates/gitea_raw_client/docs/EditMilestoneOption.md @@ -0,0 +1,14 @@ +# EditMilestoneOption + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**description** | Option<**String**> | | [optional] +**due_on** | Option<**String**> | | [optional] +**state** | Option<**String**> | | [optional] +**title** | Option<**String**> | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/crates/gitea_raw_client/docs/EditOrgOption.md b/crates/gitea_raw_client/docs/EditOrgOption.md new file mode 100644 index 0000000..4a1a9f1 --- /dev/null +++ b/crates/gitea_raw_client/docs/EditOrgOption.md @@ -0,0 +1,16 @@ +# EditOrgOption + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**description** | Option<**String**> | | [optional] +**full_name** | Option<**String**> | | [optional] +**location** | Option<**String**> | | [optional] +**repo_admin_change_team_access** | Option<**bool**> | | [optional] +**visibility** | Option<**String**> | possible values are `public`, `limited` or `private` | [optional] +**website** | Option<**String**> | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/crates/gitea_raw_client/docs/EditPullRequestOption.md b/crates/gitea_raw_client/docs/EditPullRequestOption.md new file mode 100644 index 0000000..fe31231 --- /dev/null +++ b/crates/gitea_raw_client/docs/EditPullRequestOption.md @@ -0,0 +1,21 @@ +# EditPullRequestOption + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**allow_maintainer_edit** | Option<**bool**> | | [optional] +**assignee** | Option<**String**> | | [optional] +**assignees** | Option<**Vec**> | | [optional] +**base** | Option<**String**> | | [optional] +**body** | Option<**String**> | | [optional] +**due_date** | Option<**String**> | | [optional] +**labels** | Option<**Vec**> | | [optional] +**milestone** | Option<**i64**> | | [optional] +**state** | Option<**String**> | | [optional] +**title** | Option<**String**> | | [optional] +**unset_due_date** | Option<**bool**> | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/crates/gitea_raw_client/docs/EditReactionOption.md b/crates/gitea_raw_client/docs/EditReactionOption.md new file mode 100644 index 0000000..6f01410 --- /dev/null +++ b/crates/gitea_raw_client/docs/EditReactionOption.md @@ -0,0 +1,11 @@ +# EditReactionOption + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**content** | Option<**String**> | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/crates/gitea_raw_client/docs/EditReleaseOption.md b/crates/gitea_raw_client/docs/EditReleaseOption.md new file mode 100644 index 0000000..308e111 --- /dev/null +++ b/crates/gitea_raw_client/docs/EditReleaseOption.md @@ -0,0 +1,16 @@ +# EditReleaseOption + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**body** | Option<**String**> | | [optional] +**draft** | Option<**bool**> | | [optional] +**name** | Option<**String**> | | [optional] +**prerelease** | Option<**bool**> | | [optional] +**tag_name** | Option<**String**> | | [optional] +**target_commitish** | Option<**String**> | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/crates/gitea_raw_client/docs/EditRepoOption.md b/crates/gitea_raw_client/docs/EditRepoOption.md new file mode 100644 index 0000000..3a8c215 --- /dev/null +++ b/crates/gitea_raw_client/docs/EditRepoOption.md @@ -0,0 +1,36 @@ +# EditRepoOption + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**allow_manual_merge** | Option<**bool**> | either `true` to allow mark pr as merged manually, or `false` to prevent it. `has_pull_requests` must be `true`. | [optional] +**allow_merge_commits** | Option<**bool**> | either `true` to allow merging pull requests with a merge commit, or `false` to prevent merging pull requests with merge commits. `has_pull_requests` must be `true`. | [optional] +**allow_rebase** | Option<**bool**> | either `true` to allow rebase-merging pull requests, or `false` to prevent rebase-merging. `has_pull_requests` must be `true`. | [optional] +**allow_rebase_explicit** | Option<**bool**> | either `true` to allow rebase with explicit merge commits (--no-ff), or `false` to prevent rebase with explicit merge commits. `has_pull_requests` must be `true`. | [optional] +**allow_rebase_update** | Option<**bool**> | either `true` to allow updating pull request branch by rebase, or `false` to prevent it. `has_pull_requests` must be `true`. | [optional] +**allow_squash_merge** | Option<**bool**> | either `true` to allow squash-merging pull requests, or `false` to prevent squash-merging. `has_pull_requests` must be `true`. | [optional] +**archived** | Option<**bool**> | set to `true` to archive this repository. | [optional] +**autodetect_manual_merge** | Option<**bool**> | either `true` to enable AutodetectManualMerge, or `false` to prevent it. `has_pull_requests` must be `true`, Note: In some special cases, misjudgments can occur. | [optional] +**default_branch** | Option<**String**> | sets the default branch for this repository. | [optional] +**default_delete_branch_after_merge** | Option<**bool**> | set to `true` to delete pr branch after merge by default | [optional] +**default_merge_style** | Option<**String**> | set to a merge style to be used by this repository: \"merge\", \"rebase\", \"rebase-merge\", or \"squash\". `has_pull_requests` must be `true`. | [optional] +**description** | Option<**String**> | a short description of the repository. | [optional] +**enable_prune** | Option<**bool**> | enable prune - remove obsolete remote-tracking references | [optional] +**external_tracker** | Option<[**crate::models::ExternalTracker**](ExternalTracker.md)> | | [optional] +**external_wiki** | Option<[**crate::models::ExternalWiki**](ExternalWiki.md)> | | [optional] +**has_issues** | Option<**bool**> | either `true` to enable issues for this repository or `false` to disable them. | [optional] +**has_projects** | Option<**bool**> | either `true` to enable project unit, or `false` to disable them. | [optional] +**has_pull_requests** | Option<**bool**> | either `true` to allow pull requests, or `false` to prevent pull request. | [optional] +**has_wiki** | Option<**bool**> | either `true` to enable the wiki for this repository or `false` to disable it. | [optional] +**ignore_whitespace_conflicts** | Option<**bool**> | either `true` to ignore whitespace for conflicts, or `false` to not ignore whitespace. `has_pull_requests` must be `true`. | [optional] +**internal_tracker** | Option<[**crate::models::InternalTracker**](InternalTracker.md)> | | [optional] +**mirror_interval** | Option<**String**> | set to a string like `8h30m0s` to set the mirror interval time | [optional] +**name** | Option<**String**> | name of the repository | [optional] +**private** | Option<**bool**> | either `true` to make the repository private or `false` to make it public. Note: you will get a 422 error if the organization restricts changing repository visibility to organization owners and a non-owner tries to change the value of private. | [optional] +**template** | Option<**bool**> | either `true` to make this repository a template or `false` to make it a normal repository | [optional] +**website** | Option<**String**> | a URL with more information about the repository. | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/crates/gitea_raw_client/docs/EditTeamOption.md b/crates/gitea_raw_client/docs/EditTeamOption.md new file mode 100644 index 0000000..53067f8 --- /dev/null +++ b/crates/gitea_raw_client/docs/EditTeamOption.md @@ -0,0 +1,17 @@ +# EditTeamOption + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**can_create_org_repo** | Option<**bool**> | | [optional] +**description** | Option<**String**> | | [optional] +**includes_all_repositories** | Option<**bool**> | | [optional] +**name** | **String** | | +**permission** | Option<**String**> | | [optional] +**units** | Option<**Vec**> | | [optional] +**units_map** | Option<**::std::collections::HashMap**> | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/crates/gitea_raw_client/docs/EditUserOption.md b/crates/gitea_raw_client/docs/EditUserOption.md new file mode 100644 index 0000000..0d6bf67 --- /dev/null +++ b/crates/gitea_raw_client/docs/EditUserOption.md @@ -0,0 +1,28 @@ +# EditUserOption + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**active** | Option<**bool**> | | [optional] +**admin** | Option<**bool**> | | [optional] +**allow_create_organization** | Option<**bool**> | | [optional] +**allow_git_hook** | Option<**bool**> | | [optional] +**allow_import_local** | Option<**bool**> | | [optional] +**description** | Option<**String**> | | [optional] +**email** | Option<**String**> | | [optional] +**full_name** | Option<**String**> | | [optional] +**location** | Option<**String**> | | [optional] +**login_name** | **String** | | +**max_repo_creation** | Option<**i64**> | | [optional] +**must_change_password** | Option<**bool**> | | [optional] +**password** | Option<**String**> | | [optional] +**prohibit_login** | Option<**bool**> | | [optional] +**restricted** | Option<**bool**> | | [optional] +**source_id** | **i64** | | +**visibility** | Option<**String**> | | [optional] +**website** | Option<**String**> | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/crates/gitea_raw_client/docs/Email.md b/crates/gitea_raw_client/docs/Email.md new file mode 100644 index 0000000..f2bdece --- /dev/null +++ b/crates/gitea_raw_client/docs/Email.md @@ -0,0 +1,13 @@ +# Email + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**email** | Option<**String**> | | [optional] +**primary** | Option<**bool**> | | [optional] +**verified** | Option<**bool**> | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/crates/gitea_raw_client/docs/ExternalTracker.md b/crates/gitea_raw_client/docs/ExternalTracker.md new file mode 100644 index 0000000..4ef8e08 --- /dev/null +++ b/crates/gitea_raw_client/docs/ExternalTracker.md @@ -0,0 +1,13 @@ +# ExternalTracker + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**external_tracker_format** | Option<**String**> | External Issue Tracker URL Format. Use the placeholders {user}, {repo} and {index} for the username, repository name and issue index. | [optional] +**external_tracker_style** | Option<**String**> | External Issue Tracker Number Format, either `numeric` or `alphanumeric` | [optional] +**external_tracker_url** | Option<**String**> | URL of external issue tracker. | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/crates/gitea_raw_client/docs/ExternalWiki.md b/crates/gitea_raw_client/docs/ExternalWiki.md new file mode 100644 index 0000000..73c0abd --- /dev/null +++ b/crates/gitea_raw_client/docs/ExternalWiki.md @@ -0,0 +1,11 @@ +# ExternalWiki + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**external_wiki_url** | Option<**String**> | URL of external wiki. | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/crates/gitea_raw_client/docs/FileCommitResponse.md b/crates/gitea_raw_client/docs/FileCommitResponse.md new file mode 100644 index 0000000..7b5473f --- /dev/null +++ b/crates/gitea_raw_client/docs/FileCommitResponse.md @@ -0,0 +1,19 @@ +# FileCommitResponse + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**author** | Option<[**crate::models::CommitUser**](CommitUser.md)> | | [optional] +**committer** | Option<[**crate::models::CommitUser**](CommitUser.md)> | | [optional] +**created** | Option<**String**> | | [optional] +**html_url** | Option<**String**> | | [optional] +**message** | Option<**String**> | | [optional] +**parents** | Option<[**Vec**](CommitMeta.md)> | | [optional] +**sha** | Option<**String**> | | [optional] +**tree** | Option<[**crate::models::CommitMeta**](CommitMeta.md)> | | [optional] +**url** | Option<**String**> | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/crates/gitea_raw_client/docs/FileDeleteResponse.md b/crates/gitea_raw_client/docs/FileDeleteResponse.md new file mode 100644 index 0000000..6ae2198 --- /dev/null +++ b/crates/gitea_raw_client/docs/FileDeleteResponse.md @@ -0,0 +1,13 @@ +# FileDeleteResponse + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**commit** | Option<[**crate::models::FileCommitResponse**](FileCommitResponse.md)> | | [optional] +**content** | Option<[**serde_json::Value**](.md)> | | [optional] +**verification** | Option<[**crate::models::PayloadCommitVerification**](PayloadCommitVerification.md)> | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/crates/gitea_raw_client/docs/FileLinksResponse.md b/crates/gitea_raw_client/docs/FileLinksResponse.md new file mode 100644 index 0000000..c6f1372 --- /dev/null +++ b/crates/gitea_raw_client/docs/FileLinksResponse.md @@ -0,0 +1,13 @@ +# FileLinksResponse + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**git** | Option<**String**> | | [optional] +**html** | Option<**String**> | | [optional] +**param_self** | Option<**String**> | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/crates/gitea_raw_client/docs/FileResponse.md b/crates/gitea_raw_client/docs/FileResponse.md new file mode 100644 index 0000000..6f58d35 --- /dev/null +++ b/crates/gitea_raw_client/docs/FileResponse.md @@ -0,0 +1,13 @@ +# FileResponse + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**commit** | Option<[**crate::models::FileCommitResponse**](FileCommitResponse.md)> | | [optional] +**content** | Option<[**crate::models::ContentsResponse**](ContentsResponse.md)> | | [optional] +**verification** | Option<[**crate::models::PayloadCommitVerification**](PayloadCommitVerification.md)> | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/crates/gitea_raw_client/docs/GeneralApiSettings.md b/crates/gitea_raw_client/docs/GeneralApiSettings.md new file mode 100644 index 0000000..70a12c7 --- /dev/null +++ b/crates/gitea_raw_client/docs/GeneralApiSettings.md @@ -0,0 +1,14 @@ +# GeneralApiSettings + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**default_git_trees_per_page** | Option<**i64**> | | [optional] +**default_max_blob_size** | Option<**i64**> | | [optional] +**default_paging_num** | Option<**i64**> | | [optional] +**max_response_items** | Option<**i64**> | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/crates/gitea_raw_client/docs/GeneralAttachmentSettings.md b/crates/gitea_raw_client/docs/GeneralAttachmentSettings.md new file mode 100644 index 0000000..3597dc2 --- /dev/null +++ b/crates/gitea_raw_client/docs/GeneralAttachmentSettings.md @@ -0,0 +1,14 @@ +# GeneralAttachmentSettings + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**allowed_types** | Option<**String**> | | [optional] +**enabled** | Option<**bool**> | | [optional] +**max_files** | Option<**i64**> | | [optional] +**max_size** | Option<**i64**> | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/crates/gitea_raw_client/docs/GeneralRepoSettings.md b/crates/gitea_raw_client/docs/GeneralRepoSettings.md new file mode 100644 index 0000000..394608c --- /dev/null +++ b/crates/gitea_raw_client/docs/GeneralRepoSettings.md @@ -0,0 +1,16 @@ +# GeneralRepoSettings + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**http_git_disabled** | Option<**bool**> | | [optional] +**lfs_disabled** | Option<**bool**> | | [optional] +**migrations_disabled** | Option<**bool**> | | [optional] +**mirrors_disabled** | Option<**bool**> | | [optional] +**stars_disabled** | Option<**bool**> | | [optional] +**time_tracking_disabled** | Option<**bool**> | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/crates/gitea_raw_client/docs/GeneralUiSettings.md b/crates/gitea_raw_client/docs/GeneralUiSettings.md new file mode 100644 index 0000000..bdec13d --- /dev/null +++ b/crates/gitea_raw_client/docs/GeneralUiSettings.md @@ -0,0 +1,13 @@ +# GeneralUiSettings + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**allowed_reactions** | Option<**Vec**> | | [optional] +**custom_emojis** | Option<**Vec**> | | [optional] +**default_theme** | Option<**String**> | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/crates/gitea_raw_client/docs/GenerateRepoOption.md b/crates/gitea_raw_client/docs/GenerateRepoOption.md new file mode 100644 index 0000000..4cbac42 --- /dev/null +++ b/crates/gitea_raw_client/docs/GenerateRepoOption.md @@ -0,0 +1,21 @@ +# GenerateRepoOption + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**avatar** | Option<**bool**> | include avatar of the template repo | [optional] +**default_branch** | Option<**String**> | Default branch of the new repository | [optional] +**description** | Option<**String**> | Description of the repository to create | [optional] +**git_content** | Option<**bool**> | include git content of default branch in template repo | [optional] +**git_hooks** | Option<**bool**> | include git hooks in template repo | [optional] +**labels** | Option<**bool**> | include labels in template repo | [optional] +**name** | **String** | Name of the repository to create | +**owner** | **String** | The organization or person who will own the new repository | +**private** | Option<**bool**> | Whether the repository is private | [optional] +**topics** | Option<**bool**> | include topics in template repo | [optional] +**webhooks** | Option<**bool**> | include webhooks in template repo | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/crates/gitea_raw_client/docs/GitBlobResponse.md b/crates/gitea_raw_client/docs/GitBlobResponse.md new file mode 100644 index 0000000..ff50f38 --- /dev/null +++ b/crates/gitea_raw_client/docs/GitBlobResponse.md @@ -0,0 +1,15 @@ +# GitBlobResponse + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**content** | Option<**String**> | | [optional] +**encoding** | Option<**String**> | | [optional] +**sha** | Option<**String**> | | [optional] +**size** | Option<**i64**> | | [optional] +**url** | Option<**String**> | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/crates/gitea_raw_client/docs/GitEntry.md b/crates/gitea_raw_client/docs/GitEntry.md new file mode 100644 index 0000000..c0acd13 --- /dev/null +++ b/crates/gitea_raw_client/docs/GitEntry.md @@ -0,0 +1,16 @@ +# GitEntry + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**mode** | Option<**String**> | | [optional] +**path** | Option<**String**> | | [optional] +**sha** | Option<**String**> | | [optional] +**size** | Option<**i64**> | | [optional] +**r#type** | Option<**String**> | | [optional] +**url** | Option<**String**> | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/crates/gitea_raw_client/docs/GitHook.md b/crates/gitea_raw_client/docs/GitHook.md new file mode 100644 index 0000000..9d52a95 --- /dev/null +++ b/crates/gitea_raw_client/docs/GitHook.md @@ -0,0 +1,13 @@ +# GitHook + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**content** | Option<**String**> | | [optional] +**is_active** | Option<**bool**> | | [optional] +**name** | Option<**String**> | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/crates/gitea_raw_client/docs/GitObject.md b/crates/gitea_raw_client/docs/GitObject.md new file mode 100644 index 0000000..4ed7c79 --- /dev/null +++ b/crates/gitea_raw_client/docs/GitObject.md @@ -0,0 +1,13 @@ +# GitObject + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**sha** | Option<**String**> | | [optional] +**r#type** | Option<**String**> | | [optional] +**url** | Option<**String**> | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/crates/gitea_raw_client/docs/GitTreeResponse.md b/crates/gitea_raw_client/docs/GitTreeResponse.md new file mode 100644 index 0000000..4c82325 --- /dev/null +++ b/crates/gitea_raw_client/docs/GitTreeResponse.md @@ -0,0 +1,16 @@ +# GitTreeResponse + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**page** | Option<**i64**> | | [optional] +**sha** | Option<**String**> | | [optional] +**total_count** | Option<**i64**> | | [optional] +**tree** | Option<[**Vec**](GitEntry.md)> | | [optional] +**truncated** | Option<**bool**> | | [optional] +**url** | Option<**String**> | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/crates/gitea_raw_client/docs/GpgKey.md b/crates/gitea_raw_client/docs/GpgKey.md new file mode 100644 index 0000000..d7622a8 --- /dev/null +++ b/crates/gitea_raw_client/docs/GpgKey.md @@ -0,0 +1,23 @@ +# GpgKey + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**can_certify** | Option<**bool**> | | [optional] +**can_encrypt_comms** | Option<**bool**> | | [optional] +**can_encrypt_storage** | Option<**bool**> | | [optional] +**can_sign** | Option<**bool**> | | [optional] +**created_at** | Option<**String**> | | [optional] +**emails** | Option<[**Vec**](GPGKeyEmail.md)> | | [optional] +**expires_at** | Option<**String**> | | [optional] +**id** | Option<**i64**> | | [optional] +**key_id** | Option<**String**> | | [optional] +**primary_key_id** | Option<**String**> | | [optional] +**public_key** | Option<**String**> | | [optional] +**subkeys** | Option<[**Vec**](GPGKey.md)> | | [optional] +**verified** | Option<**bool**> | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/crates/gitea_raw_client/docs/GpgKeyEmail.md b/crates/gitea_raw_client/docs/GpgKeyEmail.md new file mode 100644 index 0000000..191cd58 --- /dev/null +++ b/crates/gitea_raw_client/docs/GpgKeyEmail.md @@ -0,0 +1,12 @@ +# GpgKeyEmail + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**email** | Option<**String**> | | [optional] +**verified** | Option<**bool**> | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/crates/gitea_raw_client/docs/Hook.md b/crates/gitea_raw_client/docs/Hook.md new file mode 100644 index 0000000..6ace996 --- /dev/null +++ b/crates/gitea_raw_client/docs/Hook.md @@ -0,0 +1,17 @@ +# Hook + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**active** | Option<**bool**> | | [optional] +**config** | Option<**::std::collections::HashMap**> | | [optional] +**created_at** | Option<**String**> | | [optional] +**events** | Option<**Vec**> | | [optional] +**id** | Option<**i64**> | | [optional] +**r#type** | Option<**String**> | | [optional] +**updated_at** | Option<**String**> | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/crates/gitea_raw_client/docs/Identity.md b/crates/gitea_raw_client/docs/Identity.md new file mode 100644 index 0000000..3f1e0a2 --- /dev/null +++ b/crates/gitea_raw_client/docs/Identity.md @@ -0,0 +1,12 @@ +# Identity + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**email** | Option<**String**> | | [optional] +**name** | Option<**String**> | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/crates/gitea_raw_client/docs/InternalTracker.md b/crates/gitea_raw_client/docs/InternalTracker.md new file mode 100644 index 0000000..6daf626 --- /dev/null +++ b/crates/gitea_raw_client/docs/InternalTracker.md @@ -0,0 +1,13 @@ +# InternalTracker + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**allow_only_contributors_to_track_time** | Option<**bool**> | Let only contributors track time (Built-in issue tracker) | [optional] +**enable_issue_dependencies** | Option<**bool**> | Enable dependencies for issues and pull requests (Built-in issue tracker) | [optional] +**enable_time_tracker** | Option<**bool**> | Enable time tracking (Built-in issue tracker) | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/crates/gitea_raw_client/docs/Issue.md b/crates/gitea_raw_client/docs/Issue.md new file mode 100644 index 0000000..e884e39 --- /dev/null +++ b/crates/gitea_raw_client/docs/Issue.md @@ -0,0 +1,33 @@ +# Issue + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**assignee** | Option<[**crate::models::User**](User.md)> | | [optional] +**assignees** | Option<[**Vec**](User.md)> | | [optional] +**body** | Option<**String**> | | [optional] +**closed_at** | Option<**String**> | | [optional] +**comments** | Option<**i64**> | | [optional] +**created_at** | Option<**String**> | | [optional] +**due_date** | Option<**String**> | | [optional] +**html_url** | Option<**String**> | | [optional] +**id** | Option<**i64**> | | [optional] +**is_locked** | Option<**bool**> | | [optional] +**labels** | Option<[**Vec**](Label.md)> | | [optional] +**milestone** | Option<[**crate::models::Milestone**](Milestone.md)> | | [optional] +**number** | Option<**i64**> | | [optional] +**original_author** | Option<**String**> | | [optional] +**original_author_id** | Option<**i64**> | | [optional] +**pull_request** | Option<[**crate::models::PullRequestMeta**](PullRequestMeta.md)> | | [optional] +**r#ref** | Option<**String**> | | [optional] +**repository** | Option<[**crate::models::RepositoryMeta**](RepositoryMeta.md)> | | [optional] +**state** | Option<**String**> | StateType issue state type | [optional] +**title** | Option<**String**> | | [optional] +**updated_at** | Option<**String**> | | [optional] +**url** | Option<**String**> | | [optional] +**user** | Option<[**crate::models::User**](User.md)> | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/crates/gitea_raw_client/docs/IssueApi.md b/crates/gitea_raw_client/docs/IssueApi.md new file mode 100644 index 0000000..a882d7f --- /dev/null +++ b/crates/gitea_raw_client/docs/IssueApi.md @@ -0,0 +1,1562 @@ +# \IssueApi + +All URIs are relative to */api/v1* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**issue_add_label**](IssueApi.md#issue_add_label) | **POST** /repos/{owner}/{repo}/issues/{index}/labels | Add a label to an issue +[**issue_add_subscription**](IssueApi.md#issue_add_subscription) | **PUT** /repos/{owner}/{repo}/issues/{index}/subscriptions/{user} | Subscribe user to issue +[**issue_add_time**](IssueApi.md#issue_add_time) | **POST** /repos/{owner}/{repo}/issues/{index}/times | Add tracked time to a issue +[**issue_check_subscription**](IssueApi.md#issue_check_subscription) | **GET** /repos/{owner}/{repo}/issues/{index}/subscriptions/check | Check if user is subscribed to an issue +[**issue_clear_labels**](IssueApi.md#issue_clear_labels) | **DELETE** /repos/{owner}/{repo}/issues/{index}/labels | Remove all labels from an issue +[**issue_create_comment**](IssueApi.md#issue_create_comment) | **POST** /repos/{owner}/{repo}/issues/{index}/comments | Add a comment to an issue +[**issue_create_issue**](IssueApi.md#issue_create_issue) | **POST** /repos/{owner}/{repo}/issues | Create an issue. If using deadline only the date will be taken into account, and time of day ignored. +[**issue_create_label**](IssueApi.md#issue_create_label) | **POST** /repos/{owner}/{repo}/labels | Create a label +[**issue_create_milestone**](IssueApi.md#issue_create_milestone) | **POST** /repos/{owner}/{repo}/milestones | Create a milestone +[**issue_delete**](IssueApi.md#issue_delete) | **DELETE** /repos/{owner}/{repo}/issues/{index} | Delete an issue +[**issue_delete_comment**](IssueApi.md#issue_delete_comment) | **DELETE** /repos/{owner}/{repo}/issues/comments/{id} | Delete a comment +[**issue_delete_comment_deprecated**](IssueApi.md#issue_delete_comment_deprecated) | **DELETE** /repos/{owner}/{repo}/issues/{index}/comments/{id} | Delete a comment +[**issue_delete_comment_reaction**](IssueApi.md#issue_delete_comment_reaction) | **DELETE** /repos/{owner}/{repo}/issues/comments/{id}/reactions | Remove a reaction from a comment of an issue +[**issue_delete_issue_reaction**](IssueApi.md#issue_delete_issue_reaction) | **DELETE** /repos/{owner}/{repo}/issues/{index}/reactions | Remove a reaction from an issue +[**issue_delete_label**](IssueApi.md#issue_delete_label) | **DELETE** /repos/{owner}/{repo}/labels/{id} | Delete a label +[**issue_delete_milestone**](IssueApi.md#issue_delete_milestone) | **DELETE** /repos/{owner}/{repo}/milestones/{id} | Delete a milestone +[**issue_delete_stop_watch**](IssueApi.md#issue_delete_stop_watch) | **DELETE** /repos/{owner}/{repo}/issues/{index}/stopwatch/delete | Delete an issue's existing stopwatch. +[**issue_delete_subscription**](IssueApi.md#issue_delete_subscription) | **DELETE** /repos/{owner}/{repo}/issues/{index}/subscriptions/{user} | Unsubscribe user from issue +[**issue_delete_time**](IssueApi.md#issue_delete_time) | **DELETE** /repos/{owner}/{repo}/issues/{index}/times/{id} | Delete specific tracked time +[**issue_edit_comment**](IssueApi.md#issue_edit_comment) | **PATCH** /repos/{owner}/{repo}/issues/comments/{id} | Edit a comment +[**issue_edit_comment_deprecated**](IssueApi.md#issue_edit_comment_deprecated) | **PATCH** /repos/{owner}/{repo}/issues/{index}/comments/{id} | Edit a comment +[**issue_edit_issue**](IssueApi.md#issue_edit_issue) | **PATCH** /repos/{owner}/{repo}/issues/{index} | Edit an issue. If using deadline only the date will be taken into account, and time of day ignored. +[**issue_edit_issue_deadline**](IssueApi.md#issue_edit_issue_deadline) | **POST** /repos/{owner}/{repo}/issues/{index}/deadline | Set an issue deadline. If set to null, the deadline is deleted. If using deadline only the date will be taken into account, and time of day ignored. +[**issue_edit_label**](IssueApi.md#issue_edit_label) | **PATCH** /repos/{owner}/{repo}/labels/{id} | Update a label +[**issue_edit_milestone**](IssueApi.md#issue_edit_milestone) | **PATCH** /repos/{owner}/{repo}/milestones/{id} | Update a milestone +[**issue_get_comment**](IssueApi.md#issue_get_comment) | **GET** /repos/{owner}/{repo}/issues/comments/{id} | Get a comment +[**issue_get_comment_reactions**](IssueApi.md#issue_get_comment_reactions) | **GET** /repos/{owner}/{repo}/issues/comments/{id}/reactions | Get a list of reactions from a comment of an issue +[**issue_get_comments**](IssueApi.md#issue_get_comments) | **GET** /repos/{owner}/{repo}/issues/{index}/comments | List all comments on an issue +[**issue_get_comments_and_timeline**](IssueApi.md#issue_get_comments_and_timeline) | **GET** /repos/{owner}/{repo}/issues/{index}/timeline | List all comments and events on an issue +[**issue_get_issue**](IssueApi.md#issue_get_issue) | **GET** /repos/{owner}/{repo}/issues/{index} | Get an issue +[**issue_get_issue_reactions**](IssueApi.md#issue_get_issue_reactions) | **GET** /repos/{owner}/{repo}/issues/{index}/reactions | Get a list reactions of an issue +[**issue_get_label**](IssueApi.md#issue_get_label) | **GET** /repos/{owner}/{repo}/labels/{id} | Get a single label +[**issue_get_labels**](IssueApi.md#issue_get_labels) | **GET** /repos/{owner}/{repo}/issues/{index}/labels | Get an issue's labels +[**issue_get_milestone**](IssueApi.md#issue_get_milestone) | **GET** /repos/{owner}/{repo}/milestones/{id} | Get a milestone +[**issue_get_milestones_list**](IssueApi.md#issue_get_milestones_list) | **GET** /repos/{owner}/{repo}/milestones | Get all of a repository's opened milestones +[**issue_get_repo_comments**](IssueApi.md#issue_get_repo_comments) | **GET** /repos/{owner}/{repo}/issues/comments | List all comments in a repository +[**issue_list_issues**](IssueApi.md#issue_list_issues) | **GET** /repos/{owner}/{repo}/issues | List a repository's issues +[**issue_list_labels**](IssueApi.md#issue_list_labels) | **GET** /repos/{owner}/{repo}/labels | Get all of a repository's labels +[**issue_post_comment_reaction**](IssueApi.md#issue_post_comment_reaction) | **POST** /repos/{owner}/{repo}/issues/comments/{id}/reactions | Add a reaction to a comment of an issue +[**issue_post_issue_reaction**](IssueApi.md#issue_post_issue_reaction) | **POST** /repos/{owner}/{repo}/issues/{index}/reactions | Add a reaction to an issue +[**issue_remove_label**](IssueApi.md#issue_remove_label) | **DELETE** /repos/{owner}/{repo}/issues/{index}/labels/{id} | Remove a label from an issue +[**issue_replace_labels**](IssueApi.md#issue_replace_labels) | **PUT** /repos/{owner}/{repo}/issues/{index}/labels | Replace an issue's labels +[**issue_reset_time**](IssueApi.md#issue_reset_time) | **DELETE** /repos/{owner}/{repo}/issues/{index}/times | Reset a tracked time of an issue +[**issue_search_issues**](IssueApi.md#issue_search_issues) | **GET** /repos/issues/search | Search for issues across the repositories that the user has access to +[**issue_start_stop_watch**](IssueApi.md#issue_start_stop_watch) | **POST** /repos/{owner}/{repo}/issues/{index}/stopwatch/start | Start stopwatch on an issue. +[**issue_stop_stop_watch**](IssueApi.md#issue_stop_stop_watch) | **POST** /repos/{owner}/{repo}/issues/{index}/stopwatch/stop | Stop an issue's existing stopwatch. +[**issue_subscriptions**](IssueApi.md#issue_subscriptions) | **GET** /repos/{owner}/{repo}/issues/{index}/subscriptions | Get users who subscribed on an issue. +[**issue_tracked_times**](IssueApi.md#issue_tracked_times) | **GET** /repos/{owner}/{repo}/issues/{index}/times | List an issue's tracked times + + + +## issue_add_label + +> Vec issue_add_label(owner, repo, index, body) +Add a label to an issue + +### Parameters + + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**owner** | **String** | owner of the repo | [required] | +**repo** | **String** | name of the repo | [required] | +**index** | **i64** | index of the issue | [required] | +**body** | Option<[**IssueLabelsOption**](IssueLabelsOption.md)> | | | + +### Return type + +[**Vec**](Label.md) + +### Authorization + +[AccessToken](../README.md#AccessToken), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [BasicAuth](../README.md#BasicAuth), [SudoHeader](../README.md#SudoHeader), [SudoParam](../README.md#SudoParam), [TOTPHeader](../README.md#TOTPHeader), [Token](../README.md#Token) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +## issue_add_subscription + +> issue_add_subscription(owner, repo, index, user) +Subscribe user to issue + +### Parameters + + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**owner** | **String** | owner of the repo | [required] | +**repo** | **String** | name of the repo | [required] | +**index** | **i64** | index of the issue | [required] | +**user** | **String** | user to subscribe | [required] | + +### Return type + + (empty response body) + +### Authorization + +[AccessToken](../README.md#AccessToken), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [BasicAuth](../README.md#BasicAuth), [SudoHeader](../README.md#SudoHeader), [SudoParam](../README.md#SudoParam), [TOTPHeader](../README.md#TOTPHeader), [Token](../README.md#Token) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: Not defined + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +## issue_add_time + +> crate::models::TrackedTime issue_add_time(owner, repo, index, body) +Add tracked time to a issue + +### Parameters + + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**owner** | **String** | owner of the repo | [required] | +**repo** | **String** | name of the repo | [required] | +**index** | **i64** | index of the issue | [required] | +**body** | Option<[**AddTimeOption**](AddTimeOption.md)> | | | + +### Return type + +[**crate::models::TrackedTime**](TrackedTime.md) + +### Authorization + +[AccessToken](../README.md#AccessToken), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [BasicAuth](../README.md#BasicAuth), [SudoHeader](../README.md#SudoHeader), [SudoParam](../README.md#SudoParam), [TOTPHeader](../README.md#TOTPHeader), [Token](../README.md#Token) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +## issue_check_subscription + +> crate::models::WatchInfo issue_check_subscription(owner, repo, index) +Check if user is subscribed to an issue + +### Parameters + + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**owner** | **String** | owner of the repo | [required] | +**repo** | **String** | name of the repo | [required] | +**index** | **i64** | index of the issue | [required] | + +### Return type + +[**crate::models::WatchInfo**](WatchInfo.md) + +### Authorization + +[AccessToken](../README.md#AccessToken), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [BasicAuth](../README.md#BasicAuth), [SudoHeader](../README.md#SudoHeader), [SudoParam](../README.md#SudoParam), [TOTPHeader](../README.md#TOTPHeader), [Token](../README.md#Token) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +## issue_clear_labels + +> issue_clear_labels(owner, repo, index) +Remove all labels from an issue + +### Parameters + + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**owner** | **String** | owner of the repo | [required] | +**repo** | **String** | name of the repo | [required] | +**index** | **i64** | index of the issue | [required] | + +### Return type + + (empty response body) + +### Authorization + +[AccessToken](../README.md#AccessToken), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [BasicAuth](../README.md#BasicAuth), [SudoHeader](../README.md#SudoHeader), [SudoParam](../README.md#SudoParam), [TOTPHeader](../README.md#TOTPHeader), [Token](../README.md#Token) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: Not defined + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +## issue_create_comment + +> crate::models::Comment issue_create_comment(owner, repo, index, body) +Add a comment to an issue + +### Parameters + + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**owner** | **String** | owner of the repo | [required] | +**repo** | **String** | name of the repo | [required] | +**index** | **i64** | index of the issue | [required] | +**body** | Option<[**CreateIssueCommentOption**](CreateIssueCommentOption.md)> | | | + +### Return type + +[**crate::models::Comment**](Comment.md) + +### Authorization + +[AccessToken](../README.md#AccessToken), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [BasicAuth](../README.md#BasicAuth), [SudoHeader](../README.md#SudoHeader), [SudoParam](../README.md#SudoParam), [TOTPHeader](../README.md#TOTPHeader), [Token](../README.md#Token) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +## issue_create_issue + +> crate::models::Issue issue_create_issue(owner, repo, body) +Create an issue. If using deadline only the date will be taken into account, and time of day ignored. + +### Parameters + + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**owner** | **String** | owner of the repo | [required] | +**repo** | **String** | name of the repo | [required] | +**body** | Option<[**CreateIssueOption**](CreateIssueOption.md)> | | | + +### Return type + +[**crate::models::Issue**](Issue.md) + +### Authorization + +[AccessToken](../README.md#AccessToken), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [BasicAuth](../README.md#BasicAuth), [SudoHeader](../README.md#SudoHeader), [SudoParam](../README.md#SudoParam), [TOTPHeader](../README.md#TOTPHeader), [Token](../README.md#Token) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +## issue_create_label + +> crate::models::Label issue_create_label(owner, repo, body) +Create a label + +### Parameters + + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**owner** | **String** | owner of the repo | [required] | +**repo** | **String** | name of the repo | [required] | +**body** | Option<[**CreateLabelOption**](CreateLabelOption.md)> | | | + +### Return type + +[**crate::models::Label**](Label.md) + +### Authorization + +[AccessToken](../README.md#AccessToken), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [BasicAuth](../README.md#BasicAuth), [SudoHeader](../README.md#SudoHeader), [SudoParam](../README.md#SudoParam), [TOTPHeader](../README.md#TOTPHeader), [Token](../README.md#Token) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +## issue_create_milestone + +> crate::models::Milestone issue_create_milestone(owner, repo, body) +Create a milestone + +### Parameters + + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**owner** | **String** | owner of the repo | [required] | +**repo** | **String** | name of the repo | [required] | +**body** | Option<[**CreateMilestoneOption**](CreateMilestoneOption.md)> | | | + +### Return type + +[**crate::models::Milestone**](Milestone.md) + +### Authorization + +[AccessToken](../README.md#AccessToken), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [BasicAuth](../README.md#BasicAuth), [SudoHeader](../README.md#SudoHeader), [SudoParam](../README.md#SudoParam), [TOTPHeader](../README.md#TOTPHeader), [Token](../README.md#Token) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +## issue_delete + +> issue_delete(owner, repo, index) +Delete an issue + +### Parameters + + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**owner** | **String** | owner of the repo | [required] | +**repo** | **String** | name of the repo | [required] | +**index** | **i64** | index of issue to delete | [required] | + +### Return type + + (empty response body) + +### Authorization + +[AccessToken](../README.md#AccessToken), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [BasicAuth](../README.md#BasicAuth), [SudoHeader](../README.md#SudoHeader), [SudoParam](../README.md#SudoParam), [TOTPHeader](../README.md#TOTPHeader), [Token](../README.md#Token) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: Not defined + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +## issue_delete_comment + +> issue_delete_comment(owner, repo, id) +Delete a comment + +### Parameters + + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**owner** | **String** | owner of the repo | [required] | +**repo** | **String** | name of the repo | [required] | +**id** | **i64** | id of comment to delete | [required] | + +### Return type + + (empty response body) + +### Authorization + +[AccessToken](../README.md#AccessToken), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [BasicAuth](../README.md#BasicAuth), [SudoHeader](../README.md#SudoHeader), [SudoParam](../README.md#SudoParam), [TOTPHeader](../README.md#TOTPHeader), [Token](../README.md#Token) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: Not defined + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +## issue_delete_comment_deprecated + +> issue_delete_comment_deprecated(owner, repo, index, id) +Delete a comment + +### Parameters + + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**owner** | **String** | owner of the repo | [required] | +**repo** | **String** | name of the repo | [required] | +**index** | **i32** | this parameter is ignored | [required] | +**id** | **i64** | id of comment to delete | [required] | + +### Return type + + (empty response body) + +### Authorization + +[AccessToken](../README.md#AccessToken), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [BasicAuth](../README.md#BasicAuth), [SudoHeader](../README.md#SudoHeader), [SudoParam](../README.md#SudoParam), [TOTPHeader](../README.md#TOTPHeader), [Token](../README.md#Token) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: Not defined + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +## issue_delete_comment_reaction + +> issue_delete_comment_reaction(owner, repo, id, content) +Remove a reaction from a comment of an issue + +### Parameters + + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**owner** | **String** | owner of the repo | [required] | +**repo** | **String** | name of the repo | [required] | +**id** | **i64** | id of the comment to edit | [required] | +**content** | Option<[**EditReactionOption**](EditReactionOption.md)> | | | + +### Return type + + (empty response body) + +### Authorization + +[AccessToken](../README.md#AccessToken), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [BasicAuth](../README.md#BasicAuth), [SudoHeader](../README.md#SudoHeader), [SudoParam](../README.md#SudoParam), [TOTPHeader](../README.md#TOTPHeader), [Token](../README.md#Token) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: Not defined + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +## issue_delete_issue_reaction + +> issue_delete_issue_reaction(owner, repo, index, content) +Remove a reaction from an issue + +### Parameters + + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**owner** | **String** | owner of the repo | [required] | +**repo** | **String** | name of the repo | [required] | +**index** | **i64** | index of the issue | [required] | +**content** | Option<[**EditReactionOption**](EditReactionOption.md)> | | | + +### Return type + + (empty response body) + +### Authorization + +[AccessToken](../README.md#AccessToken), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [BasicAuth](../README.md#BasicAuth), [SudoHeader](../README.md#SudoHeader), [SudoParam](../README.md#SudoParam), [TOTPHeader](../README.md#TOTPHeader), [Token](../README.md#Token) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: Not defined + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +## issue_delete_label + +> issue_delete_label(owner, repo, id) +Delete a label + +### Parameters + + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**owner** | **String** | owner of the repo | [required] | +**repo** | **String** | name of the repo | [required] | +**id** | **i64** | id of the label to delete | [required] | + +### Return type + + (empty response body) + +### Authorization + +[AccessToken](../README.md#AccessToken), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [BasicAuth](../README.md#BasicAuth), [SudoHeader](../README.md#SudoHeader), [SudoParam](../README.md#SudoParam), [TOTPHeader](../README.md#TOTPHeader), [Token](../README.md#Token) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: Not defined + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +## issue_delete_milestone + +> issue_delete_milestone(owner, repo, id) +Delete a milestone + +### Parameters + + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**owner** | **String** | owner of the repo | [required] | +**repo** | **String** | name of the repo | [required] | +**id** | **String** | the milestone to delete, identified by ID and if not available by name | [required] | + +### Return type + + (empty response body) + +### Authorization + +[AccessToken](../README.md#AccessToken), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [BasicAuth](../README.md#BasicAuth), [SudoHeader](../README.md#SudoHeader), [SudoParam](../README.md#SudoParam), [TOTPHeader](../README.md#TOTPHeader), [Token](../README.md#Token) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: Not defined + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +## issue_delete_stop_watch + +> issue_delete_stop_watch(owner, repo, index) +Delete an issue's existing stopwatch. + +### Parameters + + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**owner** | **String** | owner of the repo | [required] | +**repo** | **String** | name of the repo | [required] | +**index** | **i64** | index of the issue to stop the stopwatch on | [required] | + +### Return type + + (empty response body) + +### Authorization + +[AccessToken](../README.md#AccessToken), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [BasicAuth](../README.md#BasicAuth), [SudoHeader](../README.md#SudoHeader), [SudoParam](../README.md#SudoParam), [TOTPHeader](../README.md#TOTPHeader), [Token](../README.md#Token) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: Not defined + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +## issue_delete_subscription + +> issue_delete_subscription(owner, repo, index, user) +Unsubscribe user from issue + +### Parameters + + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**owner** | **String** | owner of the repo | [required] | +**repo** | **String** | name of the repo | [required] | +**index** | **i64** | index of the issue | [required] | +**user** | **String** | user witch unsubscribe | [required] | + +### Return type + + (empty response body) + +### Authorization + +[AccessToken](../README.md#AccessToken), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [BasicAuth](../README.md#BasicAuth), [SudoHeader](../README.md#SudoHeader), [SudoParam](../README.md#SudoParam), [TOTPHeader](../README.md#TOTPHeader), [Token](../README.md#Token) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: Not defined + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +## issue_delete_time + +> issue_delete_time(owner, repo, index, id) +Delete specific tracked time + +### Parameters + + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**owner** | **String** | owner of the repo | [required] | +**repo** | **String** | name of the repo | [required] | +**index** | **i64** | index of the issue | [required] | +**id** | **i64** | id of time to delete | [required] | + +### Return type + + (empty response body) + +### Authorization + +[AccessToken](../README.md#AccessToken), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [BasicAuth](../README.md#BasicAuth), [SudoHeader](../README.md#SudoHeader), [SudoParam](../README.md#SudoParam), [TOTPHeader](../README.md#TOTPHeader), [Token](../README.md#Token) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: Not defined + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +## issue_edit_comment + +> crate::models::Comment issue_edit_comment(owner, repo, id, body) +Edit a comment + +### Parameters + + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**owner** | **String** | owner of the repo | [required] | +**repo** | **String** | name of the repo | [required] | +**id** | **i64** | id of the comment to edit | [required] | +**body** | Option<[**EditIssueCommentOption**](EditIssueCommentOption.md)> | | | + +### Return type + +[**crate::models::Comment**](Comment.md) + +### Authorization + +[AccessToken](../README.md#AccessToken), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [BasicAuth](../README.md#BasicAuth), [SudoHeader](../README.md#SudoHeader), [SudoParam](../README.md#SudoParam), [TOTPHeader](../README.md#TOTPHeader), [Token](../README.md#Token) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +## issue_edit_comment_deprecated + +> crate::models::Comment issue_edit_comment_deprecated(owner, repo, index, id, body) +Edit a comment + +### Parameters + + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**owner** | **String** | owner of the repo | [required] | +**repo** | **String** | name of the repo | [required] | +**index** | **i32** | this parameter is ignored | [required] | +**id** | **i64** | id of the comment to edit | [required] | +**body** | Option<[**EditIssueCommentOption**](EditIssueCommentOption.md)> | | | + +### Return type + +[**crate::models::Comment**](Comment.md) + +### Authorization + +[AccessToken](../README.md#AccessToken), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [BasicAuth](../README.md#BasicAuth), [SudoHeader](../README.md#SudoHeader), [SudoParam](../README.md#SudoParam), [TOTPHeader](../README.md#TOTPHeader), [Token](../README.md#Token) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +## issue_edit_issue + +> crate::models::Issue issue_edit_issue(owner, repo, index, body) +Edit an issue. If using deadline only the date will be taken into account, and time of day ignored. + +### Parameters + + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**owner** | **String** | owner of the repo | [required] | +**repo** | **String** | name of the repo | [required] | +**index** | **i64** | index of the issue to edit | [required] | +**body** | Option<[**EditIssueOption**](EditIssueOption.md)> | | | + +### Return type + +[**crate::models::Issue**](Issue.md) + +### Authorization + +[AccessToken](../README.md#AccessToken), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [BasicAuth](../README.md#BasicAuth), [SudoHeader](../README.md#SudoHeader), [SudoParam](../README.md#SudoParam), [TOTPHeader](../README.md#TOTPHeader), [Token](../README.md#Token) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +## issue_edit_issue_deadline + +> crate::models::IssueDeadline issue_edit_issue_deadline(owner, repo, index, body) +Set an issue deadline. If set to null, the deadline is deleted. If using deadline only the date will be taken into account, and time of day ignored. + +### Parameters + + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**owner** | **String** | owner of the repo | [required] | +**repo** | **String** | name of the repo | [required] | +**index** | **i64** | index of the issue to create or update a deadline on | [required] | +**body** | Option<[**EditDeadlineOption**](EditDeadlineOption.md)> | | | + +### Return type + +[**crate::models::IssueDeadline**](IssueDeadline.md) + +### Authorization + +[AccessToken](../README.md#AccessToken), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [BasicAuth](../README.md#BasicAuth), [SudoHeader](../README.md#SudoHeader), [SudoParam](../README.md#SudoParam), [TOTPHeader](../README.md#TOTPHeader), [Token](../README.md#Token) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +## issue_edit_label + +> crate::models::Label issue_edit_label(owner, repo, id, body) +Update a label + +### Parameters + + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**owner** | **String** | owner of the repo | [required] | +**repo** | **String** | name of the repo | [required] | +**id** | **i64** | id of the label to edit | [required] | +**body** | Option<[**EditLabelOption**](EditLabelOption.md)> | | | + +### Return type + +[**crate::models::Label**](Label.md) + +### Authorization + +[AccessToken](../README.md#AccessToken), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [BasicAuth](../README.md#BasicAuth), [SudoHeader](../README.md#SudoHeader), [SudoParam](../README.md#SudoParam), [TOTPHeader](../README.md#TOTPHeader), [Token](../README.md#Token) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +## issue_edit_milestone + +> crate::models::Milestone issue_edit_milestone(owner, repo, id, body) +Update a milestone + +### Parameters + + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**owner** | **String** | owner of the repo | [required] | +**repo** | **String** | name of the repo | [required] | +**id** | **String** | the milestone to edit, identified by ID and if not available by name | [required] | +**body** | Option<[**EditMilestoneOption**](EditMilestoneOption.md)> | | | + +### Return type + +[**crate::models::Milestone**](Milestone.md) + +### Authorization + +[AccessToken](../README.md#AccessToken), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [BasicAuth](../README.md#BasicAuth), [SudoHeader](../README.md#SudoHeader), [SudoParam](../README.md#SudoParam), [TOTPHeader](../README.md#TOTPHeader), [Token](../README.md#Token) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +## issue_get_comment + +> crate::models::Comment issue_get_comment(owner, repo, id) +Get a comment + +### Parameters + + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**owner** | **String** | owner of the repo | [required] | +**repo** | **String** | name of the repo | [required] | +**id** | **i64** | id of the comment | [required] | + +### Return type + +[**crate::models::Comment**](Comment.md) + +### Authorization + +[AccessToken](../README.md#AccessToken), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [BasicAuth](../README.md#BasicAuth), [SudoHeader](../README.md#SudoHeader), [SudoParam](../README.md#SudoParam), [TOTPHeader](../README.md#TOTPHeader), [Token](../README.md#Token) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +## issue_get_comment_reactions + +> Vec issue_get_comment_reactions(owner, repo, id) +Get a list of reactions from a comment of an issue + +### Parameters + + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**owner** | **String** | owner of the repo | [required] | +**repo** | **String** | name of the repo | [required] | +**id** | **i64** | id of the comment to edit | [required] | + +### Return type + +[**Vec**](Reaction.md) + +### Authorization + +[AccessToken](../README.md#AccessToken), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [BasicAuth](../README.md#BasicAuth), [SudoHeader](../README.md#SudoHeader), [SudoParam](../README.md#SudoParam), [TOTPHeader](../README.md#TOTPHeader), [Token](../README.md#Token) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +## issue_get_comments + +> Vec issue_get_comments(owner, repo, index, since, before) +List all comments on an issue + +### Parameters + + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**owner** | **String** | owner of the repo | [required] | +**repo** | **String** | name of the repo | [required] | +**index** | **i64** | index of the issue | [required] | +**since** | Option<**String**> | if provided, only comments updated since the specified time are returned. | | +**before** | Option<**String**> | if provided, only comments updated before the provided time are returned. | | + +### Return type + +[**Vec**](Comment.md) + +### Authorization + +[AccessToken](../README.md#AccessToken), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [BasicAuth](../README.md#BasicAuth), [SudoHeader](../README.md#SudoHeader), [SudoParam](../README.md#SudoParam), [TOTPHeader](../README.md#TOTPHeader), [Token](../README.md#Token) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +## issue_get_comments_and_timeline + +> Vec issue_get_comments_and_timeline(owner, repo, index, since, page, limit, before) +List all comments and events on an issue + +### Parameters + + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**owner** | **String** | owner of the repo | [required] | +**repo** | **String** | name of the repo | [required] | +**index** | **i64** | index of the issue | [required] | +**since** | Option<**String**> | if provided, only comments updated since the specified time are returned. | | +**page** | Option<**i32**> | page number of results to return (1-based) | | +**limit** | Option<**i32**> | page size of results | | +**before** | Option<**String**> | if provided, only comments updated before the provided time are returned. | | + +### Return type + +[**Vec**](TimelineComment.md) + +### Authorization + +[AccessToken](../README.md#AccessToken), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [BasicAuth](../README.md#BasicAuth), [SudoHeader](../README.md#SudoHeader), [SudoParam](../README.md#SudoParam), [TOTPHeader](../README.md#TOTPHeader), [Token](../README.md#Token) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +## issue_get_issue + +> crate::models::Issue issue_get_issue(owner, repo, index) +Get an issue + +### Parameters + + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**owner** | **String** | owner of the repo | [required] | +**repo** | **String** | name of the repo | [required] | +**index** | **i64** | index of the issue to get | [required] | + +### Return type + +[**crate::models::Issue**](Issue.md) + +### Authorization + +[AccessToken](../README.md#AccessToken), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [BasicAuth](../README.md#BasicAuth), [SudoHeader](../README.md#SudoHeader), [SudoParam](../README.md#SudoParam), [TOTPHeader](../README.md#TOTPHeader), [Token](../README.md#Token) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +## issue_get_issue_reactions + +> Vec issue_get_issue_reactions(owner, repo, index, page, limit) +Get a list reactions of an issue + +### Parameters + + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**owner** | **String** | owner of the repo | [required] | +**repo** | **String** | name of the repo | [required] | +**index** | **i64** | index of the issue | [required] | +**page** | Option<**i32**> | page number of results to return (1-based) | | +**limit** | Option<**i32**> | page size of results | | + +### Return type + +[**Vec**](Reaction.md) + +### Authorization + +[AccessToken](../README.md#AccessToken), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [BasicAuth](../README.md#BasicAuth), [SudoHeader](../README.md#SudoHeader), [SudoParam](../README.md#SudoParam), [TOTPHeader](../README.md#TOTPHeader), [Token](../README.md#Token) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +## issue_get_label + +> crate::models::Label issue_get_label(owner, repo, id) +Get a single label + +### Parameters + + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**owner** | **String** | owner of the repo | [required] | +**repo** | **String** | name of the repo | [required] | +**id** | **i64** | id of the label to get | [required] | + +### Return type + +[**crate::models::Label**](Label.md) + +### Authorization + +[AccessToken](../README.md#AccessToken), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [BasicAuth](../README.md#BasicAuth), [SudoHeader](../README.md#SudoHeader), [SudoParam](../README.md#SudoParam), [TOTPHeader](../README.md#TOTPHeader), [Token](../README.md#Token) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +## issue_get_labels + +> Vec issue_get_labels(owner, repo, index) +Get an issue's labels + +### Parameters + + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**owner** | **String** | owner of the repo | [required] | +**repo** | **String** | name of the repo | [required] | +**index** | **i64** | index of the issue | [required] | + +### Return type + +[**Vec**](Label.md) + +### Authorization + +[AccessToken](../README.md#AccessToken), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [BasicAuth](../README.md#BasicAuth), [SudoHeader](../README.md#SudoHeader), [SudoParam](../README.md#SudoParam), [TOTPHeader](../README.md#TOTPHeader), [Token](../README.md#Token) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +## issue_get_milestone + +> crate::models::Milestone issue_get_milestone(owner, repo, id) +Get a milestone + +### Parameters + + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**owner** | **String** | owner of the repo | [required] | +**repo** | **String** | name of the repo | [required] | +**id** | **String** | the milestone to get, identified by ID and if not available by name | [required] | + +### Return type + +[**crate::models::Milestone**](Milestone.md) + +### Authorization + +[AccessToken](../README.md#AccessToken), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [BasicAuth](../README.md#BasicAuth), [SudoHeader](../README.md#SudoHeader), [SudoParam](../README.md#SudoParam), [TOTPHeader](../README.md#TOTPHeader), [Token](../README.md#Token) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +## issue_get_milestones_list + +> Vec issue_get_milestones_list(owner, repo, state, name, page, limit) +Get all of a repository's opened milestones + +### Parameters + + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**owner** | **String** | owner of the repo | [required] | +**repo** | **String** | name of the repo | [required] | +**state** | Option<**String**> | Milestone state, Recognized values are open, closed and all. Defaults to \"open\" | | +**name** | Option<**String**> | filter by milestone name | | +**page** | Option<**i32**> | page number of results to return (1-based) | | +**limit** | Option<**i32**> | page size of results | | + +### Return type + +[**Vec**](Milestone.md) + +### Authorization + +[AccessToken](../README.md#AccessToken), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [BasicAuth](../README.md#BasicAuth), [SudoHeader](../README.md#SudoHeader), [SudoParam](../README.md#SudoParam), [TOTPHeader](../README.md#TOTPHeader), [Token](../README.md#Token) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +## issue_get_repo_comments + +> Vec issue_get_repo_comments(owner, repo, since, before, page, limit) +List all comments in a repository + +### Parameters + + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**owner** | **String** | owner of the repo | [required] | +**repo** | **String** | name of the repo | [required] | +**since** | Option<**String**> | if provided, only comments updated since the provided time are returned. | | +**before** | Option<**String**> | if provided, only comments updated before the provided time are returned. | | +**page** | Option<**i32**> | page number of results to return (1-based) | | +**limit** | Option<**i32**> | page size of results | | + +### Return type + +[**Vec**](Comment.md) + +### Authorization + +[AccessToken](../README.md#AccessToken), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [BasicAuth](../README.md#BasicAuth), [SudoHeader](../README.md#SudoHeader), [SudoParam](../README.md#SudoParam), [TOTPHeader](../README.md#TOTPHeader), [Token](../README.md#Token) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +## issue_list_issues + +> Vec issue_list_issues(owner, repo, state, labels, q, r#type, milestones, since, before, created_by, assigned_by, mentioned_by, page, limit) +List a repository's issues + +### Parameters + + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**owner** | **String** | owner of the repo | [required] | +**repo** | **String** | name of the repo | [required] | +**state** | Option<**String**> | whether issue is open or closed | | +**labels** | Option<**String**> | comma separated list of labels. Fetch only issues that have any of this labels. Non existent labels are discarded | | +**q** | Option<**String**> | search string | | +**r#type** | Option<**String**> | filter by type (issues / pulls) if set | | +**milestones** | Option<**String**> | comma separated list of milestone names or ids. It uses names and fall back to ids. Fetch only issues that have any of this milestones. Non existent milestones are discarded | | +**since** | Option<**String**> | Only show items updated after the given time. This is a timestamp in RFC 3339 format | | +**before** | Option<**String**> | Only show items updated before the given time. This is a timestamp in RFC 3339 format | | +**created_by** | Option<**String**> | Only show items which were created by the the given user | | +**assigned_by** | Option<**String**> | Only show items for which the given user is assigned | | +**mentioned_by** | Option<**String**> | Only show items in which the given user was mentioned | | +**page** | Option<**i32**> | page number of results to return (1-based) | | +**limit** | Option<**i32**> | page size of results | | + +### Return type + +[**Vec**](Issue.md) + +### Authorization + +[AccessToken](../README.md#AccessToken), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [BasicAuth](../README.md#BasicAuth), [SudoHeader](../README.md#SudoHeader), [SudoParam](../README.md#SudoParam), [TOTPHeader](../README.md#TOTPHeader), [Token](../README.md#Token) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +## issue_list_labels + +> Vec issue_list_labels(owner, repo, page, limit) +Get all of a repository's labels + +### Parameters + + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**owner** | **String** | owner of the repo | [required] | +**repo** | **String** | name of the repo | [required] | +**page** | Option<**i32**> | page number of results to return (1-based) | | +**limit** | Option<**i32**> | page size of results | | + +### Return type + +[**Vec**](Label.md) + +### Authorization + +[AccessToken](../README.md#AccessToken), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [BasicAuth](../README.md#BasicAuth), [SudoHeader](../README.md#SudoHeader), [SudoParam](../README.md#SudoParam), [TOTPHeader](../README.md#TOTPHeader), [Token](../README.md#Token) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +## issue_post_comment_reaction + +> crate::models::Reaction issue_post_comment_reaction(owner, repo, id, content) +Add a reaction to a comment of an issue + +### Parameters + + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**owner** | **String** | owner of the repo | [required] | +**repo** | **String** | name of the repo | [required] | +**id** | **i64** | id of the comment to edit | [required] | +**content** | Option<[**EditReactionOption**](EditReactionOption.md)> | | | + +### Return type + +[**crate::models::Reaction**](Reaction.md) + +### Authorization + +[AccessToken](../README.md#AccessToken), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [BasicAuth](../README.md#BasicAuth), [SudoHeader](../README.md#SudoHeader), [SudoParam](../README.md#SudoParam), [TOTPHeader](../README.md#TOTPHeader), [Token](../README.md#Token) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +## issue_post_issue_reaction + +> crate::models::Reaction issue_post_issue_reaction(owner, repo, index, content) +Add a reaction to an issue + +### Parameters + + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**owner** | **String** | owner of the repo | [required] | +**repo** | **String** | name of the repo | [required] | +**index** | **i64** | index of the issue | [required] | +**content** | Option<[**EditReactionOption**](EditReactionOption.md)> | | | + +### Return type + +[**crate::models::Reaction**](Reaction.md) + +### Authorization + +[AccessToken](../README.md#AccessToken), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [BasicAuth](../README.md#BasicAuth), [SudoHeader](../README.md#SudoHeader), [SudoParam](../README.md#SudoParam), [TOTPHeader](../README.md#TOTPHeader), [Token](../README.md#Token) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +## issue_remove_label + +> issue_remove_label(owner, repo, index, id) +Remove a label from an issue + +### Parameters + + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**owner** | **String** | owner of the repo | [required] | +**repo** | **String** | name of the repo | [required] | +**index** | **i64** | index of the issue | [required] | +**id** | **i64** | id of the label to remove | [required] | + +### Return type + + (empty response body) + +### Authorization + +[AccessToken](../README.md#AccessToken), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [BasicAuth](../README.md#BasicAuth), [SudoHeader](../README.md#SudoHeader), [SudoParam](../README.md#SudoParam), [TOTPHeader](../README.md#TOTPHeader), [Token](../README.md#Token) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: Not defined + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +## issue_replace_labels + +> Vec issue_replace_labels(owner, repo, index, body) +Replace an issue's labels + +### Parameters + + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**owner** | **String** | owner of the repo | [required] | +**repo** | **String** | name of the repo | [required] | +**index** | **i64** | index of the issue | [required] | +**body** | Option<[**IssueLabelsOption**](IssueLabelsOption.md)> | | | + +### Return type + +[**Vec**](Label.md) + +### Authorization + +[AccessToken](../README.md#AccessToken), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [BasicAuth](../README.md#BasicAuth), [SudoHeader](../README.md#SudoHeader), [SudoParam](../README.md#SudoParam), [TOTPHeader](../README.md#TOTPHeader), [Token](../README.md#Token) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +## issue_reset_time + +> issue_reset_time(owner, repo, index) +Reset a tracked time of an issue + +### Parameters + + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**owner** | **String** | owner of the repo | [required] | +**repo** | **String** | name of the repo | [required] | +**index** | **i64** | index of the issue to add tracked time to | [required] | + +### Return type + + (empty response body) + +### Authorization + +[AccessToken](../README.md#AccessToken), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [BasicAuth](../README.md#BasicAuth), [SudoHeader](../README.md#SudoHeader), [SudoParam](../README.md#SudoParam), [TOTPHeader](../README.md#TOTPHeader), [Token](../README.md#Token) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: Not defined + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +## issue_search_issues + +> Vec issue_search_issues(state, labels, milestones, q, priority_repo_id, r#type, since, before, assigned, created, mentioned, review_requested, owner, team, page, limit) +Search for issues across the repositories that the user has access to + +### Parameters + + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**state** | Option<**String**> | whether issue is open or closed | | +**labels** | Option<**String**> | comma separated list of labels. Fetch only issues that have any of this labels. Non existent labels are discarded | | +**milestones** | Option<**String**> | comma separated list of milestone names. Fetch only issues that have any of this milestones. Non existent are discarded | | +**q** | Option<**String**> | search string | | +**priority_repo_id** | Option<**i64**> | repository to prioritize in the results | | +**r#type** | Option<**String**> | filter by type (issues / pulls) if set | | +**since** | Option<**String**> | Only show notifications updated after the given time. This is a timestamp in RFC 3339 format | | +**before** | Option<**String**> | Only show notifications updated before the given time. This is a timestamp in RFC 3339 format | | +**assigned** | Option<**bool**> | filter (issues / pulls) assigned to you, default is false | | +**created** | Option<**bool**> | filter (issues / pulls) created by you, default is false | | +**mentioned** | Option<**bool**> | filter (issues / pulls) mentioning you, default is false | | +**review_requested** | Option<**bool**> | filter pulls requesting your review, default is false | | +**owner** | Option<**String**> | filter by owner | | +**team** | Option<**String**> | filter by team (requires organization owner parameter to be provided) | | +**page** | Option<**i32**> | page number of results to return (1-based) | | +**limit** | Option<**i32**> | page size of results | | + +### Return type + +[**Vec**](Issue.md) + +### Authorization + +[AccessToken](../README.md#AccessToken), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [BasicAuth](../README.md#BasicAuth), [SudoHeader](../README.md#SudoHeader), [SudoParam](../README.md#SudoParam), [TOTPHeader](../README.md#TOTPHeader), [Token](../README.md#Token) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +## issue_start_stop_watch + +> issue_start_stop_watch(owner, repo, index) +Start stopwatch on an issue. + +### Parameters + + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**owner** | **String** | owner of the repo | [required] | +**repo** | **String** | name of the repo | [required] | +**index** | **i64** | index of the issue to create the stopwatch on | [required] | + +### Return type + + (empty response body) + +### Authorization + +[AccessToken](../README.md#AccessToken), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [BasicAuth](../README.md#BasicAuth), [SudoHeader](../README.md#SudoHeader), [SudoParam](../README.md#SudoParam), [TOTPHeader](../README.md#TOTPHeader), [Token](../README.md#Token) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: Not defined + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +## issue_stop_stop_watch + +> issue_stop_stop_watch(owner, repo, index) +Stop an issue's existing stopwatch. + +### Parameters + + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**owner** | **String** | owner of the repo | [required] | +**repo** | **String** | name of the repo | [required] | +**index** | **i64** | index of the issue to stop the stopwatch on | [required] | + +### Return type + + (empty response body) + +### Authorization + +[AccessToken](../README.md#AccessToken), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [BasicAuth](../README.md#BasicAuth), [SudoHeader](../README.md#SudoHeader), [SudoParam](../README.md#SudoParam), [TOTPHeader](../README.md#TOTPHeader), [Token](../README.md#Token) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: Not defined + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +## issue_subscriptions + +> Vec issue_subscriptions(owner, repo, index, page, limit) +Get users who subscribed on an issue. + +### Parameters + + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**owner** | **String** | owner of the repo | [required] | +**repo** | **String** | name of the repo | [required] | +**index** | **i64** | index of the issue | [required] | +**page** | Option<**i32**> | page number of results to return (1-based) | | +**limit** | Option<**i32**> | page size of results | | + +### Return type + +[**Vec**](User.md) + +### Authorization + +[AccessToken](../README.md#AccessToken), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [BasicAuth](../README.md#BasicAuth), [SudoHeader](../README.md#SudoHeader), [SudoParam](../README.md#SudoParam), [TOTPHeader](../README.md#TOTPHeader), [Token](../README.md#Token) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +## issue_tracked_times + +> Vec issue_tracked_times(owner, repo, index, user, since, before, page, limit) +List an issue's tracked times + +### Parameters + + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**owner** | **String** | owner of the repo | [required] | +**repo** | **String** | name of the repo | [required] | +**index** | **i64** | index of the issue | [required] | +**user** | Option<**String**> | optional filter by user (available for issue managers) | | +**since** | Option<**String**> | Only show times updated after the given time. This is a timestamp in RFC 3339 format | | +**before** | Option<**String**> | Only show times updated before the given time. This is a timestamp in RFC 3339 format | | +**page** | Option<**i32**> | page number of results to return (1-based) | | +**limit** | Option<**i32**> | page size of results | | + +### Return type + +[**Vec**](TrackedTime.md) + +### Authorization + +[AccessToken](../README.md#AccessToken), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [BasicAuth](../README.md#BasicAuth), [SudoHeader](../README.md#SudoHeader), [SudoParam](../README.md#SudoParam), [TOTPHeader](../README.md#TOTPHeader), [Token](../README.md#Token) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + diff --git a/crates/gitea_raw_client/docs/IssueDeadline.md b/crates/gitea_raw_client/docs/IssueDeadline.md new file mode 100644 index 0000000..94c4d91 --- /dev/null +++ b/crates/gitea_raw_client/docs/IssueDeadline.md @@ -0,0 +1,11 @@ +# IssueDeadline + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**due_date** | Option<**String**> | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/crates/gitea_raw_client/docs/IssueLabelsOption.md b/crates/gitea_raw_client/docs/IssueLabelsOption.md new file mode 100644 index 0000000..c5948a7 --- /dev/null +++ b/crates/gitea_raw_client/docs/IssueLabelsOption.md @@ -0,0 +1,11 @@ +# IssueLabelsOption + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**labels** | Option<**Vec**> | list of label IDs | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/crates/gitea_raw_client/docs/IssueTemplate.md b/crates/gitea_raw_client/docs/IssueTemplate.md new file mode 100644 index 0000000..46c87e4 --- /dev/null +++ b/crates/gitea_raw_client/docs/IssueTemplate.md @@ -0,0 +1,17 @@ +# IssueTemplate + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**about** | Option<**String**> | | [optional] +**content** | Option<**String**> | | [optional] +**file_name** | Option<**String**> | | [optional] +**labels** | Option<**Vec**> | | [optional] +**name** | Option<**String**> | | [optional] +**r#ref** | Option<**String**> | | [optional] +**title** | Option<**String**> | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/crates/gitea_raw_client/docs/Label.md b/crates/gitea_raw_client/docs/Label.md new file mode 100644 index 0000000..90d612a --- /dev/null +++ b/crates/gitea_raw_client/docs/Label.md @@ -0,0 +1,15 @@ +# Label + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**color** | Option<**String**> | | [optional] +**description** | Option<**String**> | | [optional] +**id** | Option<**i64**> | | [optional] +**name** | Option<**String**> | | [optional] +**url** | Option<**String**> | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/crates/gitea_raw_client/docs/MarkdownOption.md b/crates/gitea_raw_client/docs/MarkdownOption.md new file mode 100644 index 0000000..3ed2137 --- /dev/null +++ b/crates/gitea_raw_client/docs/MarkdownOption.md @@ -0,0 +1,14 @@ +# MarkdownOption + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**context** | Option<**String**> | Context to render in: body | [optional] +**mode** | Option<**String**> | Mode to render in: body | [optional] +**text** | Option<**String**> | Text markdown to render in: body | [optional] +**wiki** | Option<**bool**> | Is it a wiki page ? in: body | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/crates/gitea_raw_client/docs/MergePullRequestOption.md b/crates/gitea_raw_client/docs/MergePullRequestOption.md new file mode 100644 index 0000000..8f88bcc --- /dev/null +++ b/crates/gitea_raw_client/docs/MergePullRequestOption.md @@ -0,0 +1,18 @@ +# MergePullRequestOption + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**r#do** | **String** | | +**merge_commit_id** | Option<**String**> | | [optional] +**merge_message_field** | Option<**String**> | | [optional] +**merge_title_field** | Option<**String**> | | [optional] +**delete_branch_after_merge** | Option<**bool**> | | [optional] +**force_merge** | Option<**bool**> | | [optional] +**head_commit_id** | Option<**String**> | | [optional] +**merge_when_checks_succeed** | Option<**bool**> | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/crates/gitea_raw_client/docs/MigrateRepoForm.md b/crates/gitea_raw_client/docs/MigrateRepoForm.md new file mode 100644 index 0000000..200b2d8 --- /dev/null +++ b/crates/gitea_raw_client/docs/MigrateRepoForm.md @@ -0,0 +1,29 @@ +# MigrateRepoForm + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**auth_password** | Option<**String**> | | [optional] +**auth_token** | Option<**String**> | | [optional] +**auth_username** | Option<**String**> | | [optional] +**clone_addr** | **String** | | +**description** | Option<**String**> | | [optional] +**issues** | Option<**bool**> | | [optional] +**labels** | Option<**bool**> | | [optional] +**lfs** | Option<**bool**> | | [optional] +**lfs_endpoint** | Option<**String**> | | [optional] +**milestones** | Option<**bool**> | | [optional] +**mirror** | Option<**bool**> | | [optional] +**mirror_interval** | Option<**String**> | | [optional] +**private** | Option<**bool**> | | [optional] +**pull_requests** | Option<**bool**> | | [optional] +**releases** | Option<**bool**> | | [optional] +**repo_name** | **String** | | +**service** | Option<**i64**> | GitServiceType represents a git service | [optional] +**uid** | **i64** | | +**wiki** | Option<**bool**> | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/crates/gitea_raw_client/docs/MigrateRepoOptions.md b/crates/gitea_raw_client/docs/MigrateRepoOptions.md new file mode 100644 index 0000000..c5ede9c --- /dev/null +++ b/crates/gitea_raw_client/docs/MigrateRepoOptions.md @@ -0,0 +1,30 @@ +# MigrateRepoOptions + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**auth_password** | Option<**String**> | | [optional] +**auth_token** | Option<**String**> | | [optional] +**auth_username** | Option<**String**> | | [optional] +**clone_addr** | **String** | | +**description** | Option<**String**> | | [optional] +**issues** | Option<**bool**> | | [optional] +**labels** | Option<**bool**> | | [optional] +**lfs** | Option<**bool**> | | [optional] +**lfs_endpoint** | Option<**String**> | | [optional] +**milestones** | Option<**bool**> | | [optional] +**mirror** | Option<**bool**> | | [optional] +**mirror_interval** | Option<**String**> | | [optional] +**private** | Option<**bool**> | | [optional] +**pull_requests** | Option<**bool**> | | [optional] +**releases** | Option<**bool**> | | [optional] +**repo_name** | **String** | | +**repo_owner** | Option<**String**> | Name of User or Organisation who will own Repo after migration | [optional] +**service** | Option<**String**> | | [optional] +**uid** | Option<**i64**> | deprecated (only for backwards compatibility) | [optional] +**wiki** | Option<**bool**> | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/crates/gitea_raw_client/docs/Milestone.md b/crates/gitea_raw_client/docs/Milestone.md new file mode 100644 index 0000000..c92f404 --- /dev/null +++ b/crates/gitea_raw_client/docs/Milestone.md @@ -0,0 +1,20 @@ +# Milestone + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**closed_at** | Option<**String**> | | [optional] +**closed_issues** | Option<**i64**> | | [optional] +**created_at** | Option<**String**> | | [optional] +**description** | Option<**String**> | | [optional] +**due_on** | Option<**String**> | | [optional] +**id** | Option<**i64**> | | [optional] +**open_issues** | Option<**i64**> | | [optional] +**state** | Option<**String**> | StateType issue state type | [optional] +**title** | Option<**String**> | | [optional] +**updated_at** | Option<**String**> | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/crates/gitea_raw_client/docs/MiscellaneousApi.md b/crates/gitea_raw_client/docs/MiscellaneousApi.md new file mode 100644 index 0000000..5dbd9e2 --- /dev/null +++ b/crates/gitea_raw_client/docs/MiscellaneousApi.md @@ -0,0 +1,144 @@ +# \MiscellaneousApi + +All URIs are relative to */api/v1* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**get_node_info**](MiscellaneousApi.md#get_node_info) | **GET** /nodeinfo | Returns the nodeinfo of the Gitea application +[**get_signing_key**](MiscellaneousApi.md#get_signing_key) | **GET** /signing-key.gpg | Get default signing-key.gpg +[**get_version**](MiscellaneousApi.md#get_version) | **GET** /version | Returns the version of the Gitea application +[**render_markdown**](MiscellaneousApi.md#render_markdown) | **POST** /markdown | Render a markdown document as HTML +[**render_markdown_raw**](MiscellaneousApi.md#render_markdown_raw) | **POST** /markdown/raw | Render raw markdown as HTML + + + +## get_node_info + +> crate::models::NodeInfo get_node_info() +Returns the nodeinfo of the Gitea application + +### Parameters + +This endpoint does not need any parameter. + +### Return type + +[**crate::models::NodeInfo**](NodeInfo.md) + +### Authorization + +[AccessToken](../README.md#AccessToken), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [BasicAuth](../README.md#BasicAuth), [SudoHeader](../README.md#SudoHeader), [SudoParam](../README.md#SudoParam), [TOTPHeader](../README.md#TOTPHeader), [Token](../README.md#Token) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +## get_signing_key + +> String get_signing_key() +Get default signing-key.gpg + +### Parameters + +This endpoint does not need any parameter. + +### Return type + +**String** + +### Authorization + +[AccessToken](../README.md#AccessToken), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [BasicAuth](../README.md#BasicAuth), [SudoHeader](../README.md#SudoHeader), [SudoParam](../README.md#SudoParam), [TOTPHeader](../README.md#TOTPHeader), [Token](../README.md#Token) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: text/plain + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +## get_version + +> crate::models::ServerVersion get_version() +Returns the version of the Gitea application + +### Parameters + +This endpoint does not need any parameter. + +### Return type + +[**crate::models::ServerVersion**](ServerVersion.md) + +### Authorization + +[AccessToken](../README.md#AccessToken), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [BasicAuth](../README.md#BasicAuth), [SudoHeader](../README.md#SudoHeader), [SudoParam](../README.md#SudoParam), [TOTPHeader](../README.md#TOTPHeader), [Token](../README.md#Token) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +## render_markdown + +> String render_markdown(body) +Render a markdown document as HTML + +### Parameters + + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**body** | Option<[**MarkdownOption**](MarkdownOption.md)> | | | + +### Return type + +**String** + +### Authorization + +[AccessToken](../README.md#AccessToken), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [BasicAuth](../README.md#BasicAuth), [SudoHeader](../README.md#SudoHeader), [SudoParam](../README.md#SudoParam), [TOTPHeader](../README.md#TOTPHeader), [Token](../README.md#Token) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: text/html + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +## render_markdown_raw + +> String render_markdown_raw(body) +Render raw markdown as HTML + +### Parameters + + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**body** | **String** | Request body to render | [required] | + +### Return type + +**String** + +### Authorization + +[AccessToken](../README.md#AccessToken), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [BasicAuth](../README.md#BasicAuth), [SudoHeader](../README.md#SudoHeader), [SudoParam](../README.md#SudoParam), [TOTPHeader](../README.md#TOTPHeader), [Token](../README.md#Token) + +### HTTP request headers + +- **Content-Type**: text/plain +- **Accept**: text/html + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + diff --git a/crates/gitea_raw_client/docs/NodeInfo.md b/crates/gitea_raw_client/docs/NodeInfo.md new file mode 100644 index 0000000..61e0c47 --- /dev/null +++ b/crates/gitea_raw_client/docs/NodeInfo.md @@ -0,0 +1,17 @@ +# NodeInfo + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**metadata** | Option<[**serde_json::Value**](.md)> | | [optional] +**open_registrations** | Option<**bool**> | | [optional] +**protocols** | Option<**Vec**> | | [optional] +**services** | Option<[**crate::models::NodeInfoServices**](NodeInfoServices.md)> | | [optional] +**software** | Option<[**crate::models::NodeInfoSoftware**](NodeInfoSoftware.md)> | | [optional] +**usage** | Option<[**crate::models::NodeInfoUsage**](NodeInfoUsage.md)> | | [optional] +**version** | Option<**String**> | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/crates/gitea_raw_client/docs/NodeInfoServices.md b/crates/gitea_raw_client/docs/NodeInfoServices.md new file mode 100644 index 0000000..1cde335 --- /dev/null +++ b/crates/gitea_raw_client/docs/NodeInfoServices.md @@ -0,0 +1,12 @@ +# NodeInfoServices + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**inbound** | Option<**Vec**> | | [optional] +**outbound** | Option<**Vec**> | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/crates/gitea_raw_client/docs/NodeInfoSoftware.md b/crates/gitea_raw_client/docs/NodeInfoSoftware.md new file mode 100644 index 0000000..0660bf8 --- /dev/null +++ b/crates/gitea_raw_client/docs/NodeInfoSoftware.md @@ -0,0 +1,14 @@ +# NodeInfoSoftware + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**homepage** | Option<**String**> | | [optional] +**name** | Option<**String**> | | [optional] +**repository** | Option<**String**> | | [optional] +**version** | Option<**String**> | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/crates/gitea_raw_client/docs/NodeInfoUsage.md b/crates/gitea_raw_client/docs/NodeInfoUsage.md new file mode 100644 index 0000000..d8c1e1f --- /dev/null +++ b/crates/gitea_raw_client/docs/NodeInfoUsage.md @@ -0,0 +1,13 @@ +# NodeInfoUsage + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**local_comments** | Option<**i64**> | | [optional] +**local_posts** | Option<**i64**> | | [optional] +**users** | Option<[**crate::models::NodeInfoUsageUsers**](NodeInfoUsageUsers.md)> | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/crates/gitea_raw_client/docs/NodeInfoUsageUsers.md b/crates/gitea_raw_client/docs/NodeInfoUsageUsers.md new file mode 100644 index 0000000..ee1808b --- /dev/null +++ b/crates/gitea_raw_client/docs/NodeInfoUsageUsers.md @@ -0,0 +1,13 @@ +# NodeInfoUsageUsers + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**active_halfyear** | Option<**i64**> | | [optional] +**active_month** | Option<**i64**> | | [optional] +**total** | Option<**i64**> | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/crates/gitea_raw_client/docs/Note.md b/crates/gitea_raw_client/docs/Note.md new file mode 100644 index 0000000..3e003ab --- /dev/null +++ b/crates/gitea_raw_client/docs/Note.md @@ -0,0 +1,12 @@ +# Note + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**commit** | Option<[**crate::models::Commit**](Commit.md)> | | [optional] +**message** | Option<**String**> | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/crates/gitea_raw_client/docs/NotificationApi.md b/crates/gitea_raw_client/docs/NotificationApi.md new file mode 100644 index 0000000..0771f32 --- /dev/null +++ b/crates/gitea_raw_client/docs/NotificationApi.md @@ -0,0 +1,231 @@ +# \NotificationApi + +All URIs are relative to */api/v1* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**notify_get_list**](NotificationApi.md#notify_get_list) | **GET** /notifications | List users's notification threads +[**notify_get_repo_list**](NotificationApi.md#notify_get_repo_list) | **GET** /repos/{owner}/{repo}/notifications | List users's notification threads on a specific repo +[**notify_get_thread**](NotificationApi.md#notify_get_thread) | **GET** /notifications/threads/{id} | Get notification thread by ID +[**notify_new_available**](NotificationApi.md#notify_new_available) | **GET** /notifications/new | Check if unread notifications exist +[**notify_read_list**](NotificationApi.md#notify_read_list) | **PUT** /notifications | Mark notification threads as read, pinned or unread +[**notify_read_repo_list**](NotificationApi.md#notify_read_repo_list) | **PUT** /repos/{owner}/{repo}/notifications | Mark notification threads as read, pinned or unread on a specific repo +[**notify_read_thread**](NotificationApi.md#notify_read_thread) | **PATCH** /notifications/threads/{id} | Mark notification thread as read by ID + + + +## notify_get_list + +> Vec notify_get_list(all, status_types, subject_type, since, before, page, limit) +List users's notification threads + +### Parameters + + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**all** | Option<**bool**> | If true, show notifications marked as read. Default value is false | | +**status_types** | Option<[**Vec**](String.md)> | Show notifications with the provided status types. Options are: unread, read and/or pinned. Defaults to unread & pinned. | | +**subject_type** | Option<[**Vec**](String.md)> | filter notifications by subject type | | +**since** | Option<**String**> | Only show notifications updated after the given time. This is a timestamp in RFC 3339 format | | +**before** | Option<**String**> | Only show notifications updated before the given time. This is a timestamp in RFC 3339 format | | +**page** | Option<**i32**> | page number of results to return (1-based) | | +**limit** | Option<**i32**> | page size of results | | + +### Return type + +[**Vec**](NotificationThread.md) + +### Authorization + +[AccessToken](../README.md#AccessToken), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [BasicAuth](../README.md#BasicAuth), [SudoHeader](../README.md#SudoHeader), [SudoParam](../README.md#SudoParam), [TOTPHeader](../README.md#TOTPHeader), [Token](../README.md#Token) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +## notify_get_repo_list + +> Vec notify_get_repo_list(owner, repo, all, status_types, subject_type, since, before, page, limit) +List users's notification threads on a specific repo + +### Parameters + + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**owner** | **String** | owner of the repo | [required] | +**repo** | **String** | name of the repo | [required] | +**all** | Option<**bool**> | If true, show notifications marked as read. Default value is false | | +**status_types** | Option<[**Vec**](String.md)> | Show notifications with the provided status types. Options are: unread, read and/or pinned. Defaults to unread & pinned | | +**subject_type** | Option<[**Vec**](String.md)> | filter notifications by subject type | | +**since** | Option<**String**> | Only show notifications updated after the given time. This is a timestamp in RFC 3339 format | | +**before** | Option<**String**> | Only show notifications updated before the given time. This is a timestamp in RFC 3339 format | | +**page** | Option<**i32**> | page number of results to return (1-based) | | +**limit** | Option<**i32**> | page size of results | | + +### Return type + +[**Vec**](NotificationThread.md) + +### Authorization + +[AccessToken](../README.md#AccessToken), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [BasicAuth](../README.md#BasicAuth), [SudoHeader](../README.md#SudoHeader), [SudoParam](../README.md#SudoParam), [TOTPHeader](../README.md#TOTPHeader), [Token](../README.md#Token) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +## notify_get_thread + +> crate::models::NotificationThread notify_get_thread(id) +Get notification thread by ID + +### Parameters + + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**id** | **String** | id of notification thread | [required] | + +### Return type + +[**crate::models::NotificationThread**](NotificationThread.md) + +### Authorization + +[AccessToken](../README.md#AccessToken), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [BasicAuth](../README.md#BasicAuth), [SudoHeader](../README.md#SudoHeader), [SudoParam](../README.md#SudoParam), [TOTPHeader](../README.md#TOTPHeader), [Token](../README.md#Token) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +## notify_new_available + +> crate::models::NotificationCount notify_new_available() +Check if unread notifications exist + +### Parameters + +This endpoint does not need any parameter. + +### Return type + +[**crate::models::NotificationCount**](NotificationCount.md) + +### Authorization + +[AccessToken](../README.md#AccessToken), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [BasicAuth](../README.md#BasicAuth), [SudoHeader](../README.md#SudoHeader), [SudoParam](../README.md#SudoParam), [TOTPHeader](../README.md#TOTPHeader), [Token](../README.md#Token) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json, text/html + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +## notify_read_list + +> Vec notify_read_list(last_read_at, all, status_types, to_status) +Mark notification threads as read, pinned or unread + +### Parameters + + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**last_read_at** | Option<**String**> | Describes the last point that notifications were checked. Anything updated since this time will not be updated. | | +**all** | Option<**String**> | If true, mark all notifications on this repo. Default value is false | | +**status_types** | Option<[**Vec**](String.md)> | Mark notifications with the provided status types. Options are: unread, read and/or pinned. Defaults to unread. | | +**to_status** | Option<**String**> | Status to mark notifications as, Defaults to read. | | + +### Return type + +[**Vec**](NotificationThread.md) + +### Authorization + +[AccessToken](../README.md#AccessToken), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [BasicAuth](../README.md#BasicAuth), [SudoHeader](../README.md#SudoHeader), [SudoParam](../README.md#SudoParam), [TOTPHeader](../README.md#TOTPHeader), [Token](../README.md#Token) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +## notify_read_repo_list + +> Vec notify_read_repo_list(owner, repo, all, status_types, to_status, last_read_at) +Mark notification threads as read, pinned or unread on a specific repo + +### Parameters + + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**owner** | **String** | owner of the repo | [required] | +**repo** | **String** | name of the repo | [required] | +**all** | Option<**String**> | If true, mark all notifications on this repo. Default value is false | | +**status_types** | Option<[**Vec**](String.md)> | Mark notifications with the provided status types. Options are: unread, read and/or pinned. Defaults to unread. | | +**to_status** | Option<**String**> | Status to mark notifications as. Defaults to read. | | +**last_read_at** | Option<**String**> | Describes the last point that notifications were checked. Anything updated since this time will not be updated. | | + +### Return type + +[**Vec**](NotificationThread.md) + +### Authorization + +[AccessToken](../README.md#AccessToken), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [BasicAuth](../README.md#BasicAuth), [SudoHeader](../README.md#SudoHeader), [SudoParam](../README.md#SudoParam), [TOTPHeader](../README.md#TOTPHeader), [Token](../README.md#Token) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +## notify_read_thread + +> crate::models::NotificationThread notify_read_thread(id, to_status) +Mark notification thread as read by ID + +### Parameters + + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**id** | **String** | id of notification thread | [required] | +**to_status** | Option<**String**> | Status to mark notifications as | |[default to read] + +### Return type + +[**crate::models::NotificationThread**](NotificationThread.md) + +### Authorization + +[AccessToken](../README.md#AccessToken), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [BasicAuth](../README.md#BasicAuth), [SudoHeader](../README.md#SudoHeader), [SudoParam](../README.md#SudoParam), [TOTPHeader](../README.md#TOTPHeader), [Token](../README.md#Token) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + diff --git a/crates/gitea_raw_client/docs/NotificationCount.md b/crates/gitea_raw_client/docs/NotificationCount.md new file mode 100644 index 0000000..0c76de0 --- /dev/null +++ b/crates/gitea_raw_client/docs/NotificationCount.md @@ -0,0 +1,11 @@ +# NotificationCount + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**new** | Option<**i64**> | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/crates/gitea_raw_client/docs/NotificationSubject.md b/crates/gitea_raw_client/docs/NotificationSubject.md new file mode 100644 index 0000000..8a28c83 --- /dev/null +++ b/crates/gitea_raw_client/docs/NotificationSubject.md @@ -0,0 +1,17 @@ +# NotificationSubject + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**html_url** | Option<**String**> | | [optional] +**latest_comment_html_url** | Option<**String**> | | [optional] +**latest_comment_url** | Option<**String**> | | [optional] +**state** | Option<**String**> | StateType issue state type | [optional] +**title** | Option<**String**> | | [optional] +**r#type** | Option<**String**> | NotifySubjectType represent type of notification subject | [optional] +**url** | Option<**String**> | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/crates/gitea_raw_client/docs/NotificationThread.md b/crates/gitea_raw_client/docs/NotificationThread.md new file mode 100644 index 0000000..f05694e --- /dev/null +++ b/crates/gitea_raw_client/docs/NotificationThread.md @@ -0,0 +1,17 @@ +# NotificationThread + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | Option<**i64**> | | [optional] +**pinned** | Option<**bool**> | | [optional] +**repository** | Option<[**crate::models::Repository**](Repository.md)> | | [optional] +**subject** | Option<[**crate::models::NotificationSubject**](NotificationSubject.md)> | | [optional] +**unread** | Option<**bool**> | | [optional] +**updated_at** | Option<**String**> | | [optional] +**url** | Option<**String**> | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/crates/gitea_raw_client/docs/OAuth2Application.md b/crates/gitea_raw_client/docs/OAuth2Application.md new file mode 100644 index 0000000..a695d31 --- /dev/null +++ b/crates/gitea_raw_client/docs/OAuth2Application.md @@ -0,0 +1,16 @@ +# OAuth2Application + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**client_id** | Option<**String**> | | [optional] +**client_secret** | Option<**String**> | | [optional] +**created** | Option<**String**> | | [optional] +**id** | Option<**i64**> | | [optional] +**name** | Option<**String**> | | [optional] +**redirect_uris** | Option<**Vec**> | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/crates/gitea_raw_client/docs/Organization.md b/crates/gitea_raw_client/docs/Organization.md new file mode 100644 index 0000000..cc401bc --- /dev/null +++ b/crates/gitea_raw_client/docs/Organization.md @@ -0,0 +1,19 @@ +# Organization + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**avatar_url** | Option<**String**> | | [optional] +**description** | Option<**String**> | | [optional] +**full_name** | Option<**String**> | | [optional] +**id** | Option<**i64**> | | [optional] +**location** | Option<**String**> | | [optional] +**repo_admin_change_team_access** | Option<**bool**> | | [optional] +**username** | Option<**String**> | | [optional] +**visibility** | Option<**String**> | | [optional] +**website** | Option<**String**> | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/crates/gitea_raw_client/docs/OrganizationApi.md b/crates/gitea_raw_client/docs/OrganizationApi.md new file mode 100644 index 0000000..ee38e2a --- /dev/null +++ b/crates/gitea_raw_client/docs/OrganizationApi.md @@ -0,0 +1,1282 @@ +# \OrganizationApi + +All URIs are relative to */api/v1* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**create_org_repo**](OrganizationApi.md#create_org_repo) | **POST** /orgs/{org}/repos | Create a repository in an organization +[**create_org_repo_deprecated**](OrganizationApi.md#create_org_repo_deprecated) | **POST** /org/{org}/repos | Create a repository in an organization +[**org_add_team_member**](OrganizationApi.md#org_add_team_member) | **PUT** /teams/{id}/members/{username} | Add a team member +[**org_add_team_repository**](OrganizationApi.md#org_add_team_repository) | **PUT** /teams/{id}/repos/{org}/{repo} | Add a repository to a team +[**org_conceal_member**](OrganizationApi.md#org_conceal_member) | **DELETE** /orgs/{org}/public_members/{username} | Conceal a user's membership +[**org_create**](OrganizationApi.md#org_create) | **POST** /orgs | Create an organization +[**org_create_hook**](OrganizationApi.md#org_create_hook) | **POST** /orgs/{org}/hooks/ | Create a hook +[**org_create_label**](OrganizationApi.md#org_create_label) | **POST** /orgs/{org}/labels | Create a label for an organization +[**org_create_team**](OrganizationApi.md#org_create_team) | **POST** /orgs/{org}/teams | Create a team +[**org_delete**](OrganizationApi.md#org_delete) | **DELETE** /orgs/{org} | Delete an organization +[**org_delete_hook**](OrganizationApi.md#org_delete_hook) | **DELETE** /orgs/{org}/hooks/{id} | Delete a hook +[**org_delete_label**](OrganizationApi.md#org_delete_label) | **DELETE** /orgs/{org}/labels/{id} | Delete a label +[**org_delete_member**](OrganizationApi.md#org_delete_member) | **DELETE** /orgs/{org}/members/{username} | Remove a member from an organization +[**org_delete_team**](OrganizationApi.md#org_delete_team) | **DELETE** /teams/{id} | Delete a team +[**org_edit**](OrganizationApi.md#org_edit) | **PATCH** /orgs/{org} | Edit an organization +[**org_edit_hook**](OrganizationApi.md#org_edit_hook) | **PATCH** /orgs/{org}/hooks/{id} | Update a hook +[**org_edit_label**](OrganizationApi.md#org_edit_label) | **PATCH** /orgs/{org}/labels/{id} | Update a label +[**org_edit_team**](OrganizationApi.md#org_edit_team) | **PATCH** /teams/{id} | Edit a team +[**org_get**](OrganizationApi.md#org_get) | **GET** /orgs/{org} | Get an organization +[**org_get_all**](OrganizationApi.md#org_get_all) | **GET** /orgs | Get list of organizations +[**org_get_hook**](OrganizationApi.md#org_get_hook) | **GET** /orgs/{org}/hooks/{id} | Get a hook +[**org_get_label**](OrganizationApi.md#org_get_label) | **GET** /orgs/{org}/labels/{id} | Get a single label +[**org_get_team**](OrganizationApi.md#org_get_team) | **GET** /teams/{id} | Get a team +[**org_get_user_permissions**](OrganizationApi.md#org_get_user_permissions) | **GET** /users/{username}/orgs/{org}/permissions | Get user permissions in organization +[**org_is_member**](OrganizationApi.md#org_is_member) | **GET** /orgs/{org}/members/{username} | Check if a user is a member of an organization +[**org_is_public_member**](OrganizationApi.md#org_is_public_member) | **GET** /orgs/{org}/public_members/{username} | Check if a user is a public member of an organization +[**org_list_current_user_orgs**](OrganizationApi.md#org_list_current_user_orgs) | **GET** /user/orgs | List the current user's organizations +[**org_list_hooks**](OrganizationApi.md#org_list_hooks) | **GET** /orgs/{org}/hooks | List an organization's webhooks +[**org_list_labels**](OrganizationApi.md#org_list_labels) | **GET** /orgs/{org}/labels | List an organization's labels +[**org_list_members**](OrganizationApi.md#org_list_members) | **GET** /orgs/{org}/members | List an organization's members +[**org_list_public_members**](OrganizationApi.md#org_list_public_members) | **GET** /orgs/{org}/public_members | List an organization's public members +[**org_list_repos**](OrganizationApi.md#org_list_repos) | **GET** /orgs/{org}/repos | List an organization's repos +[**org_list_team_member**](OrganizationApi.md#org_list_team_member) | **GET** /teams/{id}/members/{username} | List a particular member of team +[**org_list_team_members**](OrganizationApi.md#org_list_team_members) | **GET** /teams/{id}/members | List a team's members +[**org_list_team_repo**](OrganizationApi.md#org_list_team_repo) | **GET** /teams/{id}/repos/{org}/{repo} | List a particular repo of team +[**org_list_team_repos**](OrganizationApi.md#org_list_team_repos) | **GET** /teams/{id}/repos | List a team's repos +[**org_list_teams**](OrganizationApi.md#org_list_teams) | **GET** /orgs/{org}/teams | List an organization's teams +[**org_list_user_orgs**](OrganizationApi.md#org_list_user_orgs) | **GET** /users/{username}/orgs | List a user's organizations +[**org_publicize_member**](OrganizationApi.md#org_publicize_member) | **PUT** /orgs/{org}/public_members/{username} | Publicize a user's membership +[**org_remove_team_member**](OrganizationApi.md#org_remove_team_member) | **DELETE** /teams/{id}/members/{username} | Remove a team member +[**org_remove_team_repository**](OrganizationApi.md#org_remove_team_repository) | **DELETE** /teams/{id}/repos/{org}/{repo} | Remove a repository from a team +[**team_search**](OrganizationApi.md#team_search) | **GET** /orgs/{org}/teams/search | Search for teams within an organization + + + +## create_org_repo + +> crate::models::Repository create_org_repo(org, body) +Create a repository in an organization + +### Parameters + + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**org** | **String** | name of organization | [required] | +**body** | Option<[**CreateRepoOption**](CreateRepoOption.md)> | | | + +### Return type + +[**crate::models::Repository**](Repository.md) + +### Authorization + +[AccessToken](../README.md#AccessToken), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [BasicAuth](../README.md#BasicAuth), [SudoHeader](../README.md#SudoHeader), [SudoParam](../README.md#SudoParam), [TOTPHeader](../README.md#TOTPHeader), [Token](../README.md#Token) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +## create_org_repo_deprecated + +> crate::models::Repository create_org_repo_deprecated(org, body) +Create a repository in an organization + +### Parameters + + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**org** | **String** | name of organization | [required] | +**body** | Option<[**CreateRepoOption**](CreateRepoOption.md)> | | | + +### Return type + +[**crate::models::Repository**](Repository.md) + +### Authorization + +[AccessToken](../README.md#AccessToken), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [BasicAuth](../README.md#BasicAuth), [SudoHeader](../README.md#SudoHeader), [SudoParam](../README.md#SudoParam), [TOTPHeader](../README.md#TOTPHeader), [Token](../README.md#Token) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +## org_add_team_member + +> org_add_team_member(id, username) +Add a team member + +### Parameters + + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**id** | **i64** | id of the team | [required] | +**username** | **String** | username of the user to add | [required] | + +### Return type + + (empty response body) + +### Authorization + +[AccessToken](../README.md#AccessToken), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [BasicAuth](../README.md#BasicAuth), [SudoHeader](../README.md#SudoHeader), [SudoParam](../README.md#SudoParam), [TOTPHeader](../README.md#TOTPHeader), [Token](../README.md#Token) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: Not defined + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +## org_add_team_repository + +> org_add_team_repository(id, org, repo) +Add a repository to a team + +### Parameters + + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**id** | **i64** | id of the team | [required] | +**org** | **String** | organization that owns the repo to add | [required] | +**repo** | **String** | name of the repo to add | [required] | + +### Return type + + (empty response body) + +### Authorization + +[AccessToken](../README.md#AccessToken), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [BasicAuth](../README.md#BasicAuth), [SudoHeader](../README.md#SudoHeader), [SudoParam](../README.md#SudoParam), [TOTPHeader](../README.md#TOTPHeader), [Token](../README.md#Token) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: Not defined + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +## org_conceal_member + +> org_conceal_member(org, username) +Conceal a user's membership + +### Parameters + + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**org** | **String** | name of the organization | [required] | +**username** | **String** | username of the user | [required] | + +### Return type + + (empty response body) + +### Authorization + +[AccessToken](../README.md#AccessToken), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [BasicAuth](../README.md#BasicAuth), [SudoHeader](../README.md#SudoHeader), [SudoParam](../README.md#SudoParam), [TOTPHeader](../README.md#TOTPHeader), [Token](../README.md#Token) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: Not defined + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +## org_create + +> crate::models::Organization org_create(organization) +Create an organization + +### Parameters + + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**organization** | [**CreateOrgOption**](CreateOrgOption.md) | | [required] | + +### Return type + +[**crate::models::Organization**](Organization.md) + +### Authorization + +[AccessToken](../README.md#AccessToken), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [BasicAuth](../README.md#BasicAuth), [SudoHeader](../README.md#SudoHeader), [SudoParam](../README.md#SudoParam), [TOTPHeader](../README.md#TOTPHeader), [Token](../README.md#Token) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +## org_create_hook + +> crate::models::Hook org_create_hook(org, body) +Create a hook + +### Parameters + + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**org** | **String** | name of the organization | [required] | +**body** | [**CreateHookOption**](CreateHookOption.md) | | [required] | + +### Return type + +[**crate::models::Hook**](Hook.md) + +### Authorization + +[AccessToken](../README.md#AccessToken), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [BasicAuth](../README.md#BasicAuth), [SudoHeader](../README.md#SudoHeader), [SudoParam](../README.md#SudoParam), [TOTPHeader](../README.md#TOTPHeader), [Token](../README.md#Token) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +## org_create_label + +> crate::models::Label org_create_label(org, body) +Create a label for an organization + +### Parameters + + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**org** | **String** | name of the organization | [required] | +**body** | Option<[**CreateLabelOption**](CreateLabelOption.md)> | | | + +### Return type + +[**crate::models::Label**](Label.md) + +### Authorization + +[AccessToken](../README.md#AccessToken), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [BasicAuth](../README.md#BasicAuth), [SudoHeader](../README.md#SudoHeader), [SudoParam](../README.md#SudoParam), [TOTPHeader](../README.md#TOTPHeader), [Token](../README.md#Token) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +## org_create_team + +> crate::models::Team org_create_team(org, body) +Create a team + +### Parameters + + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**org** | **String** | name of the organization | [required] | +**body** | Option<[**CreateTeamOption**](CreateTeamOption.md)> | | | + +### Return type + +[**crate::models::Team**](Team.md) + +### Authorization + +[AccessToken](../README.md#AccessToken), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [BasicAuth](../README.md#BasicAuth), [SudoHeader](../README.md#SudoHeader), [SudoParam](../README.md#SudoParam), [TOTPHeader](../README.md#TOTPHeader), [Token](../README.md#Token) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +## org_delete + +> org_delete(org) +Delete an organization + +### Parameters + + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**org** | **String** | organization that is to be deleted | [required] | + +### Return type + + (empty response body) + +### Authorization + +[AccessToken](../README.md#AccessToken), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [BasicAuth](../README.md#BasicAuth), [SudoHeader](../README.md#SudoHeader), [SudoParam](../README.md#SudoParam), [TOTPHeader](../README.md#TOTPHeader), [Token](../README.md#Token) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: Not defined + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +## org_delete_hook + +> org_delete_hook(org, id) +Delete a hook + +### Parameters + + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**org** | **String** | name of the organization | [required] | +**id** | **i64** | id of the hook to delete | [required] | + +### Return type + + (empty response body) + +### Authorization + +[AccessToken](../README.md#AccessToken), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [BasicAuth](../README.md#BasicAuth), [SudoHeader](../README.md#SudoHeader), [SudoParam](../README.md#SudoParam), [TOTPHeader](../README.md#TOTPHeader), [Token](../README.md#Token) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: Not defined + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +## org_delete_label + +> org_delete_label(org, id) +Delete a label + +### Parameters + + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**org** | **String** | name of the organization | [required] | +**id** | **i64** | id of the label to delete | [required] | + +### Return type + + (empty response body) + +### Authorization + +[AccessToken](../README.md#AccessToken), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [BasicAuth](../README.md#BasicAuth), [SudoHeader](../README.md#SudoHeader), [SudoParam](../README.md#SudoParam), [TOTPHeader](../README.md#TOTPHeader), [Token](../README.md#Token) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: Not defined + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +## org_delete_member + +> org_delete_member(org, username) +Remove a member from an organization + +### Parameters + + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**org** | **String** | name of the organization | [required] | +**username** | **String** | username of the user | [required] | + +### Return type + + (empty response body) + +### Authorization + +[AccessToken](../README.md#AccessToken), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [BasicAuth](../README.md#BasicAuth), [SudoHeader](../README.md#SudoHeader), [SudoParam](../README.md#SudoParam), [TOTPHeader](../README.md#TOTPHeader), [Token](../README.md#Token) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: Not defined + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +## org_delete_team + +> org_delete_team(id) +Delete a team + +### Parameters + + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**id** | **i64** | id of the team to delete | [required] | + +### Return type + + (empty response body) + +### Authorization + +[AccessToken](../README.md#AccessToken), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [BasicAuth](../README.md#BasicAuth), [SudoHeader](../README.md#SudoHeader), [SudoParam](../README.md#SudoParam), [TOTPHeader](../README.md#TOTPHeader), [Token](../README.md#Token) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: Not defined + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +## org_edit + +> crate::models::Organization org_edit(org, body) +Edit an organization + +### Parameters + + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**org** | **String** | name of the organization to edit | [required] | +**body** | [**EditOrgOption**](EditOrgOption.md) | | [required] | + +### Return type + +[**crate::models::Organization**](Organization.md) + +### Authorization + +[AccessToken](../README.md#AccessToken), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [BasicAuth](../README.md#BasicAuth), [SudoHeader](../README.md#SudoHeader), [SudoParam](../README.md#SudoParam), [TOTPHeader](../README.md#TOTPHeader), [Token](../README.md#Token) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +## org_edit_hook + +> crate::models::Hook org_edit_hook(org, id, body) +Update a hook + +### Parameters + + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**org** | **String** | name of the organization | [required] | +**id** | **i64** | id of the hook to update | [required] | +**body** | Option<[**EditHookOption**](EditHookOption.md)> | | | + +### Return type + +[**crate::models::Hook**](Hook.md) + +### Authorization + +[AccessToken](../README.md#AccessToken), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [BasicAuth](../README.md#BasicAuth), [SudoHeader](../README.md#SudoHeader), [SudoParam](../README.md#SudoParam), [TOTPHeader](../README.md#TOTPHeader), [Token](../README.md#Token) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +## org_edit_label + +> crate::models::Label org_edit_label(org, id, body) +Update a label + +### Parameters + + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**org** | **String** | name of the organization | [required] | +**id** | **i64** | id of the label to edit | [required] | +**body** | Option<[**EditLabelOption**](EditLabelOption.md)> | | | + +### Return type + +[**crate::models::Label**](Label.md) + +### Authorization + +[AccessToken](../README.md#AccessToken), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [BasicAuth](../README.md#BasicAuth), [SudoHeader](../README.md#SudoHeader), [SudoParam](../README.md#SudoParam), [TOTPHeader](../README.md#TOTPHeader), [Token](../README.md#Token) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +## org_edit_team + +> crate::models::Team org_edit_team(id, body) +Edit a team + +### Parameters + + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**id** | **i32** | id of the team to edit | [required] | +**body** | Option<[**EditTeamOption**](EditTeamOption.md)> | | | + +### Return type + +[**crate::models::Team**](Team.md) + +### Authorization + +[AccessToken](../README.md#AccessToken), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [BasicAuth](../README.md#BasicAuth), [SudoHeader](../README.md#SudoHeader), [SudoParam](../README.md#SudoParam), [TOTPHeader](../README.md#TOTPHeader), [Token](../README.md#Token) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +## org_get + +> crate::models::Organization org_get(org) +Get an organization + +### Parameters + + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**org** | **String** | name of the organization to get | [required] | + +### Return type + +[**crate::models::Organization**](Organization.md) + +### Authorization + +[AccessToken](../README.md#AccessToken), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [BasicAuth](../README.md#BasicAuth), [SudoHeader](../README.md#SudoHeader), [SudoParam](../README.md#SudoParam), [TOTPHeader](../README.md#TOTPHeader), [Token](../README.md#Token) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +## org_get_all + +> Vec org_get_all(page, limit) +Get list of organizations + +### Parameters + + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**page** | Option<**i32**> | page number of results to return (1-based) | | +**limit** | Option<**i32**> | page size of results | | + +### Return type + +[**Vec**](Organization.md) + +### Authorization + +[AccessToken](../README.md#AccessToken), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [BasicAuth](../README.md#BasicAuth), [SudoHeader](../README.md#SudoHeader), [SudoParam](../README.md#SudoParam), [TOTPHeader](../README.md#TOTPHeader), [Token](../README.md#Token) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +## org_get_hook + +> crate::models::Hook org_get_hook(org, id) +Get a hook + +### Parameters + + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**org** | **String** | name of the organization | [required] | +**id** | **i64** | id of the hook to get | [required] | + +### Return type + +[**crate::models::Hook**](Hook.md) + +### Authorization + +[AccessToken](../README.md#AccessToken), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [BasicAuth](../README.md#BasicAuth), [SudoHeader](../README.md#SudoHeader), [SudoParam](../README.md#SudoParam), [TOTPHeader](../README.md#TOTPHeader), [Token](../README.md#Token) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +## org_get_label + +> crate::models::Label org_get_label(org, id) +Get a single label + +### Parameters + + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**org** | **String** | name of the organization | [required] | +**id** | **i64** | id of the label to get | [required] | + +### Return type + +[**crate::models::Label**](Label.md) + +### Authorization + +[AccessToken](../README.md#AccessToken), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [BasicAuth](../README.md#BasicAuth), [SudoHeader](../README.md#SudoHeader), [SudoParam](../README.md#SudoParam), [TOTPHeader](../README.md#TOTPHeader), [Token](../README.md#Token) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +## org_get_team + +> crate::models::Team org_get_team(id) +Get a team + +### Parameters + + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**id** | **i64** | id of the team to get | [required] | + +### Return type + +[**crate::models::Team**](Team.md) + +### Authorization + +[AccessToken](../README.md#AccessToken), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [BasicAuth](../README.md#BasicAuth), [SudoHeader](../README.md#SudoHeader), [SudoParam](../README.md#SudoParam), [TOTPHeader](../README.md#TOTPHeader), [Token](../README.md#Token) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +## org_get_user_permissions + +> crate::models::OrganizationPermissions org_get_user_permissions(username, org) +Get user permissions in organization + +### Parameters + + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**username** | **String** | username of user | [required] | +**org** | **String** | name of the organization | [required] | + +### Return type + +[**crate::models::OrganizationPermissions**](OrganizationPermissions.md) + +### Authorization + +[AccessToken](../README.md#AccessToken), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [BasicAuth](../README.md#BasicAuth), [SudoHeader](../README.md#SudoHeader), [SudoParam](../README.md#SudoParam), [TOTPHeader](../README.md#TOTPHeader), [Token](../README.md#Token) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +## org_is_member + +> org_is_member(org, username) +Check if a user is a member of an organization + +### Parameters + + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**org** | **String** | name of the organization | [required] | +**username** | **String** | username of the user | [required] | + +### Return type + + (empty response body) + +### Authorization + +[AccessToken](../README.md#AccessToken), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [BasicAuth](../README.md#BasicAuth), [SudoHeader](../README.md#SudoHeader), [SudoParam](../README.md#SudoParam), [TOTPHeader](../README.md#TOTPHeader), [Token](../README.md#Token) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: Not defined + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +## org_is_public_member + +> org_is_public_member(org, username) +Check if a user is a public member of an organization + +### Parameters + + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**org** | **String** | name of the organization | [required] | +**username** | **String** | username of the user | [required] | + +### Return type + + (empty response body) + +### Authorization + +[AccessToken](../README.md#AccessToken), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [BasicAuth](../README.md#BasicAuth), [SudoHeader](../README.md#SudoHeader), [SudoParam](../README.md#SudoParam), [TOTPHeader](../README.md#TOTPHeader), [Token](../README.md#Token) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: Not defined + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +## org_list_current_user_orgs + +> Vec org_list_current_user_orgs(page, limit) +List the current user's organizations + +### Parameters + + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**page** | Option<**i32**> | page number of results to return (1-based) | | +**limit** | Option<**i32**> | page size of results | | + +### Return type + +[**Vec**](Organization.md) + +### Authorization + +[AccessToken](../README.md#AccessToken), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [BasicAuth](../README.md#BasicAuth), [SudoHeader](../README.md#SudoHeader), [SudoParam](../README.md#SudoParam), [TOTPHeader](../README.md#TOTPHeader), [Token](../README.md#Token) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +## org_list_hooks + +> Vec org_list_hooks(org, page, limit) +List an organization's webhooks + +### Parameters + + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**org** | **String** | name of the organization | [required] | +**page** | Option<**i32**> | page number of results to return (1-based) | | +**limit** | Option<**i32**> | page size of results | | + +### Return type + +[**Vec**](Hook.md) + +### Authorization + +[AccessToken](../README.md#AccessToken), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [BasicAuth](../README.md#BasicAuth), [SudoHeader](../README.md#SudoHeader), [SudoParam](../README.md#SudoParam), [TOTPHeader](../README.md#TOTPHeader), [Token](../README.md#Token) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +## org_list_labels + +> Vec org_list_labels(org, page, limit) +List an organization's labels + +### Parameters + + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**org** | **String** | name of the organization | [required] | +**page** | Option<**i32**> | page number of results to return (1-based) | | +**limit** | Option<**i32**> | page size of results | | + +### Return type + +[**Vec**](Label.md) + +### Authorization + +[AccessToken](../README.md#AccessToken), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [BasicAuth](../README.md#BasicAuth), [SudoHeader](../README.md#SudoHeader), [SudoParam](../README.md#SudoParam), [TOTPHeader](../README.md#TOTPHeader), [Token](../README.md#Token) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +## org_list_members + +> Vec org_list_members(org, page, limit) +List an organization's members + +### Parameters + + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**org** | **String** | name of the organization | [required] | +**page** | Option<**i32**> | page number of results to return (1-based) | | +**limit** | Option<**i32**> | page size of results | | + +### Return type + +[**Vec**](User.md) + +### Authorization + +[AccessToken](../README.md#AccessToken), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [BasicAuth](../README.md#BasicAuth), [SudoHeader](../README.md#SudoHeader), [SudoParam](../README.md#SudoParam), [TOTPHeader](../README.md#TOTPHeader), [Token](../README.md#Token) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +## org_list_public_members + +> Vec org_list_public_members(org, page, limit) +List an organization's public members + +### Parameters + + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**org** | **String** | name of the organization | [required] | +**page** | Option<**i32**> | page number of results to return (1-based) | | +**limit** | Option<**i32**> | page size of results | | + +### Return type + +[**Vec**](User.md) + +### Authorization + +[AccessToken](../README.md#AccessToken), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [BasicAuth](../README.md#BasicAuth), [SudoHeader](../README.md#SudoHeader), [SudoParam](../README.md#SudoParam), [TOTPHeader](../README.md#TOTPHeader), [Token](../README.md#Token) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +## org_list_repos + +> Vec org_list_repos(org, page, limit) +List an organization's repos + +### Parameters + + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**org** | **String** | name of the organization | [required] | +**page** | Option<**i32**> | page number of results to return (1-based) | | +**limit** | Option<**i32**> | page size of results | | + +### Return type + +[**Vec**](Repository.md) + +### Authorization + +[AccessToken](../README.md#AccessToken), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [BasicAuth](../README.md#BasicAuth), [SudoHeader](../README.md#SudoHeader), [SudoParam](../README.md#SudoParam), [TOTPHeader](../README.md#TOTPHeader), [Token](../README.md#Token) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +## org_list_team_member + +> crate::models::User org_list_team_member(id, username) +List a particular member of team + +### Parameters + + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**id** | **i64** | id of the team | [required] | +**username** | **String** | username of the member to list | [required] | + +### Return type + +[**crate::models::User**](User.md) + +### Authorization + +[AccessToken](../README.md#AccessToken), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [BasicAuth](../README.md#BasicAuth), [SudoHeader](../README.md#SudoHeader), [SudoParam](../README.md#SudoParam), [TOTPHeader](../README.md#TOTPHeader), [Token](../README.md#Token) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +## org_list_team_members + +> Vec org_list_team_members(id, page, limit) +List a team's members + +### Parameters + + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**id** | **i64** | id of the team | [required] | +**page** | Option<**i32**> | page number of results to return (1-based) | | +**limit** | Option<**i32**> | page size of results | | + +### Return type + +[**Vec**](User.md) + +### Authorization + +[AccessToken](../README.md#AccessToken), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [BasicAuth](../README.md#BasicAuth), [SudoHeader](../README.md#SudoHeader), [SudoParam](../README.md#SudoParam), [TOTPHeader](../README.md#TOTPHeader), [Token](../README.md#Token) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +## org_list_team_repo + +> crate::models::Repository org_list_team_repo(id, org, repo) +List a particular repo of team + +### Parameters + + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**id** | **i64** | id of the team | [required] | +**org** | **String** | organization that owns the repo to list | [required] | +**repo** | **String** | name of the repo to list | [required] | + +### Return type + +[**crate::models::Repository**](Repository.md) + +### Authorization + +[AccessToken](../README.md#AccessToken), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [BasicAuth](../README.md#BasicAuth), [SudoHeader](../README.md#SudoHeader), [SudoParam](../README.md#SudoParam), [TOTPHeader](../README.md#TOTPHeader), [Token](../README.md#Token) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +## org_list_team_repos + +> Vec org_list_team_repos(id, page, limit) +List a team's repos + +### Parameters + + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**id** | **i64** | id of the team | [required] | +**page** | Option<**i32**> | page number of results to return (1-based) | | +**limit** | Option<**i32**> | page size of results | | + +### Return type + +[**Vec**](Repository.md) + +### Authorization + +[AccessToken](../README.md#AccessToken), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [BasicAuth](../README.md#BasicAuth), [SudoHeader](../README.md#SudoHeader), [SudoParam](../README.md#SudoParam), [TOTPHeader](../README.md#TOTPHeader), [Token](../README.md#Token) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +## org_list_teams + +> Vec org_list_teams(org, page, limit) +List an organization's teams + +### Parameters + + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**org** | **String** | name of the organization | [required] | +**page** | Option<**i32**> | page number of results to return (1-based) | | +**limit** | Option<**i32**> | page size of results | | + +### Return type + +[**Vec**](Team.md) + +### Authorization + +[AccessToken](../README.md#AccessToken), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [BasicAuth](../README.md#BasicAuth), [SudoHeader](../README.md#SudoHeader), [SudoParam](../README.md#SudoParam), [TOTPHeader](../README.md#TOTPHeader), [Token](../README.md#Token) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +## org_list_user_orgs + +> Vec org_list_user_orgs(username, page, limit) +List a user's organizations + +### Parameters + + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**username** | **String** | username of user | [required] | +**page** | Option<**i32**> | page number of results to return (1-based) | | +**limit** | Option<**i32**> | page size of results | | + +### Return type + +[**Vec**](Organization.md) + +### Authorization + +[AccessToken](../README.md#AccessToken), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [BasicAuth](../README.md#BasicAuth), [SudoHeader](../README.md#SudoHeader), [SudoParam](../README.md#SudoParam), [TOTPHeader](../README.md#TOTPHeader), [Token](../README.md#Token) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +## org_publicize_member + +> org_publicize_member(org, username) +Publicize a user's membership + +### Parameters + + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**org** | **String** | name of the organization | [required] | +**username** | **String** | username of the user | [required] | + +### Return type + + (empty response body) + +### Authorization + +[AccessToken](../README.md#AccessToken), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [BasicAuth](../README.md#BasicAuth), [SudoHeader](../README.md#SudoHeader), [SudoParam](../README.md#SudoParam), [TOTPHeader](../README.md#TOTPHeader), [Token](../README.md#Token) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: Not defined + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +## org_remove_team_member + +> org_remove_team_member(id, username) +Remove a team member + +### Parameters + + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**id** | **i64** | id of the team | [required] | +**username** | **String** | username of the user to remove | [required] | + +### Return type + + (empty response body) + +### Authorization + +[AccessToken](../README.md#AccessToken), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [BasicAuth](../README.md#BasicAuth), [SudoHeader](../README.md#SudoHeader), [SudoParam](../README.md#SudoParam), [TOTPHeader](../README.md#TOTPHeader), [Token](../README.md#Token) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: Not defined + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +## org_remove_team_repository + +> org_remove_team_repository(id, org, repo) +Remove a repository from a team + +This does not delete the repository, it only removes the repository from the team. + +### Parameters + + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**id** | **i64** | id of the team | [required] | +**org** | **String** | organization that owns the repo to remove | [required] | +**repo** | **String** | name of the repo to remove | [required] | + +### Return type + + (empty response body) + +### Authorization + +[AccessToken](../README.md#AccessToken), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [BasicAuth](../README.md#BasicAuth), [SudoHeader](../README.md#SudoHeader), [SudoParam](../README.md#SudoParam), [TOTPHeader](../README.md#TOTPHeader), [Token](../README.md#Token) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: Not defined + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +## team_search + +> crate::models::TeamSearch200Response team_search(org, q, include_desc, page, limit) +Search for teams within an organization + +### Parameters + + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**org** | **String** | name of the organization | [required] | +**q** | Option<**String**> | keywords to search | | +**include_desc** | Option<**bool**> | include search within team description (defaults to true) | | +**page** | Option<**i32**> | page number of results to return (1-based) | | +**limit** | Option<**i32**> | page size of results | | + +### Return type + +[**crate::models::TeamSearch200Response**](teamSearch_200_response.md) + +### Authorization + +[AccessToken](../README.md#AccessToken), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [BasicAuth](../README.md#BasicAuth), [SudoHeader](../README.md#SudoHeader), [SudoParam](../README.md#SudoParam), [TOTPHeader](../README.md#TOTPHeader), [Token](../README.md#Token) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + diff --git a/crates/gitea_raw_client/docs/OrganizationPermissions.md b/crates/gitea_raw_client/docs/OrganizationPermissions.md new file mode 100644 index 0000000..7a964fa --- /dev/null +++ b/crates/gitea_raw_client/docs/OrganizationPermissions.md @@ -0,0 +1,15 @@ +# OrganizationPermissions + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**can_create_repository** | Option<**bool**> | | [optional] +**can_read** | Option<**bool**> | | [optional] +**can_write** | Option<**bool**> | | [optional] +**is_admin** | Option<**bool**> | | [optional] +**is_owner** | Option<**bool**> | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/crates/gitea_raw_client/docs/Package.md b/crates/gitea_raw_client/docs/Package.md new file mode 100644 index 0000000..13f066f --- /dev/null +++ b/crates/gitea_raw_client/docs/Package.md @@ -0,0 +1,18 @@ +# Package + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**created_at** | Option<**String**> | | [optional] +**creator** | Option<[**crate::models::User**](User.md)> | | [optional] +**id** | Option<**i64**> | | [optional] +**name** | Option<**String**> | | [optional] +**owner** | Option<[**crate::models::User**](User.md)> | | [optional] +**repository** | Option<[**crate::models::Repository**](Repository.md)> | | [optional] +**r#type** | Option<**String**> | | [optional] +**version** | Option<**String**> | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/crates/gitea_raw_client/docs/PackageApi.md b/crates/gitea_raw_client/docs/PackageApi.md new file mode 100644 index 0000000..51f3212 --- /dev/null +++ b/crates/gitea_raw_client/docs/PackageApi.md @@ -0,0 +1,137 @@ +# \PackageApi + +All URIs are relative to */api/v1* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**delete_package**](PackageApi.md#delete_package) | **DELETE** /packages/{owner}/{type}/{name}/{version} | Delete a package +[**get_package**](PackageApi.md#get_package) | **GET** /packages/{owner}/{type}/{name}/{version} | Gets a package +[**list_package_files**](PackageApi.md#list_package_files) | **GET** /packages/{owner}/{type}/{name}/{version}/files | Gets all files of a package +[**list_packages**](PackageApi.md#list_packages) | **GET** /packages/{owner} | Gets all packages of an owner + + + +## delete_package + +> delete_package(owner, r#type, name, version) +Delete a package + +### Parameters + + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**owner** | **String** | owner of the package | [required] | +**r#type** | **String** | type of the package | [required] | +**name** | **String** | name of the package | [required] | +**version** | **String** | version of the package | [required] | + +### Return type + + (empty response body) + +### Authorization + +[AccessToken](../README.md#AccessToken), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [BasicAuth](../README.md#BasicAuth), [SudoHeader](../README.md#SudoHeader), [SudoParam](../README.md#SudoParam), [TOTPHeader](../README.md#TOTPHeader), [Token](../README.md#Token) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: Not defined + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +## get_package + +> crate::models::Package get_package(owner, r#type, name, version) +Gets a package + +### Parameters + + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**owner** | **String** | owner of the package | [required] | +**r#type** | **String** | type of the package | [required] | +**name** | **String** | name of the package | [required] | +**version** | **String** | version of the package | [required] | + +### Return type + +[**crate::models::Package**](Package.md) + +### Authorization + +[AccessToken](../README.md#AccessToken), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [BasicAuth](../README.md#BasicAuth), [SudoHeader](../README.md#SudoHeader), [SudoParam](../README.md#SudoParam), [TOTPHeader](../README.md#TOTPHeader), [Token](../README.md#Token) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +## list_package_files + +> Vec list_package_files(owner, r#type, name, version) +Gets all files of a package + +### Parameters + + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**owner** | **String** | owner of the package | [required] | +**r#type** | **String** | type of the package | [required] | +**name** | **String** | name of the package | [required] | +**version** | **String** | version of the package | [required] | + +### Return type + +[**Vec**](PackageFile.md) + +### Authorization + +[AccessToken](../README.md#AccessToken), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [BasicAuth](../README.md#BasicAuth), [SudoHeader](../README.md#SudoHeader), [SudoParam](../README.md#SudoParam), [TOTPHeader](../README.md#TOTPHeader), [Token](../README.md#Token) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +## list_packages + +> Vec list_packages(owner, page, limit, r#type, q) +Gets all packages of an owner + +### Parameters + + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**owner** | **String** | owner of the packages | [required] | +**page** | Option<**i32**> | page number of results to return (1-based) | | +**limit** | Option<**i32**> | page size of results | | +**r#type** | Option<**String**> | package type filter | | +**q** | Option<**String**> | name filter | | + +### Return type + +[**Vec**](Package.md) + +### Authorization + +[AccessToken](../README.md#AccessToken), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [BasicAuth](../README.md#BasicAuth), [SudoHeader](../README.md#SudoHeader), [SudoParam](../README.md#SudoParam), [TOTPHeader](../README.md#TOTPHeader), [Token](../README.md#Token) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + diff --git a/crates/gitea_raw_client/docs/PackageFile.md b/crates/gitea_raw_client/docs/PackageFile.md new file mode 100644 index 0000000..772bfb0 --- /dev/null +++ b/crates/gitea_raw_client/docs/PackageFile.md @@ -0,0 +1,17 @@ +# PackageFile + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**size** | Option<**i64**> | | [optional] +**id** | Option<**i64**> | | [optional] +**md5** | Option<**String**> | | [optional] +**name** | Option<**String**> | | [optional] +**sha1** | Option<**String**> | | [optional] +**sha256** | Option<**String**> | | [optional] +**sha512** | Option<**String**> | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/crates/gitea_raw_client/docs/PayloadCommit.md b/crates/gitea_raw_client/docs/PayloadCommit.md new file mode 100644 index 0000000..3feb953 --- /dev/null +++ b/crates/gitea_raw_client/docs/PayloadCommit.md @@ -0,0 +1,20 @@ +# PayloadCommit + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**added** | Option<**Vec**> | | [optional] +**author** | Option<[**crate::models::PayloadUser**](PayloadUser.md)> | | [optional] +**committer** | Option<[**crate::models::PayloadUser**](PayloadUser.md)> | | [optional] +**id** | Option<**String**> | sha1 hash of the commit | [optional] +**message** | Option<**String**> | | [optional] +**modified** | Option<**Vec**> | | [optional] +**removed** | Option<**Vec**> | | [optional] +**timestamp** | Option<**String**> | | [optional] +**url** | Option<**String**> | | [optional] +**verification** | Option<[**crate::models::PayloadCommitVerification**](PayloadCommitVerification.md)> | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/crates/gitea_raw_client/docs/PayloadCommitVerification.md b/crates/gitea_raw_client/docs/PayloadCommitVerification.md new file mode 100644 index 0000000..743f805 --- /dev/null +++ b/crates/gitea_raw_client/docs/PayloadCommitVerification.md @@ -0,0 +1,15 @@ +# PayloadCommitVerification + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**payload** | Option<**String**> | | [optional] +**reason** | Option<**String**> | | [optional] +**signature** | Option<**String**> | | [optional] +**signer** | Option<[**crate::models::PayloadUser**](PayloadUser.md)> | | [optional] +**verified** | Option<**bool**> | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/crates/gitea_raw_client/docs/PayloadUser.md b/crates/gitea_raw_client/docs/PayloadUser.md new file mode 100644 index 0000000..2a1065b --- /dev/null +++ b/crates/gitea_raw_client/docs/PayloadUser.md @@ -0,0 +1,13 @@ +# PayloadUser + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**email** | Option<**String**> | | [optional] +**name** | Option<**String**> | Full name of the commit author | [optional] +**username** | Option<**String**> | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/crates/gitea_raw_client/docs/Permission.md b/crates/gitea_raw_client/docs/Permission.md new file mode 100644 index 0000000..88c2032 --- /dev/null +++ b/crates/gitea_raw_client/docs/Permission.md @@ -0,0 +1,13 @@ +# Permission + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**admin** | Option<**bool**> | | [optional] +**pull** | Option<**bool**> | | [optional] +**push** | Option<**bool**> | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/crates/gitea_raw_client/docs/PrBranchInfo.md b/crates/gitea_raw_client/docs/PrBranchInfo.md new file mode 100644 index 0000000..f143a48 --- /dev/null +++ b/crates/gitea_raw_client/docs/PrBranchInfo.md @@ -0,0 +1,15 @@ +# PrBranchInfo + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**label** | Option<**String**> | | [optional] +**r#ref** | Option<**String**> | | [optional] +**repo** | Option<[**crate::models::Repository**](Repository.md)> | | [optional] +**repo_id** | Option<**i64**> | | [optional] +**sha** | Option<**String**> | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/crates/gitea_raw_client/docs/PublicKey.md b/crates/gitea_raw_client/docs/PublicKey.md new file mode 100644 index 0000000..90ce9fd --- /dev/null +++ b/crates/gitea_raw_client/docs/PublicKey.md @@ -0,0 +1,19 @@ +# PublicKey + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**created_at** | Option<**String**> | | [optional] +**fingerprint** | Option<**String**> | | [optional] +**id** | Option<**i64**> | | [optional] +**key** | Option<**String**> | | [optional] +**key_type** | Option<**String**> | | [optional] +**read_only** | Option<**bool**> | | [optional] +**title** | Option<**String**> | | [optional] +**url** | Option<**String**> | | [optional] +**user** | Option<[**crate::models::User**](User.md)> | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/crates/gitea_raw_client/docs/PullRequest.md b/crates/gitea_raw_client/docs/PullRequest.md new file mode 100644 index 0000000..4a564bc --- /dev/null +++ b/crates/gitea_raw_client/docs/PullRequest.md @@ -0,0 +1,39 @@ +# PullRequest + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**allow_maintainer_edit** | Option<**bool**> | | [optional] +**assignee** | Option<[**crate::models::User**](User.md)> | | [optional] +**assignees** | Option<[**Vec**](User.md)> | | [optional] +**base** | Option<[**crate::models::PrBranchInfo**](PRBranchInfo.md)> | | [optional] +**body** | Option<**String**> | | [optional] +**closed_at** | Option<**String**> | | [optional] +**comments** | Option<**i64**> | | [optional] +**created_at** | Option<**String**> | | [optional] +**diff_url** | Option<**String**> | | [optional] +**due_date** | Option<**String**> | | [optional] +**head** | Option<[**crate::models::PrBranchInfo**](PRBranchInfo.md)> | | [optional] +**html_url** | Option<**String**> | | [optional] +**id** | Option<**i64**> | | [optional] +**is_locked** | Option<**bool**> | | [optional] +**labels** | Option<[**Vec**](Label.md)> | | [optional] +**merge_base** | Option<**String**> | | [optional] +**merge_commit_sha** | Option<**String**> | | [optional] +**mergeable** | Option<**bool**> | | [optional] +**merged** | Option<**bool**> | | [optional] +**merged_at** | Option<**String**> | | [optional] +**merged_by** | Option<[**crate::models::User**](User.md)> | | [optional] +**milestone** | Option<[**crate::models::Milestone**](Milestone.md)> | | [optional] +**number** | Option<**i64**> | | [optional] +**patch_url** | Option<**String**> | | [optional] +**state** | Option<**String**> | StateType issue state type | [optional] +**title** | Option<**String**> | | [optional] +**updated_at** | Option<**String**> | | [optional] +**url** | Option<**String**> | | [optional] +**user** | Option<[**crate::models::User**](User.md)> | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/crates/gitea_raw_client/docs/PullRequestMeta.md b/crates/gitea_raw_client/docs/PullRequestMeta.md new file mode 100644 index 0000000..844f687 --- /dev/null +++ b/crates/gitea_raw_client/docs/PullRequestMeta.md @@ -0,0 +1,12 @@ +# PullRequestMeta + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**merged** | Option<**bool**> | | [optional] +**merged_at** | Option<**String**> | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/crates/gitea_raw_client/docs/PullReview.md b/crates/gitea_raw_client/docs/PullReview.md new file mode 100644 index 0000000..f7d78a3 --- /dev/null +++ b/crates/gitea_raw_client/docs/PullReview.md @@ -0,0 +1,23 @@ +# PullReview + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**body** | Option<**String**> | | [optional] +**comments_count** | Option<**i64**> | | [optional] +**commit_id** | Option<**String**> | | [optional] +**dismissed** | Option<**bool**> | | [optional] +**html_url** | Option<**String**> | | [optional] +**id** | Option<**i64**> | | [optional] +**official** | Option<**bool**> | | [optional] +**pull_request_url** | Option<**String**> | | [optional] +**stale** | Option<**bool**> | | [optional] +**state** | Option<**String**> | ReviewStateType review state type | [optional] +**submitted_at** | Option<**String**> | | [optional] +**team** | Option<[**crate::models::Team**](Team.md)> | | [optional] +**user** | Option<[**crate::models::User**](User.md)> | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/crates/gitea_raw_client/docs/PullReviewComment.md b/crates/gitea_raw_client/docs/PullReviewComment.md new file mode 100644 index 0000000..9afca36 --- /dev/null +++ b/crates/gitea_raw_client/docs/PullReviewComment.md @@ -0,0 +1,25 @@ +# PullReviewComment + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**body** | Option<**String**> | | [optional] +**commit_id** | Option<**String**> | | [optional] +**created_at** | Option<**String**> | | [optional] +**diff_hunk** | Option<**String**> | | [optional] +**html_url** | Option<**String**> | | [optional] +**id** | Option<**i64**> | | [optional] +**original_commit_id** | Option<**String**> | | [optional] +**original_position** | Option<**i32**> | | [optional] +**path** | Option<**String**> | | [optional] +**position** | Option<**i32**> | | [optional] +**pull_request_review_id** | Option<**i64**> | | [optional] +**pull_request_url** | Option<**String**> | | [optional] +**resolver** | Option<[**crate::models::User**](User.md)> | | [optional] +**updated_at** | Option<**String**> | | [optional] +**user** | Option<[**crate::models::User**](User.md)> | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/crates/gitea_raw_client/docs/PullReviewRequestOptions.md b/crates/gitea_raw_client/docs/PullReviewRequestOptions.md new file mode 100644 index 0000000..8dfc1da --- /dev/null +++ b/crates/gitea_raw_client/docs/PullReviewRequestOptions.md @@ -0,0 +1,12 @@ +# PullReviewRequestOptions + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**reviewers** | Option<**Vec**> | | [optional] +**team_reviewers** | Option<**Vec**> | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/crates/gitea_raw_client/docs/Reaction.md b/crates/gitea_raw_client/docs/Reaction.md new file mode 100644 index 0000000..8595c6b --- /dev/null +++ b/crates/gitea_raw_client/docs/Reaction.md @@ -0,0 +1,13 @@ +# Reaction + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**content** | Option<**String**> | | [optional] +**created_at** | Option<**String**> | | [optional] +**user** | Option<[**crate::models::User**](User.md)> | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/crates/gitea_raw_client/docs/Reference.md b/crates/gitea_raw_client/docs/Reference.md new file mode 100644 index 0000000..bae349e --- /dev/null +++ b/crates/gitea_raw_client/docs/Reference.md @@ -0,0 +1,13 @@ +# Reference + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**object** | Option<[**crate::models::GitObject**](GitObject.md)> | | [optional] +**r#ref** | Option<**String**> | | [optional] +**url** | Option<**String**> | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/crates/gitea_raw_client/docs/Release.md b/crates/gitea_raw_client/docs/Release.md new file mode 100644 index 0000000..9116dfa --- /dev/null +++ b/crates/gitea_raw_client/docs/Release.md @@ -0,0 +1,25 @@ +# Release + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**assets** | Option<[**Vec**](Attachment.md)> | | [optional] +**author** | Option<[**crate::models::User**](User.md)> | | [optional] +**body** | Option<**String**> | | [optional] +**created_at** | Option<**String**> | | [optional] +**draft** | Option<**bool**> | | [optional] +**html_url** | Option<**String**> | | [optional] +**id** | Option<**i64**> | | [optional] +**name** | Option<**String**> | | [optional] +**prerelease** | Option<**bool**> | | [optional] +**published_at** | Option<**String**> | | [optional] +**tag_name** | Option<**String**> | | [optional] +**tarball_url** | Option<**String**> | | [optional] +**target_commitish** | Option<**String**> | | [optional] +**url** | Option<**String**> | | [optional] +**zipball_url** | Option<**String**> | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/crates/gitea_raw_client/docs/RepoCollaboratorPermission.md b/crates/gitea_raw_client/docs/RepoCollaboratorPermission.md new file mode 100644 index 0000000..b7964ed --- /dev/null +++ b/crates/gitea_raw_client/docs/RepoCollaboratorPermission.md @@ -0,0 +1,13 @@ +# RepoCollaboratorPermission + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**permission** | Option<**String**> | | [optional] +**role_name** | Option<**String**> | | [optional] +**user** | Option<[**crate::models::User**](User.md)> | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/crates/gitea_raw_client/docs/RepoCommit.md b/crates/gitea_raw_client/docs/RepoCommit.md new file mode 100644 index 0000000..777d77b --- /dev/null +++ b/crates/gitea_raw_client/docs/RepoCommit.md @@ -0,0 +1,16 @@ +# RepoCommit + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**author** | Option<[**crate::models::CommitUser**](CommitUser.md)> | | [optional] +**committer** | Option<[**crate::models::CommitUser**](CommitUser.md)> | | [optional] +**message** | Option<**String**> | | [optional] +**tree** | Option<[**crate::models::CommitMeta**](CommitMeta.md)> | | [optional] +**url** | Option<**String**> | | [optional] +**verification** | Option<[**crate::models::PayloadCommitVerification**](PayloadCommitVerification.md)> | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/crates/gitea_raw_client/docs/RepoTopicOptions.md b/crates/gitea_raw_client/docs/RepoTopicOptions.md new file mode 100644 index 0000000..3811737 --- /dev/null +++ b/crates/gitea_raw_client/docs/RepoTopicOptions.md @@ -0,0 +1,11 @@ +# RepoTopicOptions + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**topics** | Option<**Vec**> | list of topic names | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/crates/gitea_raw_client/docs/RepoTransfer.md b/crates/gitea_raw_client/docs/RepoTransfer.md new file mode 100644 index 0000000..37d1329 --- /dev/null +++ b/crates/gitea_raw_client/docs/RepoTransfer.md @@ -0,0 +1,13 @@ +# RepoTransfer + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**doer** | Option<[**crate::models::User**](User.md)> | | [optional] +**recipient** | Option<[**crate::models::User**](User.md)> | | [optional] +**teams** | Option<[**Vec**](Team.md)> | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/crates/gitea_raw_client/docs/Repository.md b/crates/gitea_raw_client/docs/Repository.md new file mode 100644 index 0000000..eed14d3 --- /dev/null +++ b/crates/gitea_raw_client/docs/Repository.md @@ -0,0 +1,58 @@ +# Repository + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**allow_merge_commits** | Option<**bool**> | | [optional] +**allow_rebase** | Option<**bool**> | | [optional] +**allow_rebase_explicit** | Option<**bool**> | | [optional] +**allow_squash_merge** | Option<**bool**> | | [optional] +**archived** | Option<**bool**> | | [optional] +**avatar_url** | Option<**String**> | | [optional] +**clone_url** | Option<**String**> | | [optional] +**created_at** | Option<**String**> | | [optional] +**default_branch** | Option<**String**> | | [optional] +**default_merge_style** | Option<**String**> | | [optional] +**description** | Option<**String**> | | [optional] +**empty** | Option<**bool**> | | [optional] +**external_tracker** | Option<[**crate::models::ExternalTracker**](ExternalTracker.md)> | | [optional] +**external_wiki** | Option<[**crate::models::ExternalWiki**](ExternalWiki.md)> | | [optional] +**fork** | Option<**bool**> | | [optional] +**forks_count** | Option<**i64**> | | [optional] +**full_name** | Option<**String**> | | [optional] +**has_issues** | Option<**bool**> | | [optional] +**has_projects** | Option<**bool**> | | [optional] +**has_pull_requests** | Option<**bool**> | | [optional] +**has_wiki** | Option<**bool**> | | [optional] +**html_url** | Option<**String**> | | [optional] +**id** | Option<**i64**> | | [optional] +**ignore_whitespace_conflicts** | Option<**bool**> | | [optional] +**internal** | Option<**bool**> | | [optional] +**internal_tracker** | Option<[**crate::models::InternalTracker**](InternalTracker.md)> | | [optional] +**language** | Option<**String**> | | [optional] +**languages_url** | Option<**String**> | | [optional] +**mirror** | Option<**bool**> | | [optional] +**mirror_interval** | Option<**String**> | | [optional] +**mirror_updated** | Option<**String**> | | [optional] +**name** | Option<**String**> | | [optional] +**open_issues_count** | Option<**i64**> | | [optional] +**open_pr_counter** | Option<**i64**> | | [optional] +**original_url** | Option<**String**> | | [optional] +**owner** | Option<[**crate::models::User**](User.md)> | | [optional] +**parent** | Option<[**crate::models::Repository**](Repository.md)> | | [optional] +**permissions** | Option<[**crate::models::Permission**](Permission.md)> | | [optional] +**private** | Option<**bool**> | | [optional] +**release_counter** | Option<**i64**> | | [optional] +**repo_transfer** | Option<[**crate::models::RepoTransfer**](RepoTransfer.md)> | | [optional] +**size** | Option<**i64**> | | [optional] +**ssh_url** | Option<**String**> | | [optional] +**stars_count** | Option<**i64**> | | [optional] +**template** | Option<**bool**> | | [optional] +**updated_at** | Option<**String**> | | [optional] +**watchers_count** | Option<**i64**> | | [optional] +**website** | Option<**String**> | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/crates/gitea_raw_client/docs/RepositoryApi.md b/crates/gitea_raw_client/docs/RepositoryApi.md new file mode 100644 index 0000000..64d4f46 --- /dev/null +++ b/crates/gitea_raw_client/docs/RepositoryApi.md @@ -0,0 +1,4051 @@ +# \RepositoryApi + +All URIs are relative to */api/v1* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**accept_repo_transfer**](RepositoryApi.md#accept_repo_transfer) | **POST** /repos/{owner}/{repo}/transfer/accept | Accept a repo transfer +[**create_current_user_repo**](RepositoryApi.md#create_current_user_repo) | **POST** /user/repos | Create a repository +[**create_fork**](RepositoryApi.md#create_fork) | **POST** /repos/{owner}/{repo}/forks | Fork a repository +[**generate_repo**](RepositoryApi.md#generate_repo) | **POST** /repos/{template_owner}/{template_repo}/generate | Create a repository using a template +[**get_annotated_tag**](RepositoryApi.md#get_annotated_tag) | **GET** /repos/{owner}/{repo}/git/tags/{sha} | Gets the tag object of an annotated tag (not lightweight tags) +[**get_blob**](RepositoryApi.md#get_blob) | **GET** /repos/{owner}/{repo}/git/blobs/{sha} | Gets the blob of a repository. +[**get_tree**](RepositoryApi.md#get_tree) | **GET** /repos/{owner}/{repo}/git/trees/{sha} | Gets the tree of a repository. +[**list_forks**](RepositoryApi.md#list_forks) | **GET** /repos/{owner}/{repo}/forks | List a repository's forks +[**reject_repo_transfer**](RepositoryApi.md#reject_repo_transfer) | **POST** /repos/{owner}/{repo}/transfer/reject | Reject a repo transfer +[**repo_add_collaborator**](RepositoryApi.md#repo_add_collaborator) | **PUT** /repos/{owner}/{repo}/collaborators/{collaborator} | Add a collaborator to a repository +[**repo_add_team**](RepositoryApi.md#repo_add_team) | **PUT** /repos/{owner}/{repo}/teams/{team} | Add a team to a repository +[**repo_add_topic**](RepositoryApi.md#repo_add_topic) | **PUT** /repos/{owner}/{repo}/topics/{topic} | Add a topic to a repository +[**repo_apply_diff_patch**](RepositoryApi.md#repo_apply_diff_patch) | **POST** /repos/{owner}/{repo}/diffpatch | Apply diff patch to repository +[**repo_cancel_scheduled_auto_merge**](RepositoryApi.md#repo_cancel_scheduled_auto_merge) | **DELETE** /repos/{owner}/{repo}/pulls/{index}/merge | Cancel the scheduled auto merge for the given pull request +[**repo_check_collaborator**](RepositoryApi.md#repo_check_collaborator) | **GET** /repos/{owner}/{repo}/collaborators/{collaborator} | Check if a user is a collaborator of a repository +[**repo_check_team**](RepositoryApi.md#repo_check_team) | **GET** /repos/{owner}/{repo}/teams/{team} | Check if a team is assigned to a repository +[**repo_create_branch**](RepositoryApi.md#repo_create_branch) | **POST** /repos/{owner}/{repo}/branches | Create a branch +[**repo_create_branch_protection**](RepositoryApi.md#repo_create_branch_protection) | **POST** /repos/{owner}/{repo}/branch_protections | Create a branch protections for a repository +[**repo_create_file**](RepositoryApi.md#repo_create_file) | **POST** /repos/{owner}/{repo}/contents/{filepath} | Create a file in a repository +[**repo_create_hook**](RepositoryApi.md#repo_create_hook) | **POST** /repos/{owner}/{repo}/hooks | Create a hook +[**repo_create_key**](RepositoryApi.md#repo_create_key) | **POST** /repos/{owner}/{repo}/keys | Add a key to a repository +[**repo_create_pull_request**](RepositoryApi.md#repo_create_pull_request) | **POST** /repos/{owner}/{repo}/pulls | Create a pull request +[**repo_create_pull_review**](RepositoryApi.md#repo_create_pull_review) | **POST** /repos/{owner}/{repo}/pulls/{index}/reviews | Create a review to an pull request +[**repo_create_pull_review_requests**](RepositoryApi.md#repo_create_pull_review_requests) | **POST** /repos/{owner}/{repo}/pulls/{index}/requested_reviewers | create review requests for a pull request +[**repo_create_release**](RepositoryApi.md#repo_create_release) | **POST** /repos/{owner}/{repo}/releases | Create a release +[**repo_create_release_attachment**](RepositoryApi.md#repo_create_release_attachment) | **POST** /repos/{owner}/{repo}/releases/{id}/assets | Create a release attachment +[**repo_create_status**](RepositoryApi.md#repo_create_status) | **POST** /repos/{owner}/{repo}/statuses/{sha} | Create a commit status +[**repo_create_tag**](RepositoryApi.md#repo_create_tag) | **POST** /repos/{owner}/{repo}/tags | Create a new git tag in a repository +[**repo_create_wiki_page**](RepositoryApi.md#repo_create_wiki_page) | **POST** /repos/{owner}/{repo}/wiki/new | Create a wiki page +[**repo_delete**](RepositoryApi.md#repo_delete) | **DELETE** /repos/{owner}/{repo} | Delete a repository +[**repo_delete_branch**](RepositoryApi.md#repo_delete_branch) | **DELETE** /repos/{owner}/{repo}/branches/{branch} | Delete a specific branch from a repository +[**repo_delete_branch_protection**](RepositoryApi.md#repo_delete_branch_protection) | **DELETE** /repos/{owner}/{repo}/branch_protections/{name} | Delete a specific branch protection for the repository +[**repo_delete_collaborator**](RepositoryApi.md#repo_delete_collaborator) | **DELETE** /repos/{owner}/{repo}/collaborators/{collaborator} | Delete a collaborator from a repository +[**repo_delete_file**](RepositoryApi.md#repo_delete_file) | **DELETE** /repos/{owner}/{repo}/contents/{filepath} | Delete a file in a repository +[**repo_delete_git_hook**](RepositoryApi.md#repo_delete_git_hook) | **DELETE** /repos/{owner}/{repo}/hooks/git/{id} | Delete a Git hook in a repository +[**repo_delete_hook**](RepositoryApi.md#repo_delete_hook) | **DELETE** /repos/{owner}/{repo}/hooks/{id} | Delete a hook in a repository +[**repo_delete_key**](RepositoryApi.md#repo_delete_key) | **DELETE** /repos/{owner}/{repo}/keys/{id} | Delete a key from a repository +[**repo_delete_pull_review**](RepositoryApi.md#repo_delete_pull_review) | **DELETE** /repos/{owner}/{repo}/pulls/{index}/reviews/{id} | Delete a specific review from a pull request +[**repo_delete_pull_review_requests**](RepositoryApi.md#repo_delete_pull_review_requests) | **DELETE** /repos/{owner}/{repo}/pulls/{index}/requested_reviewers | cancel review requests for a pull request +[**repo_delete_release**](RepositoryApi.md#repo_delete_release) | **DELETE** /repos/{owner}/{repo}/releases/{id} | Delete a release +[**repo_delete_release_attachment**](RepositoryApi.md#repo_delete_release_attachment) | **DELETE** /repos/{owner}/{repo}/releases/{id}/assets/{attachment_id} | Delete a release attachment +[**repo_delete_release_by_tag**](RepositoryApi.md#repo_delete_release_by_tag) | **DELETE** /repos/{owner}/{repo}/releases/tags/{tag} | Delete a release by tag name +[**repo_delete_tag**](RepositoryApi.md#repo_delete_tag) | **DELETE** /repos/{owner}/{repo}/tags/{tag} | Delete a repository's tag by name +[**repo_delete_team**](RepositoryApi.md#repo_delete_team) | **DELETE** /repos/{owner}/{repo}/teams/{team} | Delete a team from a repository +[**repo_delete_topic**](RepositoryApi.md#repo_delete_topic) | **DELETE** /repos/{owner}/{repo}/topics/{topic} | Delete a topic from a repository +[**repo_delete_wiki_page**](RepositoryApi.md#repo_delete_wiki_page) | **DELETE** /repos/{owner}/{repo}/wiki/page/{pageName} | Delete a wiki page +[**repo_dismiss_pull_review**](RepositoryApi.md#repo_dismiss_pull_review) | **POST** /repos/{owner}/{repo}/pulls/{index}/reviews/{id}/dismissals | Dismiss a review for a pull request +[**repo_download_commit_diff_or_patch**](RepositoryApi.md#repo_download_commit_diff_or_patch) | **GET** /repos/{owner}/{repo}/git/commits/{sha}.{diffType} | Get a commit's diff or patch +[**repo_download_pull_diff_or_patch**](RepositoryApi.md#repo_download_pull_diff_or_patch) | **GET** /repos/{owner}/{repo}/pulls/{index}.{diffType} | Get a pull request diff or patch +[**repo_edit**](RepositoryApi.md#repo_edit) | **PATCH** /repos/{owner}/{repo} | Edit a repository's properties. Only fields that are set will be changed. +[**repo_edit_branch_protection**](RepositoryApi.md#repo_edit_branch_protection) | **PATCH** /repos/{owner}/{repo}/branch_protections/{name} | Edit a branch protections for a repository. Only fields that are set will be changed +[**repo_edit_git_hook**](RepositoryApi.md#repo_edit_git_hook) | **PATCH** /repos/{owner}/{repo}/hooks/git/{id} | Edit a Git hook in a repository +[**repo_edit_hook**](RepositoryApi.md#repo_edit_hook) | **PATCH** /repos/{owner}/{repo}/hooks/{id} | Edit a hook in a repository +[**repo_edit_pull_request**](RepositoryApi.md#repo_edit_pull_request) | **PATCH** /repos/{owner}/{repo}/pulls/{index} | Update a pull request. If using deadline only the date will be taken into account, and time of day ignored. +[**repo_edit_release**](RepositoryApi.md#repo_edit_release) | **PATCH** /repos/{owner}/{repo}/releases/{id} | Update a release +[**repo_edit_release_attachment**](RepositoryApi.md#repo_edit_release_attachment) | **PATCH** /repos/{owner}/{repo}/releases/{id}/assets/{attachment_id} | Edit a release attachment +[**repo_edit_wiki_page**](RepositoryApi.md#repo_edit_wiki_page) | **PATCH** /repos/{owner}/{repo}/wiki/page/{pageName} | Edit a wiki page +[**repo_get**](RepositoryApi.md#repo_get) | **GET** /repos/{owner}/{repo} | Get a repository +[**repo_get_all_commits**](RepositoryApi.md#repo_get_all_commits) | **GET** /repos/{owner}/{repo}/commits | Get a list of all commits from a repository +[**repo_get_archive**](RepositoryApi.md#repo_get_archive) | **GET** /repos/{owner}/{repo}/archive/{archive} | Get an archive of a repository +[**repo_get_assignees**](RepositoryApi.md#repo_get_assignees) | **GET** /repos/{owner}/{repo}/assignees | Return all users that have write access and can be assigned to issues +[**repo_get_branch**](RepositoryApi.md#repo_get_branch) | **GET** /repos/{owner}/{repo}/branches/{branch} | Retrieve a specific branch from a repository, including its effective branch protection +[**repo_get_branch_protection**](RepositoryApi.md#repo_get_branch_protection) | **GET** /repos/{owner}/{repo}/branch_protections/{name} | Get a specific branch protection for the repository +[**repo_get_by_id**](RepositoryApi.md#repo_get_by_id) | **GET** /repositories/{id} | Get a repository by id +[**repo_get_combined_status_by_ref**](RepositoryApi.md#repo_get_combined_status_by_ref) | **GET** /repos/{owner}/{repo}/commits/{ref}/status | Get a commit's combined status, by branch/tag/commit reference +[**repo_get_contents**](RepositoryApi.md#repo_get_contents) | **GET** /repos/{owner}/{repo}/contents/{filepath} | Gets the metadata and contents (if a file) of an entry in a repository, or a list of entries if a dir +[**repo_get_contents_list**](RepositoryApi.md#repo_get_contents_list) | **GET** /repos/{owner}/{repo}/contents | Gets the metadata of all the entries of the root dir +[**repo_get_editor_config**](RepositoryApi.md#repo_get_editor_config) | **GET** /repos/{owner}/{repo}/editorconfig/{filepath} | Get the EditorConfig definitions of a file in a repository +[**repo_get_git_hook**](RepositoryApi.md#repo_get_git_hook) | **GET** /repos/{owner}/{repo}/hooks/git/{id} | Get a Git hook +[**repo_get_hook**](RepositoryApi.md#repo_get_hook) | **GET** /repos/{owner}/{repo}/hooks/{id} | Get a hook +[**repo_get_issue_templates**](RepositoryApi.md#repo_get_issue_templates) | **GET** /repos/{owner}/{repo}/issue_templates | Get available issue templates for a repository +[**repo_get_key**](RepositoryApi.md#repo_get_key) | **GET** /repos/{owner}/{repo}/keys/{id} | Get a repository's key by id +[**repo_get_languages**](RepositoryApi.md#repo_get_languages) | **GET** /repos/{owner}/{repo}/languages | Get languages and number of bytes of code written +[**repo_get_note**](RepositoryApi.md#repo_get_note) | **GET** /repos/{owner}/{repo}/git/notes/{sha} | Get a note corresponding to a single commit from a repository +[**repo_get_pull_request**](RepositoryApi.md#repo_get_pull_request) | **GET** /repos/{owner}/{repo}/pulls/{index} | Get a pull request +[**repo_get_pull_request_commits**](RepositoryApi.md#repo_get_pull_request_commits) | **GET** /repos/{owner}/{repo}/pulls/{index}/commits | Get commits for a pull request +[**repo_get_pull_review**](RepositoryApi.md#repo_get_pull_review) | **GET** /repos/{owner}/{repo}/pulls/{index}/reviews/{id} | Get a specific review for a pull request +[**repo_get_pull_review_comments**](RepositoryApi.md#repo_get_pull_review_comments) | **GET** /repos/{owner}/{repo}/pulls/{index}/reviews/{id}/comments | Get a specific review for a pull request +[**repo_get_raw_file**](RepositoryApi.md#repo_get_raw_file) | **GET** /repos/{owner}/{repo}/raw/{filepath} | Get a file from a repository +[**repo_get_raw_file_or_lfs**](RepositoryApi.md#repo_get_raw_file_or_lfs) | **GET** /repos/{owner}/{repo}/media/{filepath} | Get a file or it's LFS object from a repository +[**repo_get_release**](RepositoryApi.md#repo_get_release) | **GET** /repos/{owner}/{repo}/releases/{id} | Get a release +[**repo_get_release_attachment**](RepositoryApi.md#repo_get_release_attachment) | **GET** /repos/{owner}/{repo}/releases/{id}/assets/{attachment_id} | Get a release attachment +[**repo_get_release_by_tag**](RepositoryApi.md#repo_get_release_by_tag) | **GET** /repos/{owner}/{repo}/releases/tags/{tag} | Get a release by tag name +[**repo_get_repo_permissions**](RepositoryApi.md#repo_get_repo_permissions) | **GET** /repos/{owner}/{repo}/collaborators/{collaborator}/permission | Get repository permissions for a user +[**repo_get_reviewers**](RepositoryApi.md#repo_get_reviewers) | **GET** /repos/{owner}/{repo}/reviewers | Return all users that can be requested to review in this repo +[**repo_get_single_commit**](RepositoryApi.md#repo_get_single_commit) | **GET** /repos/{owner}/{repo}/git/commits/{sha} | Get a single commit from a repository +[**repo_get_tag**](RepositoryApi.md#repo_get_tag) | **GET** /repos/{owner}/{repo}/tags/{tag} | Get the tag of a repository by tag name +[**repo_get_wiki_page**](RepositoryApi.md#repo_get_wiki_page) | **GET** /repos/{owner}/{repo}/wiki/page/{pageName} | Get a wiki page +[**repo_get_wiki_page_revisions**](RepositoryApi.md#repo_get_wiki_page_revisions) | **GET** /repos/{owner}/{repo}/wiki/revisions/{pageName} | Get revisions of a wiki page +[**repo_get_wiki_pages**](RepositoryApi.md#repo_get_wiki_pages) | **GET** /repos/{owner}/{repo}/wiki/pages | Get all wiki pages +[**repo_list_all_git_refs**](RepositoryApi.md#repo_list_all_git_refs) | **GET** /repos/{owner}/{repo}/git/refs | Get specified ref or filtered repository's refs +[**repo_list_branch_protection**](RepositoryApi.md#repo_list_branch_protection) | **GET** /repos/{owner}/{repo}/branch_protections | List branch protections for a repository +[**repo_list_branches**](RepositoryApi.md#repo_list_branches) | **GET** /repos/{owner}/{repo}/branches | List a repository's branches +[**repo_list_collaborators**](RepositoryApi.md#repo_list_collaborators) | **GET** /repos/{owner}/{repo}/collaborators | List a repository's collaborators +[**repo_list_git_hooks**](RepositoryApi.md#repo_list_git_hooks) | **GET** /repos/{owner}/{repo}/hooks/git | List the Git hooks in a repository +[**repo_list_git_refs**](RepositoryApi.md#repo_list_git_refs) | **GET** /repos/{owner}/{repo}/git/refs/{ref} | Get specified ref or filtered repository's refs +[**repo_list_hooks**](RepositoryApi.md#repo_list_hooks) | **GET** /repos/{owner}/{repo}/hooks | List the hooks in a repository +[**repo_list_keys**](RepositoryApi.md#repo_list_keys) | **GET** /repos/{owner}/{repo}/keys | List a repository's keys +[**repo_list_pull_requests**](RepositoryApi.md#repo_list_pull_requests) | **GET** /repos/{owner}/{repo}/pulls | List a repo's pull requests +[**repo_list_pull_reviews**](RepositoryApi.md#repo_list_pull_reviews) | **GET** /repos/{owner}/{repo}/pulls/{index}/reviews | List all reviews for a pull request +[**repo_list_release_attachments**](RepositoryApi.md#repo_list_release_attachments) | **GET** /repos/{owner}/{repo}/releases/{id}/assets | List release's attachments +[**repo_list_releases**](RepositoryApi.md#repo_list_releases) | **GET** /repos/{owner}/{repo}/releases | List a repo's releases +[**repo_list_stargazers**](RepositoryApi.md#repo_list_stargazers) | **GET** /repos/{owner}/{repo}/stargazers | List a repo's stargazers +[**repo_list_statuses**](RepositoryApi.md#repo_list_statuses) | **GET** /repos/{owner}/{repo}/statuses/{sha} | Get a commit's statuses +[**repo_list_statuses_by_ref**](RepositoryApi.md#repo_list_statuses_by_ref) | **GET** /repos/{owner}/{repo}/commits/{ref}/statuses | Get a commit's statuses, by branch/tag/commit reference +[**repo_list_subscribers**](RepositoryApi.md#repo_list_subscribers) | **GET** /repos/{owner}/{repo}/subscribers | List a repo's watchers +[**repo_list_tags**](RepositoryApi.md#repo_list_tags) | **GET** /repos/{owner}/{repo}/tags | List a repository's tags +[**repo_list_teams**](RepositoryApi.md#repo_list_teams) | **GET** /repos/{owner}/{repo}/teams | List a repository's teams +[**repo_list_topics**](RepositoryApi.md#repo_list_topics) | **GET** /repos/{owner}/{repo}/topics | Get list of topics that a repository has +[**repo_merge_pull_request**](RepositoryApi.md#repo_merge_pull_request) | **POST** /repos/{owner}/{repo}/pulls/{index}/merge | Merge a pull request +[**repo_migrate**](RepositoryApi.md#repo_migrate) | **POST** /repos/migrate | Migrate a remote git repository +[**repo_mirror_sync**](RepositoryApi.md#repo_mirror_sync) | **POST** /repos/{owner}/{repo}/mirror-sync | Sync a mirrored repository +[**repo_pull_request_is_merged**](RepositoryApi.md#repo_pull_request_is_merged) | **GET** /repos/{owner}/{repo}/pulls/{index}/merge | Check if a pull request has been merged +[**repo_search**](RepositoryApi.md#repo_search) | **GET** /repos/search | Search for repositories +[**repo_signing_key**](RepositoryApi.md#repo_signing_key) | **GET** /repos/{owner}/{repo}/signing-key.gpg | Get signing-key.gpg for given repository +[**repo_submit_pull_review**](RepositoryApi.md#repo_submit_pull_review) | **POST** /repos/{owner}/{repo}/pulls/{index}/reviews/{id} | Submit a pending review to an pull request +[**repo_test_hook**](RepositoryApi.md#repo_test_hook) | **POST** /repos/{owner}/{repo}/hooks/{id}/tests | Test a push webhook +[**repo_tracked_times**](RepositoryApi.md#repo_tracked_times) | **GET** /repos/{owner}/{repo}/times | List a repo's tracked times +[**repo_transfer**](RepositoryApi.md#repo_transfer) | **POST** /repos/{owner}/{repo}/transfer | Transfer a repo ownership +[**repo_un_dismiss_pull_review**](RepositoryApi.md#repo_un_dismiss_pull_review) | **POST** /repos/{owner}/{repo}/pulls/{index}/reviews/{id}/undismissals | Cancel to dismiss a review for a pull request +[**repo_update_file**](RepositoryApi.md#repo_update_file) | **PUT** /repos/{owner}/{repo}/contents/{filepath} | Update a file in a repository +[**repo_update_pull_request**](RepositoryApi.md#repo_update_pull_request) | **POST** /repos/{owner}/{repo}/pulls/{index}/update | Merge PR's baseBranch into headBranch +[**repo_update_topics**](RepositoryApi.md#repo_update_topics) | **PUT** /repos/{owner}/{repo}/topics | Replace list of topics for a repository +[**topic_search**](RepositoryApi.md#topic_search) | **GET** /topics/search | search topics via keyword +[**user_current_check_subscription**](RepositoryApi.md#user_current_check_subscription) | **GET** /repos/{owner}/{repo}/subscription | Check if the current user is watching a repo +[**user_current_delete_subscription**](RepositoryApi.md#user_current_delete_subscription) | **DELETE** /repos/{owner}/{repo}/subscription | Unwatch a repo +[**user_current_put_subscription**](RepositoryApi.md#user_current_put_subscription) | **PUT** /repos/{owner}/{repo}/subscription | Watch a repo +[**user_tracked_times**](RepositoryApi.md#user_tracked_times) | **GET** /repos/{owner}/{repo}/times/{user} | List a user's tracked times in a repo + + + +## accept_repo_transfer + +> crate::models::Repository accept_repo_transfer(owner, repo) +Accept a repo transfer + +### Parameters + + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**owner** | **String** | owner of the repo to transfer | [required] | +**repo** | **String** | name of the repo to transfer | [required] | + +### Return type + +[**crate::models::Repository**](Repository.md) + +### Authorization + +[AccessToken](../README.md#AccessToken), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [BasicAuth](../README.md#BasicAuth), [SudoHeader](../README.md#SudoHeader), [SudoParam](../README.md#SudoParam), [TOTPHeader](../README.md#TOTPHeader), [Token](../README.md#Token) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +## create_current_user_repo + +> crate::models::Repository create_current_user_repo(body) +Create a repository + +### Parameters + + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**body** | Option<[**CreateRepoOption**](CreateRepoOption.md)> | | | + +### Return type + +[**crate::models::Repository**](Repository.md) + +### Authorization + +[AccessToken](../README.md#AccessToken), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [BasicAuth](../README.md#BasicAuth), [SudoHeader](../README.md#SudoHeader), [SudoParam](../README.md#SudoParam), [TOTPHeader](../README.md#TOTPHeader), [Token](../README.md#Token) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +## create_fork + +> crate::models::Repository create_fork(owner, repo, body) +Fork a repository + +### Parameters + + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**owner** | **String** | owner of the repo to fork | [required] | +**repo** | **String** | name of the repo to fork | [required] | +**body** | Option<[**CreateForkOption**](CreateForkOption.md)> | | | + +### Return type + +[**crate::models::Repository**](Repository.md) + +### Authorization + +[AccessToken](../README.md#AccessToken), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [BasicAuth](../README.md#BasicAuth), [SudoHeader](../README.md#SudoHeader), [SudoParam](../README.md#SudoParam), [TOTPHeader](../README.md#TOTPHeader), [Token](../README.md#Token) + +### HTTP request headers + +- **Content-Type**: application/json, text/plain +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +## generate_repo + +> crate::models::Repository generate_repo(template_owner, template_repo, body) +Create a repository using a template + +### Parameters + + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**template_owner** | **String** | name of the template repository owner | [required] | +**template_repo** | **String** | name of the template repository | [required] | +**body** | Option<[**GenerateRepoOption**](GenerateRepoOption.md)> | | | + +### Return type + +[**crate::models::Repository**](Repository.md) + +### Authorization + +[AccessToken](../README.md#AccessToken), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [BasicAuth](../README.md#BasicAuth), [SudoHeader](../README.md#SudoHeader), [SudoParam](../README.md#SudoParam), [TOTPHeader](../README.md#TOTPHeader), [Token](../README.md#Token) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +## get_annotated_tag + +> crate::models::AnnotatedTag get_annotated_tag(owner, repo, sha) +Gets the tag object of an annotated tag (not lightweight tags) + +### Parameters + + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**owner** | **String** | owner of the repo | [required] | +**repo** | **String** | name of the repo | [required] | +**sha** | **String** | sha of the tag. The Git tags API only supports annotated tag objects, not lightweight tags. | [required] | + +### Return type + +[**crate::models::AnnotatedTag**](AnnotatedTag.md) + +### Authorization + +[AccessToken](../README.md#AccessToken), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [BasicAuth](../README.md#BasicAuth), [SudoHeader](../README.md#SudoHeader), [SudoParam](../README.md#SudoParam), [TOTPHeader](../README.md#TOTPHeader), [Token](../README.md#Token) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +## get_blob + +> crate::models::GitBlobResponse get_blob(owner, repo, sha) +Gets the blob of a repository. + +### Parameters + + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**owner** | **String** | owner of the repo | [required] | +**repo** | **String** | name of the repo | [required] | +**sha** | **String** | sha of the commit | [required] | + +### Return type + +[**crate::models::GitBlobResponse**](GitBlobResponse.md) + +### Authorization + +[AccessToken](../README.md#AccessToken), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [BasicAuth](../README.md#BasicAuth), [SudoHeader](../README.md#SudoHeader), [SudoParam](../README.md#SudoParam), [TOTPHeader](../README.md#TOTPHeader), [Token](../README.md#Token) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +## get_tree + +> crate::models::GitTreeResponse get_tree(owner, repo, sha, recursive, page, per_page) +Gets the tree of a repository. + +### Parameters + + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**owner** | **String** | owner of the repo | [required] | +**repo** | **String** | name of the repo | [required] | +**sha** | **String** | sha of the commit | [required] | +**recursive** | Option<**bool**> | show all directories and files | | +**page** | Option<**i32**> | page number; the 'truncated' field in the response will be true if there are still more items after this page, false if the last page | | +**per_page** | Option<**i32**> | number of items per page | | + +### Return type + +[**crate::models::GitTreeResponse**](GitTreeResponse.md) + +### Authorization + +[AccessToken](../README.md#AccessToken), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [BasicAuth](../README.md#BasicAuth), [SudoHeader](../README.md#SudoHeader), [SudoParam](../README.md#SudoParam), [TOTPHeader](../README.md#TOTPHeader), [Token](../README.md#Token) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +## list_forks + +> Vec list_forks(owner, repo, page, limit) +List a repository's forks + +### Parameters + + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**owner** | **String** | owner of the repo | [required] | +**repo** | **String** | name of the repo | [required] | +**page** | Option<**i32**> | page number of results to return (1-based) | | +**limit** | Option<**i32**> | page size of results | | + +### Return type + +[**Vec**](Repository.md) + +### Authorization + +[AccessToken](../README.md#AccessToken), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [BasicAuth](../README.md#BasicAuth), [SudoHeader](../README.md#SudoHeader), [SudoParam](../README.md#SudoParam), [TOTPHeader](../README.md#TOTPHeader), [Token](../README.md#Token) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +## reject_repo_transfer + +> crate::models::Repository reject_repo_transfer(owner, repo) +Reject a repo transfer + +### Parameters + + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**owner** | **String** | owner of the repo to transfer | [required] | +**repo** | **String** | name of the repo to transfer | [required] | + +### Return type + +[**crate::models::Repository**](Repository.md) + +### Authorization + +[AccessToken](../README.md#AccessToken), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [BasicAuth](../README.md#BasicAuth), [SudoHeader](../README.md#SudoHeader), [SudoParam](../README.md#SudoParam), [TOTPHeader](../README.md#TOTPHeader), [Token](../README.md#Token) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +## repo_add_collaborator + +> repo_add_collaborator(owner, repo, collaborator, body) +Add a collaborator to a repository + +### Parameters + + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**owner** | **String** | owner of the repo | [required] | +**repo** | **String** | name of the repo | [required] | +**collaborator** | **String** | username of the collaborator to add | [required] | +**body** | Option<[**AddCollaboratorOption**](AddCollaboratorOption.md)> | | | + +### Return type + + (empty response body) + +### Authorization + +[AccessToken](../README.md#AccessToken), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [BasicAuth](../README.md#BasicAuth), [SudoHeader](../README.md#SudoHeader), [SudoParam](../README.md#SudoParam), [TOTPHeader](../README.md#TOTPHeader), [Token](../README.md#Token) + +### HTTP request headers + +- **Content-Type**: application/json, text/plain +- **Accept**: Not defined + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +## repo_add_team + +> repo_add_team(owner, repo, team) +Add a team to a repository + +### Parameters + + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**owner** | **String** | owner of the repo | [required] | +**repo** | **String** | name of the repo | [required] | +**team** | **String** | team name | [required] | + +### Return type + + (empty response body) + +### Authorization + +[AccessToken](../README.md#AccessToken), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [BasicAuth](../README.md#BasicAuth), [SudoHeader](../README.md#SudoHeader), [SudoParam](../README.md#SudoParam), [TOTPHeader](../README.md#TOTPHeader), [Token](../README.md#Token) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: Not defined + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +## repo_add_topic + +> repo_add_topic(owner, repo, topic) +Add a topic to a repository + +### Parameters + + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**owner** | **String** | owner of the repo | [required] | +**repo** | **String** | name of the repo | [required] | +**topic** | **String** | name of the topic to add | [required] | + +### Return type + + (empty response body) + +### Authorization + +[AccessToken](../README.md#AccessToken), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [BasicAuth](../README.md#BasicAuth), [SudoHeader](../README.md#SudoHeader), [SudoParam](../README.md#SudoParam), [TOTPHeader](../README.md#TOTPHeader), [Token](../README.md#Token) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: Not defined + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +## repo_apply_diff_patch + +> crate::models::FileResponse repo_apply_diff_patch(owner, repo, body) +Apply diff patch to repository + +### Parameters + + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**owner** | **String** | owner of the repo | [required] | +**repo** | **String** | name of the repo | [required] | +**body** | [**UpdateFileOptions**](UpdateFileOptions.md) | | [required] | + +### Return type + +[**crate::models::FileResponse**](FileResponse.md) + +### Authorization + +[AccessToken](../README.md#AccessToken), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [BasicAuth](../README.md#BasicAuth), [SudoHeader](../README.md#SudoHeader), [SudoParam](../README.md#SudoParam), [TOTPHeader](../README.md#TOTPHeader), [Token](../README.md#Token) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +## repo_cancel_scheduled_auto_merge + +> repo_cancel_scheduled_auto_merge(owner, repo, index) +Cancel the scheduled auto merge for the given pull request + +### Parameters + + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**owner** | **String** | owner of the repo | [required] | +**repo** | **String** | name of the repo | [required] | +**index** | **i64** | index of the pull request to merge | [required] | + +### Return type + + (empty response body) + +### Authorization + +[AccessToken](../README.md#AccessToken), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [BasicAuth](../README.md#BasicAuth), [SudoHeader](../README.md#SudoHeader), [SudoParam](../README.md#SudoParam), [TOTPHeader](../README.md#TOTPHeader), [Token](../README.md#Token) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: Not defined + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +## repo_check_collaborator + +> repo_check_collaborator(owner, repo, collaborator) +Check if a user is a collaborator of a repository + +### Parameters + + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**owner** | **String** | owner of the repo | [required] | +**repo** | **String** | name of the repo | [required] | +**collaborator** | **String** | username of the collaborator | [required] | + +### Return type + + (empty response body) + +### Authorization + +[AccessToken](../README.md#AccessToken), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [BasicAuth](../README.md#BasicAuth), [SudoHeader](../README.md#SudoHeader), [SudoParam](../README.md#SudoParam), [TOTPHeader](../README.md#TOTPHeader), [Token](../README.md#Token) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: Not defined + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +## repo_check_team + +> crate::models::Team repo_check_team(owner, repo, team) +Check if a team is assigned to a repository + +### Parameters + + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**owner** | **String** | owner of the repo | [required] | +**repo** | **String** | name of the repo | [required] | +**team** | **String** | team name | [required] | + +### Return type + +[**crate::models::Team**](Team.md) + +### Authorization + +[AccessToken](../README.md#AccessToken), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [BasicAuth](../README.md#BasicAuth), [SudoHeader](../README.md#SudoHeader), [SudoParam](../README.md#SudoParam), [TOTPHeader](../README.md#TOTPHeader), [Token](../README.md#Token) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +## repo_create_branch + +> crate::models::Branch repo_create_branch(owner, repo, body) +Create a branch + +### Parameters + + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**owner** | **String** | owner of the repo | [required] | +**repo** | **String** | name of the repo | [required] | +**body** | Option<[**CreateBranchRepoOption**](CreateBranchRepoOption.md)> | | | + +### Return type + +[**crate::models::Branch**](Branch.md) + +### Authorization + +[AccessToken](../README.md#AccessToken), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [BasicAuth](../README.md#BasicAuth), [SudoHeader](../README.md#SudoHeader), [SudoParam](../README.md#SudoParam), [TOTPHeader](../README.md#TOTPHeader), [Token](../README.md#Token) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +## repo_create_branch_protection + +> crate::models::BranchProtection repo_create_branch_protection(owner, repo, body) +Create a branch protections for a repository + +### Parameters + + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**owner** | **String** | owner of the repo | [required] | +**repo** | **String** | name of the repo | [required] | +**body** | Option<[**CreateBranchProtectionOption**](CreateBranchProtectionOption.md)> | | | + +### Return type + +[**crate::models::BranchProtection**](BranchProtection.md) + +### Authorization + +[AccessToken](../README.md#AccessToken), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [BasicAuth](../README.md#BasicAuth), [SudoHeader](../README.md#SudoHeader), [SudoParam](../README.md#SudoParam), [TOTPHeader](../README.md#TOTPHeader), [Token](../README.md#Token) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +## repo_create_file + +> crate::models::FileResponse repo_create_file(owner, repo, filepath, body) +Create a file in a repository + +### Parameters + + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**owner** | **String** | owner of the repo | [required] | +**repo** | **String** | name of the repo | [required] | +**filepath** | **String** | path of the file to create | [required] | +**body** | [**CreateFileOptions**](CreateFileOptions.md) | | [required] | + +### Return type + +[**crate::models::FileResponse**](FileResponse.md) + +### Authorization + +[AccessToken](../README.md#AccessToken), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [BasicAuth](../README.md#BasicAuth), [SudoHeader](../README.md#SudoHeader), [SudoParam](../README.md#SudoParam), [TOTPHeader](../README.md#TOTPHeader), [Token](../README.md#Token) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +## repo_create_hook + +> crate::models::Hook repo_create_hook(owner, repo, body) +Create a hook + +### Parameters + + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**owner** | **String** | owner of the repo | [required] | +**repo** | **String** | name of the repo | [required] | +**body** | Option<[**CreateHookOption**](CreateHookOption.md)> | | | + +### Return type + +[**crate::models::Hook**](Hook.md) + +### Authorization + +[AccessToken](../README.md#AccessToken), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [BasicAuth](../README.md#BasicAuth), [SudoHeader](../README.md#SudoHeader), [SudoParam](../README.md#SudoParam), [TOTPHeader](../README.md#TOTPHeader), [Token](../README.md#Token) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +## repo_create_key + +> crate::models::DeployKey repo_create_key(owner, repo, body) +Add a key to a repository + +### Parameters + + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**owner** | **String** | owner of the repo | [required] | +**repo** | **String** | name of the repo | [required] | +**body** | Option<[**CreateKeyOption**](CreateKeyOption.md)> | | | + +### Return type + +[**crate::models::DeployKey**](DeployKey.md) + +### Authorization + +[AccessToken](../README.md#AccessToken), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [BasicAuth](../README.md#BasicAuth), [SudoHeader](../README.md#SudoHeader), [SudoParam](../README.md#SudoParam), [TOTPHeader](../README.md#TOTPHeader), [Token](../README.md#Token) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +## repo_create_pull_request + +> crate::models::PullRequest repo_create_pull_request(owner, repo, body) +Create a pull request + +### Parameters + + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**owner** | **String** | owner of the repo | [required] | +**repo** | **String** | name of the repo | [required] | +**body** | Option<[**CreatePullRequestOption**](CreatePullRequestOption.md)> | | | + +### Return type + +[**crate::models::PullRequest**](PullRequest.md) + +### Authorization + +[AccessToken](../README.md#AccessToken), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [BasicAuth](../README.md#BasicAuth), [SudoHeader](../README.md#SudoHeader), [SudoParam](../README.md#SudoParam), [TOTPHeader](../README.md#TOTPHeader), [Token](../README.md#Token) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +## repo_create_pull_review + +> crate::models::PullReview repo_create_pull_review(owner, repo, index, body) +Create a review to an pull request + +### Parameters + + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**owner** | **String** | owner of the repo | [required] | +**repo** | **String** | name of the repo | [required] | +**index** | **i64** | index of the pull request | [required] | +**body** | [**CreatePullReviewOptions**](CreatePullReviewOptions.md) | | [required] | + +### Return type + +[**crate::models::PullReview**](PullReview.md) + +### Authorization + +[AccessToken](../README.md#AccessToken), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [BasicAuth](../README.md#BasicAuth), [SudoHeader](../README.md#SudoHeader), [SudoParam](../README.md#SudoParam), [TOTPHeader](../README.md#TOTPHeader), [Token](../README.md#Token) + +### HTTP request headers + +- **Content-Type**: application/json, text/plain +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +## repo_create_pull_review_requests + +> Vec repo_create_pull_review_requests(owner, repo, index, body) +create review requests for a pull request + +### Parameters + + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**owner** | **String** | owner of the repo | [required] | +**repo** | **String** | name of the repo | [required] | +**index** | **i64** | index of the pull request | [required] | +**body** | [**PullReviewRequestOptions**](PullReviewRequestOptions.md) | | [required] | + +### Return type + +[**Vec**](PullReview.md) + +### Authorization + +[AccessToken](../README.md#AccessToken), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [BasicAuth](../README.md#BasicAuth), [SudoHeader](../README.md#SudoHeader), [SudoParam](../README.md#SudoParam), [TOTPHeader](../README.md#TOTPHeader), [Token](../README.md#Token) + +### HTTP request headers + +- **Content-Type**: application/json, text/plain +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +## repo_create_release + +> crate::models::Release repo_create_release(owner, repo, body) +Create a release + +### Parameters + + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**owner** | **String** | owner of the repo | [required] | +**repo** | **String** | name of the repo | [required] | +**body** | Option<[**CreateReleaseOption**](CreateReleaseOption.md)> | | | + +### Return type + +[**crate::models::Release**](Release.md) + +### Authorization + +[AccessToken](../README.md#AccessToken), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [BasicAuth](../README.md#BasicAuth), [SudoHeader](../README.md#SudoHeader), [SudoParam](../README.md#SudoParam), [TOTPHeader](../README.md#TOTPHeader), [Token](../README.md#Token) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +## repo_create_release_attachment + +> crate::models::Attachment repo_create_release_attachment(owner, repo, id, attachment, name) +Create a release attachment + +### Parameters + + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**owner** | **String** | owner of the repo | [required] | +**repo** | **String** | name of the repo | [required] | +**id** | **i64** | id of the release | [required] | +**attachment** | **std::path::PathBuf** | attachment to upload | [required] | +**name** | Option<**String**> | name of the attachment | | + +### Return type + +[**crate::models::Attachment**](Attachment.md) + +### Authorization + +[AccessToken](../README.md#AccessToken), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [BasicAuth](../README.md#BasicAuth), [SudoHeader](../README.md#SudoHeader), [SudoParam](../README.md#SudoParam), [TOTPHeader](../README.md#TOTPHeader), [Token](../README.md#Token) + +### HTTP request headers + +- **Content-Type**: multipart/form-data +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +## repo_create_status + +> crate::models::CommitStatus repo_create_status(owner, repo, sha, body) +Create a commit status + +### Parameters + + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**owner** | **String** | owner of the repo | [required] | +**repo** | **String** | name of the repo | [required] | +**sha** | **String** | sha of the commit | [required] | +**body** | Option<[**CreateStatusOption**](CreateStatusOption.md)> | | | + +### Return type + +[**crate::models::CommitStatus**](CommitStatus.md) + +### Authorization + +[AccessToken](../README.md#AccessToken), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [BasicAuth](../README.md#BasicAuth), [SudoHeader](../README.md#SudoHeader), [SudoParam](../README.md#SudoParam), [TOTPHeader](../README.md#TOTPHeader), [Token](../README.md#Token) + +### HTTP request headers + +- **Content-Type**: application/json, text/plain +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +## repo_create_tag + +> crate::models::Tag repo_create_tag(owner, repo, body) +Create a new git tag in a repository + +### Parameters + + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**owner** | **String** | owner of the repo | [required] | +**repo** | **String** | name of the repo | [required] | +**body** | Option<[**CreateTagOption**](CreateTagOption.md)> | | | + +### Return type + +[**crate::models::Tag**](Tag.md) + +### Authorization + +[AccessToken](../README.md#AccessToken), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [BasicAuth](../README.md#BasicAuth), [SudoHeader](../README.md#SudoHeader), [SudoParam](../README.md#SudoParam), [TOTPHeader](../README.md#TOTPHeader), [Token](../README.md#Token) + +### HTTP request headers + +- **Content-Type**: application/json, text/plain +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +## repo_create_wiki_page + +> crate::models::WikiPage repo_create_wiki_page(owner, repo, body) +Create a wiki page + +### Parameters + + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**owner** | **String** | owner of the repo | [required] | +**repo** | **String** | name of the repo | [required] | +**body** | Option<[**CreateWikiPageOptions**](CreateWikiPageOptions.md)> | | | + +### Return type + +[**crate::models::WikiPage**](WikiPage.md) + +### Authorization + +[AccessToken](../README.md#AccessToken), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [BasicAuth](../README.md#BasicAuth), [SudoHeader](../README.md#SudoHeader), [SudoParam](../README.md#SudoParam), [TOTPHeader](../README.md#TOTPHeader), [Token](../README.md#Token) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json, text/html + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +## repo_delete + +> repo_delete(owner, repo) +Delete a repository + +### Parameters + + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**owner** | **String** | owner of the repo to delete | [required] | +**repo** | **String** | name of the repo to delete | [required] | + +### Return type + + (empty response body) + +### Authorization + +[AccessToken](../README.md#AccessToken), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [BasicAuth](../README.md#BasicAuth), [SudoHeader](../README.md#SudoHeader), [SudoParam](../README.md#SudoParam), [TOTPHeader](../README.md#TOTPHeader), [Token](../README.md#Token) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: Not defined + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +## repo_delete_branch + +> repo_delete_branch(owner, repo, branch) +Delete a specific branch from a repository + +### Parameters + + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**owner** | **String** | owner of the repo | [required] | +**repo** | **String** | name of the repo | [required] | +**branch** | **String** | branch to delete | [required] | + +### Return type + + (empty response body) + +### Authorization + +[AccessToken](../README.md#AccessToken), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [BasicAuth](../README.md#BasicAuth), [SudoHeader](../README.md#SudoHeader), [SudoParam](../README.md#SudoParam), [TOTPHeader](../README.md#TOTPHeader), [Token](../README.md#Token) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: Not defined + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +## repo_delete_branch_protection + +> repo_delete_branch_protection(owner, repo, name) +Delete a specific branch protection for the repository + +### Parameters + + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**owner** | **String** | owner of the repo | [required] | +**repo** | **String** | name of the repo | [required] | +**name** | **String** | name of protected branch | [required] | + +### Return type + + (empty response body) + +### Authorization + +[AccessToken](../README.md#AccessToken), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [BasicAuth](../README.md#BasicAuth), [SudoHeader](../README.md#SudoHeader), [SudoParam](../README.md#SudoParam), [TOTPHeader](../README.md#TOTPHeader), [Token](../README.md#Token) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: Not defined + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +## repo_delete_collaborator + +> repo_delete_collaborator(owner, repo, collaborator) +Delete a collaborator from a repository + +### Parameters + + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**owner** | **String** | owner of the repo | [required] | +**repo** | **String** | name of the repo | [required] | +**collaborator** | **String** | username of the collaborator to delete | [required] | + +### Return type + + (empty response body) + +### Authorization + +[AccessToken](../README.md#AccessToken), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [BasicAuth](../README.md#BasicAuth), [SudoHeader](../README.md#SudoHeader), [SudoParam](../README.md#SudoParam), [TOTPHeader](../README.md#TOTPHeader), [Token](../README.md#Token) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: Not defined + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +## repo_delete_file + +> crate::models::FileDeleteResponse repo_delete_file(owner, repo, filepath, body) +Delete a file in a repository + +### Parameters + + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**owner** | **String** | owner of the repo | [required] | +**repo** | **String** | name of the repo | [required] | +**filepath** | **String** | path of the file to delete | [required] | +**body** | [**DeleteFileOptions**](DeleteFileOptions.md) | | [required] | + +### Return type + +[**crate::models::FileDeleteResponse**](FileDeleteResponse.md) + +### Authorization + +[AccessToken](../README.md#AccessToken), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [BasicAuth](../README.md#BasicAuth), [SudoHeader](../README.md#SudoHeader), [SudoParam](../README.md#SudoParam), [TOTPHeader](../README.md#TOTPHeader), [Token](../README.md#Token) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +## repo_delete_git_hook + +> repo_delete_git_hook(owner, repo, id) +Delete a Git hook in a repository + +### Parameters + + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**owner** | **String** | owner of the repo | [required] | +**repo** | **String** | name of the repo | [required] | +**id** | **String** | id of the hook to get | [required] | + +### Return type + + (empty response body) + +### Authorization + +[AccessToken](../README.md#AccessToken), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [BasicAuth](../README.md#BasicAuth), [SudoHeader](../README.md#SudoHeader), [SudoParam](../README.md#SudoParam), [TOTPHeader](../README.md#TOTPHeader), [Token](../README.md#Token) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: Not defined + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +## repo_delete_hook + +> repo_delete_hook(owner, repo, id) +Delete a hook in a repository + +### Parameters + + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**owner** | **String** | owner of the repo | [required] | +**repo** | **String** | name of the repo | [required] | +**id** | **i64** | id of the hook to delete | [required] | + +### Return type + + (empty response body) + +### Authorization + +[AccessToken](../README.md#AccessToken), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [BasicAuth](../README.md#BasicAuth), [SudoHeader](../README.md#SudoHeader), [SudoParam](../README.md#SudoParam), [TOTPHeader](../README.md#TOTPHeader), [Token](../README.md#Token) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: Not defined + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +## repo_delete_key + +> repo_delete_key(owner, repo, id) +Delete a key from a repository + +### Parameters + + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**owner** | **String** | owner of the repo | [required] | +**repo** | **String** | name of the repo | [required] | +**id** | **i64** | id of the key to delete | [required] | + +### Return type + + (empty response body) + +### Authorization + +[AccessToken](../README.md#AccessToken), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [BasicAuth](../README.md#BasicAuth), [SudoHeader](../README.md#SudoHeader), [SudoParam](../README.md#SudoParam), [TOTPHeader](../README.md#TOTPHeader), [Token](../README.md#Token) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: Not defined + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +## repo_delete_pull_review + +> repo_delete_pull_review(owner, repo, index, id) +Delete a specific review from a pull request + +### Parameters + + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**owner** | **String** | owner of the repo | [required] | +**repo** | **String** | name of the repo | [required] | +**index** | **i64** | index of the pull request | [required] | +**id** | **i64** | id of the review | [required] | + +### Return type + + (empty response body) + +### Authorization + +[AccessToken](../README.md#AccessToken), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [BasicAuth](../README.md#BasicAuth), [SudoHeader](../README.md#SudoHeader), [SudoParam](../README.md#SudoParam), [TOTPHeader](../README.md#TOTPHeader), [Token](../README.md#Token) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: Not defined + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +## repo_delete_pull_review_requests + +> repo_delete_pull_review_requests(owner, repo, index, body) +cancel review requests for a pull request + +### Parameters + + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**owner** | **String** | owner of the repo | [required] | +**repo** | **String** | name of the repo | [required] | +**index** | **i64** | index of the pull request | [required] | +**body** | [**PullReviewRequestOptions**](PullReviewRequestOptions.md) | | [required] | + +### Return type + + (empty response body) + +### Authorization + +[AccessToken](../README.md#AccessToken), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [BasicAuth](../README.md#BasicAuth), [SudoHeader](../README.md#SudoHeader), [SudoParam](../README.md#SudoParam), [TOTPHeader](../README.md#TOTPHeader), [Token](../README.md#Token) + +### HTTP request headers + +- **Content-Type**: application/json, text/plain +- **Accept**: Not defined + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +## repo_delete_release + +> repo_delete_release(owner, repo, id) +Delete a release + +### Parameters + + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**owner** | **String** | owner of the repo | [required] | +**repo** | **String** | name of the repo | [required] | +**id** | **i64** | id of the release to delete | [required] | + +### Return type + + (empty response body) + +### Authorization + +[AccessToken](../README.md#AccessToken), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [BasicAuth](../README.md#BasicAuth), [SudoHeader](../README.md#SudoHeader), [SudoParam](../README.md#SudoParam), [TOTPHeader](../README.md#TOTPHeader), [Token](../README.md#Token) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: Not defined + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +## repo_delete_release_attachment + +> repo_delete_release_attachment(owner, repo, id, attachment_id) +Delete a release attachment + +### Parameters + + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**owner** | **String** | owner of the repo | [required] | +**repo** | **String** | name of the repo | [required] | +**id** | **i64** | id of the release | [required] | +**attachment_id** | **i64** | id of the attachment to delete | [required] | + +### Return type + + (empty response body) + +### Authorization + +[AccessToken](../README.md#AccessToken), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [BasicAuth](../README.md#BasicAuth), [SudoHeader](../README.md#SudoHeader), [SudoParam](../README.md#SudoParam), [TOTPHeader](../README.md#TOTPHeader), [Token](../README.md#Token) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: Not defined + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +## repo_delete_release_by_tag + +> repo_delete_release_by_tag(owner, repo, tag) +Delete a release by tag name + +### Parameters + + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**owner** | **String** | owner of the repo | [required] | +**repo** | **String** | name of the repo | [required] | +**tag** | **String** | tag name of the release to delete | [required] | + +### Return type + + (empty response body) + +### Authorization + +[AccessToken](../README.md#AccessToken), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [BasicAuth](../README.md#BasicAuth), [SudoHeader](../README.md#SudoHeader), [SudoParam](../README.md#SudoParam), [TOTPHeader](../README.md#TOTPHeader), [Token](../README.md#Token) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: Not defined + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +## repo_delete_tag + +> repo_delete_tag(owner, repo, tag) +Delete a repository's tag by name + +### Parameters + + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**owner** | **String** | owner of the repo | [required] | +**repo** | **String** | name of the repo | [required] | +**tag** | **String** | name of tag to delete | [required] | + +### Return type + + (empty response body) + +### Authorization + +[AccessToken](../README.md#AccessToken), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [BasicAuth](../README.md#BasicAuth), [SudoHeader](../README.md#SudoHeader), [SudoParam](../README.md#SudoParam), [TOTPHeader](../README.md#TOTPHeader), [Token](../README.md#Token) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: Not defined + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +## repo_delete_team + +> repo_delete_team(owner, repo, team) +Delete a team from a repository + +### Parameters + + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**owner** | **String** | owner of the repo | [required] | +**repo** | **String** | name of the repo | [required] | +**team** | **String** | team name | [required] | + +### Return type + + (empty response body) + +### Authorization + +[AccessToken](../README.md#AccessToken), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [BasicAuth](../README.md#BasicAuth), [SudoHeader](../README.md#SudoHeader), [SudoParam](../README.md#SudoParam), [TOTPHeader](../README.md#TOTPHeader), [Token](../README.md#Token) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: Not defined + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +## repo_delete_topic + +> repo_delete_topic(owner, repo, topic) +Delete a topic from a repository + +### Parameters + + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**owner** | **String** | owner of the repo | [required] | +**repo** | **String** | name of the repo | [required] | +**topic** | **String** | name of the topic to delete | [required] | + +### Return type + + (empty response body) + +### Authorization + +[AccessToken](../README.md#AccessToken), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [BasicAuth](../README.md#BasicAuth), [SudoHeader](../README.md#SudoHeader), [SudoParam](../README.md#SudoParam), [TOTPHeader](../README.md#TOTPHeader), [Token](../README.md#Token) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: Not defined + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +## repo_delete_wiki_page + +> repo_delete_wiki_page(owner, repo, page_name) +Delete a wiki page + +### Parameters + + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**owner** | **String** | owner of the repo | [required] | +**repo** | **String** | name of the repo | [required] | +**page_name** | **String** | name of the page | [required] | + +### Return type + + (empty response body) + +### Authorization + +[AccessToken](../README.md#AccessToken), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [BasicAuth](../README.md#BasicAuth), [SudoHeader](../README.md#SudoHeader), [SudoParam](../README.md#SudoParam), [TOTPHeader](../README.md#TOTPHeader), [Token](../README.md#Token) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: Not defined + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +## repo_dismiss_pull_review + +> crate::models::PullReview repo_dismiss_pull_review(owner, repo, index, id, body) +Dismiss a review for a pull request + +### Parameters + + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**owner** | **String** | owner of the repo | [required] | +**repo** | **String** | name of the repo | [required] | +**index** | **i64** | index of the pull request | [required] | +**id** | **i64** | id of the review | [required] | +**body** | [**DismissPullReviewOptions**](DismissPullReviewOptions.md) | | [required] | + +### Return type + +[**crate::models::PullReview**](PullReview.md) + +### Authorization + +[AccessToken](../README.md#AccessToken), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [BasicAuth](../README.md#BasicAuth), [SudoHeader](../README.md#SudoHeader), [SudoParam](../README.md#SudoParam), [TOTPHeader](../README.md#TOTPHeader), [Token](../README.md#Token) + +### HTTP request headers + +- **Content-Type**: application/json, text/plain +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +## repo_download_commit_diff_or_patch + +> String repo_download_commit_diff_or_patch(owner, repo, sha, diff_type) +Get a commit's diff or patch + +### Parameters + + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**owner** | **String** | owner of the repo | [required] | +**repo** | **String** | name of the repo | [required] | +**sha** | **String** | SHA of the commit to get | [required] | +**diff_type** | **String** | whether the output is diff or patch | [required] | + +### Return type + +**String** + +### Authorization + +[AccessToken](../README.md#AccessToken), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [BasicAuth](../README.md#BasicAuth), [SudoHeader](../README.md#SudoHeader), [SudoParam](../README.md#SudoParam), [TOTPHeader](../README.md#TOTPHeader), [Token](../README.md#Token) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: text/plain + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +## repo_download_pull_diff_or_patch + +> String repo_download_pull_diff_or_patch(owner, repo, index, diff_type, binary) +Get a pull request diff or patch + +### Parameters + + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**owner** | **String** | owner of the repo | [required] | +**repo** | **String** | name of the repo | [required] | +**index** | **i64** | index of the pull request to get | [required] | +**diff_type** | **String** | whether the output is diff or patch | [required] | +**binary** | Option<**bool**> | whether to include binary file changes. if true, the diff is applicable with `git apply` | | + +### Return type + +**String** + +### Authorization + +[AccessToken](../README.md#AccessToken), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [BasicAuth](../README.md#BasicAuth), [SudoHeader](../README.md#SudoHeader), [SudoParam](../README.md#SudoParam), [TOTPHeader](../README.md#TOTPHeader), [Token](../README.md#Token) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: text/plain + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +## repo_edit + +> crate::models::Repository repo_edit(owner, repo, body) +Edit a repository's properties. Only fields that are set will be changed. + +### Parameters + + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**owner** | **String** | owner of the repo to edit | [required] | +**repo** | **String** | name of the repo to edit | [required] | +**body** | Option<[**EditRepoOption**](EditRepoOption.md)> | Properties of a repo that you can edit | | + +### Return type + +[**crate::models::Repository**](Repository.md) + +### Authorization + +[AccessToken](../README.md#AccessToken), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [BasicAuth](../README.md#BasicAuth), [SudoHeader](../README.md#SudoHeader), [SudoParam](../README.md#SudoParam), [TOTPHeader](../README.md#TOTPHeader), [Token](../README.md#Token) + +### HTTP request headers + +- **Content-Type**: application/json, text/plain +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +## repo_edit_branch_protection + +> crate::models::BranchProtection repo_edit_branch_protection(owner, repo, name, body) +Edit a branch protections for a repository. Only fields that are set will be changed + +### Parameters + + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**owner** | **String** | owner of the repo | [required] | +**repo** | **String** | name of the repo | [required] | +**name** | **String** | name of protected branch | [required] | +**body** | Option<[**EditBranchProtectionOption**](EditBranchProtectionOption.md)> | | | + +### Return type + +[**crate::models::BranchProtection**](BranchProtection.md) + +### Authorization + +[AccessToken](../README.md#AccessToken), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [BasicAuth](../README.md#BasicAuth), [SudoHeader](../README.md#SudoHeader), [SudoParam](../README.md#SudoParam), [TOTPHeader](../README.md#TOTPHeader), [Token](../README.md#Token) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +## repo_edit_git_hook + +> crate::models::GitHook repo_edit_git_hook(owner, repo, id, body) +Edit a Git hook in a repository + +### Parameters + + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**owner** | **String** | owner of the repo | [required] | +**repo** | **String** | name of the repo | [required] | +**id** | **String** | id of the hook to get | [required] | +**body** | Option<[**EditGitHookOption**](EditGitHookOption.md)> | | | + +### Return type + +[**crate::models::GitHook**](GitHook.md) + +### Authorization + +[AccessToken](../README.md#AccessToken), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [BasicAuth](../README.md#BasicAuth), [SudoHeader](../README.md#SudoHeader), [SudoParam](../README.md#SudoParam), [TOTPHeader](../README.md#TOTPHeader), [Token](../README.md#Token) + +### HTTP request headers + +- **Content-Type**: application/json, text/plain +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +## repo_edit_hook + +> crate::models::Hook repo_edit_hook(owner, repo, id, body) +Edit a hook in a repository + +### Parameters + + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**owner** | **String** | owner of the repo | [required] | +**repo** | **String** | name of the repo | [required] | +**id** | **i64** | index of the hook | [required] | +**body** | Option<[**EditHookOption**](EditHookOption.md)> | | | + +### Return type + +[**crate::models::Hook**](Hook.md) + +### Authorization + +[AccessToken](../README.md#AccessToken), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [BasicAuth](../README.md#BasicAuth), [SudoHeader](../README.md#SudoHeader), [SudoParam](../README.md#SudoParam), [TOTPHeader](../README.md#TOTPHeader), [Token](../README.md#Token) + +### HTTP request headers + +- **Content-Type**: application/json, text/plain +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +## repo_edit_pull_request + +> crate::models::PullRequest repo_edit_pull_request(owner, repo, index, body) +Update a pull request. If using deadline only the date will be taken into account, and time of day ignored. + +### Parameters + + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**owner** | **String** | owner of the repo | [required] | +**repo** | **String** | name of the repo | [required] | +**index** | **i64** | index of the pull request to edit | [required] | +**body** | Option<[**EditPullRequestOption**](EditPullRequestOption.md)> | | | + +### Return type + +[**crate::models::PullRequest**](PullRequest.md) + +### Authorization + +[AccessToken](../README.md#AccessToken), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [BasicAuth](../README.md#BasicAuth), [SudoHeader](../README.md#SudoHeader), [SudoParam](../README.md#SudoParam), [TOTPHeader](../README.md#TOTPHeader), [Token](../README.md#Token) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +## repo_edit_release + +> crate::models::Release repo_edit_release(owner, repo, id, body) +Update a release + +### Parameters + + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**owner** | **String** | owner of the repo | [required] | +**repo** | **String** | name of the repo | [required] | +**id** | **i64** | id of the release to edit | [required] | +**body** | Option<[**EditReleaseOption**](EditReleaseOption.md)> | | | + +### Return type + +[**crate::models::Release**](Release.md) + +### Authorization + +[AccessToken](../README.md#AccessToken), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [BasicAuth](../README.md#BasicAuth), [SudoHeader](../README.md#SudoHeader), [SudoParam](../README.md#SudoParam), [TOTPHeader](../README.md#TOTPHeader), [Token](../README.md#Token) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +## repo_edit_release_attachment + +> crate::models::Attachment repo_edit_release_attachment(owner, repo, id, attachment_id, body) +Edit a release attachment + +### Parameters + + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**owner** | **String** | owner of the repo | [required] | +**repo** | **String** | name of the repo | [required] | +**id** | **i64** | id of the release | [required] | +**attachment_id** | **i64** | id of the attachment to edit | [required] | +**body** | Option<[**EditAttachmentOptions**](EditAttachmentOptions.md)> | | | + +### Return type + +[**crate::models::Attachment**](Attachment.md) + +### Authorization + +[AccessToken](../README.md#AccessToken), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [BasicAuth](../README.md#BasicAuth), [SudoHeader](../README.md#SudoHeader), [SudoParam](../README.md#SudoParam), [TOTPHeader](../README.md#TOTPHeader), [Token](../README.md#Token) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +## repo_edit_wiki_page + +> crate::models::WikiPage repo_edit_wiki_page(owner, repo, page_name, body) +Edit a wiki page + +### Parameters + + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**owner** | **String** | owner of the repo | [required] | +**repo** | **String** | name of the repo | [required] | +**page_name** | **String** | name of the page | [required] | +**body** | Option<[**CreateWikiPageOptions**](CreateWikiPageOptions.md)> | | | + +### Return type + +[**crate::models::WikiPage**](WikiPage.md) + +### Authorization + +[AccessToken](../README.md#AccessToken), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [BasicAuth](../README.md#BasicAuth), [SudoHeader](../README.md#SudoHeader), [SudoParam](../README.md#SudoParam), [TOTPHeader](../README.md#TOTPHeader), [Token](../README.md#Token) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json, text/html + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +## repo_get + +> crate::models::Repository repo_get(owner, repo) +Get a repository + +### Parameters + + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**owner** | **String** | owner of the repo | [required] | +**repo** | **String** | name of the repo | [required] | + +### Return type + +[**crate::models::Repository**](Repository.md) + +### Authorization + +[AccessToken](../README.md#AccessToken), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [BasicAuth](../README.md#BasicAuth), [SudoHeader](../README.md#SudoHeader), [SudoParam](../README.md#SudoParam), [TOTPHeader](../README.md#TOTPHeader), [Token](../README.md#Token) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +## repo_get_all_commits + +> Vec repo_get_all_commits(owner, repo, sha, path, page, limit) +Get a list of all commits from a repository + +### Parameters + + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**owner** | **String** | owner of the repo | [required] | +**repo** | **String** | name of the repo | [required] | +**sha** | Option<**String**> | SHA or branch to start listing commits from (usually 'master') | | +**path** | Option<**String**> | filepath of a file/dir | | +**page** | Option<**i32**> | page number of results to return (1-based) | | +**limit** | Option<**i32**> | page size of results (ignored if used with 'path') | | + +### Return type + +[**Vec**](Commit.md) + +### Authorization + +[AccessToken](../README.md#AccessToken), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [BasicAuth](../README.md#BasicAuth), [SudoHeader](../README.md#SudoHeader), [SudoParam](../README.md#SudoParam), [TOTPHeader](../README.md#TOTPHeader), [Token](../README.md#Token) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +## repo_get_archive + +> repo_get_archive(owner, repo, archive) +Get an archive of a repository + +### Parameters + + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**owner** | **String** | owner of the repo | [required] | +**repo** | **String** | name of the repo | [required] | +**archive** | **String** | the git reference for download with attached archive format (e.g. master.zip) | [required] | + +### Return type + + (empty response body) + +### Authorization + +[AccessToken](../README.md#AccessToken), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [BasicAuth](../README.md#BasicAuth), [SudoHeader](../README.md#SudoHeader), [SudoParam](../README.md#SudoParam), [TOTPHeader](../README.md#TOTPHeader), [Token](../README.md#Token) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: Not defined + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +## repo_get_assignees + +> Vec repo_get_assignees(owner, repo) +Return all users that have write access and can be assigned to issues + +### Parameters + + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**owner** | **String** | owner of the repo | [required] | +**repo** | **String** | name of the repo | [required] | + +### Return type + +[**Vec**](User.md) + +### Authorization + +[AccessToken](../README.md#AccessToken), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [BasicAuth](../README.md#BasicAuth), [SudoHeader](../README.md#SudoHeader), [SudoParam](../README.md#SudoParam), [TOTPHeader](../README.md#TOTPHeader), [Token](../README.md#Token) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +## repo_get_branch + +> crate::models::Branch repo_get_branch(owner, repo, branch) +Retrieve a specific branch from a repository, including its effective branch protection + +### Parameters + + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**owner** | **String** | owner of the repo | [required] | +**repo** | **String** | name of the repo | [required] | +**branch** | **String** | branch to get | [required] | + +### Return type + +[**crate::models::Branch**](Branch.md) + +### Authorization + +[AccessToken](../README.md#AccessToken), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [BasicAuth](../README.md#BasicAuth), [SudoHeader](../README.md#SudoHeader), [SudoParam](../README.md#SudoParam), [TOTPHeader](../README.md#TOTPHeader), [Token](../README.md#Token) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +## repo_get_branch_protection + +> crate::models::BranchProtection repo_get_branch_protection(owner, repo, name) +Get a specific branch protection for the repository + +### Parameters + + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**owner** | **String** | owner of the repo | [required] | +**repo** | **String** | name of the repo | [required] | +**name** | **String** | name of protected branch | [required] | + +### Return type + +[**crate::models::BranchProtection**](BranchProtection.md) + +### Authorization + +[AccessToken](../README.md#AccessToken), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [BasicAuth](../README.md#BasicAuth), [SudoHeader](../README.md#SudoHeader), [SudoParam](../README.md#SudoParam), [TOTPHeader](../README.md#TOTPHeader), [Token](../README.md#Token) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +## repo_get_by_id + +> crate::models::Repository repo_get_by_id(id) +Get a repository by id + +### Parameters + + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**id** | **i64** | id of the repo to get | [required] | + +### Return type + +[**crate::models::Repository**](Repository.md) + +### Authorization + +[AccessToken](../README.md#AccessToken), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [BasicAuth](../README.md#BasicAuth), [SudoHeader](../README.md#SudoHeader), [SudoParam](../README.md#SudoParam), [TOTPHeader](../README.md#TOTPHeader), [Token](../README.md#Token) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +## repo_get_combined_status_by_ref + +> crate::models::CombinedStatus repo_get_combined_status_by_ref(owner, repo, r#ref, page, limit) +Get a commit's combined status, by branch/tag/commit reference + +### Parameters + + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**owner** | **String** | owner of the repo | [required] | +**repo** | **String** | name of the repo | [required] | +**r#ref** | **String** | name of branch/tag/commit | [required] | +**page** | Option<**i32**> | page number of results to return (1-based) | | +**limit** | Option<**i32**> | page size of results | | + +### Return type + +[**crate::models::CombinedStatus**](CombinedStatus.md) + +### Authorization + +[AccessToken](../README.md#AccessToken), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [BasicAuth](../README.md#BasicAuth), [SudoHeader](../README.md#SudoHeader), [SudoParam](../README.md#SudoParam), [TOTPHeader](../README.md#TOTPHeader), [Token](../README.md#Token) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +## repo_get_contents + +> crate::models::ContentsResponse repo_get_contents(owner, repo, filepath, r#ref) +Gets the metadata and contents (if a file) of an entry in a repository, or a list of entries if a dir + +### Parameters + + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**owner** | **String** | owner of the repo | [required] | +**repo** | **String** | name of the repo | [required] | +**filepath** | **String** | path of the dir, file, symlink or submodule in the repo | [required] | +**r#ref** | Option<**String**> | The name of the commit/branch/tag. Default the repository’s default branch (usually master) | | + +### Return type + +[**crate::models::ContentsResponse**](ContentsResponse.md) + +### Authorization + +[AccessToken](../README.md#AccessToken), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [BasicAuth](../README.md#BasicAuth), [SudoHeader](../README.md#SudoHeader), [SudoParam](../README.md#SudoParam), [TOTPHeader](../README.md#TOTPHeader), [Token](../README.md#Token) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +## repo_get_contents_list + +> Vec repo_get_contents_list(owner, repo, r#ref) +Gets the metadata of all the entries of the root dir + +### Parameters + + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**owner** | **String** | owner of the repo | [required] | +**repo** | **String** | name of the repo | [required] | +**r#ref** | Option<**String**> | The name of the commit/branch/tag. Default the repository’s default branch (usually master) | | + +### Return type + +[**Vec**](ContentsResponse.md) + +### Authorization + +[AccessToken](../README.md#AccessToken), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [BasicAuth](../README.md#BasicAuth), [SudoHeader](../README.md#SudoHeader), [SudoParam](../README.md#SudoParam), [TOTPHeader](../README.md#TOTPHeader), [Token](../README.md#Token) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +## repo_get_editor_config + +> repo_get_editor_config(owner, repo, filepath, r#ref) +Get the EditorConfig definitions of a file in a repository + +### Parameters + + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**owner** | **String** | owner of the repo | [required] | +**repo** | **String** | name of the repo | [required] | +**filepath** | **String** | filepath of file to get | [required] | +**r#ref** | Option<**String**> | The name of the commit/branch/tag. Default the repository’s default branch (usually master) | | + +### Return type + + (empty response body) + +### Authorization + +[AccessToken](../README.md#AccessToken), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [BasicAuth](../README.md#BasicAuth), [SudoHeader](../README.md#SudoHeader), [SudoParam](../README.md#SudoParam), [TOTPHeader](../README.md#TOTPHeader), [Token](../README.md#Token) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: Not defined + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +## repo_get_git_hook + +> crate::models::GitHook repo_get_git_hook(owner, repo, id) +Get a Git hook + +### Parameters + + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**owner** | **String** | owner of the repo | [required] | +**repo** | **String** | name of the repo | [required] | +**id** | **String** | id of the hook to get | [required] | + +### Return type + +[**crate::models::GitHook**](GitHook.md) + +### Authorization + +[AccessToken](../README.md#AccessToken), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [BasicAuth](../README.md#BasicAuth), [SudoHeader](../README.md#SudoHeader), [SudoParam](../README.md#SudoParam), [TOTPHeader](../README.md#TOTPHeader), [Token](../README.md#Token) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +## repo_get_hook + +> crate::models::Hook repo_get_hook(owner, repo, id) +Get a hook + +### Parameters + + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**owner** | **String** | owner of the repo | [required] | +**repo** | **String** | name of the repo | [required] | +**id** | **i64** | id of the hook to get | [required] | + +### Return type + +[**crate::models::Hook**](Hook.md) + +### Authorization + +[AccessToken](../README.md#AccessToken), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [BasicAuth](../README.md#BasicAuth), [SudoHeader](../README.md#SudoHeader), [SudoParam](../README.md#SudoParam), [TOTPHeader](../README.md#TOTPHeader), [Token](../README.md#Token) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +## repo_get_issue_templates + +> Vec repo_get_issue_templates(owner, repo) +Get available issue templates for a repository + +### Parameters + + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**owner** | **String** | owner of the repo | [required] | +**repo** | **String** | name of the repo | [required] | + +### Return type + +[**Vec**](IssueTemplate.md) + +### Authorization + +[AccessToken](../README.md#AccessToken), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [BasicAuth](../README.md#BasicAuth), [SudoHeader](../README.md#SudoHeader), [SudoParam](../README.md#SudoParam), [TOTPHeader](../README.md#TOTPHeader), [Token](../README.md#Token) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +## repo_get_key + +> crate::models::DeployKey repo_get_key(owner, repo, id) +Get a repository's key by id + +### Parameters + + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**owner** | **String** | owner of the repo | [required] | +**repo** | **String** | name of the repo | [required] | +**id** | **i64** | id of the key to get | [required] | + +### Return type + +[**crate::models::DeployKey**](DeployKey.md) + +### Authorization + +[AccessToken](../README.md#AccessToken), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [BasicAuth](../README.md#BasicAuth), [SudoHeader](../README.md#SudoHeader), [SudoParam](../README.md#SudoParam), [TOTPHeader](../README.md#TOTPHeader), [Token](../README.md#Token) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +## repo_get_languages + +> ::std::collections::HashMap repo_get_languages(owner, repo) +Get languages and number of bytes of code written + +### Parameters + + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**owner** | **String** | owner of the repo | [required] | +**repo** | **String** | name of the repo | [required] | + +### Return type + +**::std::collections::HashMap** + +### Authorization + +[AccessToken](../README.md#AccessToken), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [BasicAuth](../README.md#BasicAuth), [SudoHeader](../README.md#SudoHeader), [SudoParam](../README.md#SudoParam), [TOTPHeader](../README.md#TOTPHeader), [Token](../README.md#Token) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +## repo_get_note + +> crate::models::Note repo_get_note(owner, repo, sha) +Get a note corresponding to a single commit from a repository + +### Parameters + + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**owner** | **String** | owner of the repo | [required] | +**repo** | **String** | name of the repo | [required] | +**sha** | **String** | a git ref or commit sha | [required] | + +### Return type + +[**crate::models::Note**](Note.md) + +### Authorization + +[AccessToken](../README.md#AccessToken), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [BasicAuth](../README.md#BasicAuth), [SudoHeader](../README.md#SudoHeader), [SudoParam](../README.md#SudoParam), [TOTPHeader](../README.md#TOTPHeader), [Token](../README.md#Token) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +## repo_get_pull_request + +> crate::models::PullRequest repo_get_pull_request(owner, repo, index) +Get a pull request + +### Parameters + + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**owner** | **String** | owner of the repo | [required] | +**repo** | **String** | name of the repo | [required] | +**index** | **i64** | index of the pull request to get | [required] | + +### Return type + +[**crate::models::PullRequest**](PullRequest.md) + +### Authorization + +[AccessToken](../README.md#AccessToken), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [BasicAuth](../README.md#BasicAuth), [SudoHeader](../README.md#SudoHeader), [SudoParam](../README.md#SudoParam), [TOTPHeader](../README.md#TOTPHeader), [Token](../README.md#Token) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +## repo_get_pull_request_commits + +> Vec repo_get_pull_request_commits(owner, repo, index, page, limit) +Get commits for a pull request + +### Parameters + + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**owner** | **String** | owner of the repo | [required] | +**repo** | **String** | name of the repo | [required] | +**index** | **i64** | index of the pull request to get | [required] | +**page** | Option<**i32**> | page number of results to return (1-based) | | +**limit** | Option<**i32**> | page size of results | | + +### Return type + +[**Vec**](Commit.md) + +### Authorization + +[AccessToken](../README.md#AccessToken), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [BasicAuth](../README.md#BasicAuth), [SudoHeader](../README.md#SudoHeader), [SudoParam](../README.md#SudoParam), [TOTPHeader](../README.md#TOTPHeader), [Token](../README.md#Token) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +## repo_get_pull_review + +> crate::models::PullReview repo_get_pull_review(owner, repo, index, id) +Get a specific review for a pull request + +### Parameters + + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**owner** | **String** | owner of the repo | [required] | +**repo** | **String** | name of the repo | [required] | +**index** | **i64** | index of the pull request | [required] | +**id** | **i64** | id of the review | [required] | + +### Return type + +[**crate::models::PullReview**](PullReview.md) + +### Authorization + +[AccessToken](../README.md#AccessToken), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [BasicAuth](../README.md#BasicAuth), [SudoHeader](../README.md#SudoHeader), [SudoParam](../README.md#SudoParam), [TOTPHeader](../README.md#TOTPHeader), [Token](../README.md#Token) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +## repo_get_pull_review_comments + +> Vec repo_get_pull_review_comments(owner, repo, index, id) +Get a specific review for a pull request + +### Parameters + + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**owner** | **String** | owner of the repo | [required] | +**repo** | **String** | name of the repo | [required] | +**index** | **i64** | index of the pull request | [required] | +**id** | **i64** | id of the review | [required] | + +### Return type + +[**Vec**](PullReviewComment.md) + +### Authorization + +[AccessToken](../README.md#AccessToken), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [BasicAuth](../README.md#BasicAuth), [SudoHeader](../README.md#SudoHeader), [SudoParam](../README.md#SudoParam), [TOTPHeader](../README.md#TOTPHeader), [Token](../README.md#Token) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +## repo_get_raw_file + +> repo_get_raw_file(owner, repo, filepath, r#ref) +Get a file from a repository + +### Parameters + + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**owner** | **String** | owner of the repo | [required] | +**repo** | **String** | name of the repo | [required] | +**filepath** | **String** | filepath of the file to get | [required] | +**r#ref** | Option<**String**> | The name of the commit/branch/tag. Default the repository’s default branch (usually master) | | + +### Return type + + (empty response body) + +### Authorization + +[AccessToken](../README.md#AccessToken), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [BasicAuth](../README.md#BasicAuth), [SudoHeader](../README.md#SudoHeader), [SudoParam](../README.md#SudoParam), [TOTPHeader](../README.md#TOTPHeader), [Token](../README.md#Token) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: Not defined + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +## repo_get_raw_file_or_lfs + +> repo_get_raw_file_or_lfs(owner, repo, filepath, r#ref) +Get a file or it's LFS object from a repository + +### Parameters + + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**owner** | **String** | owner of the repo | [required] | +**repo** | **String** | name of the repo | [required] | +**filepath** | **String** | filepath of the file to get | [required] | +**r#ref** | Option<**String**> | The name of the commit/branch/tag. Default the repository’s default branch (usually master) | | + +### Return type + + (empty response body) + +### Authorization + +[AccessToken](../README.md#AccessToken), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [BasicAuth](../README.md#BasicAuth), [SudoHeader](../README.md#SudoHeader), [SudoParam](../README.md#SudoParam), [TOTPHeader](../README.md#TOTPHeader), [Token](../README.md#Token) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: Not defined + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +## repo_get_release + +> crate::models::Release repo_get_release(owner, repo, id) +Get a release + +### Parameters + + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**owner** | **String** | owner of the repo | [required] | +**repo** | **String** | name of the repo | [required] | +**id** | **i64** | id of the release to get | [required] | + +### Return type + +[**crate::models::Release**](Release.md) + +### Authorization + +[AccessToken](../README.md#AccessToken), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [BasicAuth](../README.md#BasicAuth), [SudoHeader](../README.md#SudoHeader), [SudoParam](../README.md#SudoParam), [TOTPHeader](../README.md#TOTPHeader), [Token](../README.md#Token) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +## repo_get_release_attachment + +> crate::models::Attachment repo_get_release_attachment(owner, repo, id, attachment_id) +Get a release attachment + +### Parameters + + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**owner** | **String** | owner of the repo | [required] | +**repo** | **String** | name of the repo | [required] | +**id** | **i64** | id of the release | [required] | +**attachment_id** | **i64** | id of the attachment to get | [required] | + +### Return type + +[**crate::models::Attachment**](Attachment.md) + +### Authorization + +[AccessToken](../README.md#AccessToken), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [BasicAuth](../README.md#BasicAuth), [SudoHeader](../README.md#SudoHeader), [SudoParam](../README.md#SudoParam), [TOTPHeader](../README.md#TOTPHeader), [Token](../README.md#Token) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +## repo_get_release_by_tag + +> crate::models::Release repo_get_release_by_tag(owner, repo, tag) +Get a release by tag name + +### Parameters + + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**owner** | **String** | owner of the repo | [required] | +**repo** | **String** | name of the repo | [required] | +**tag** | **String** | tag name of the release to get | [required] | + +### Return type + +[**crate::models::Release**](Release.md) + +### Authorization + +[AccessToken](../README.md#AccessToken), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [BasicAuth](../README.md#BasicAuth), [SudoHeader](../README.md#SudoHeader), [SudoParam](../README.md#SudoParam), [TOTPHeader](../README.md#TOTPHeader), [Token](../README.md#Token) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +## repo_get_repo_permissions + +> crate::models::RepoCollaboratorPermission repo_get_repo_permissions(owner, repo, collaborator) +Get repository permissions for a user + +### Parameters + + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**owner** | **String** | owner of the repo | [required] | +**repo** | **String** | name of the repo | [required] | +**collaborator** | **String** | username of the collaborator | [required] | + +### Return type + +[**crate::models::RepoCollaboratorPermission**](RepoCollaboratorPermission.md) + +### Authorization + +[AccessToken](../README.md#AccessToken), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [BasicAuth](../README.md#BasicAuth), [SudoHeader](../README.md#SudoHeader), [SudoParam](../README.md#SudoParam), [TOTPHeader](../README.md#TOTPHeader), [Token](../README.md#Token) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +## repo_get_reviewers + +> Vec repo_get_reviewers(owner, repo) +Return all users that can be requested to review in this repo + +### Parameters + + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**owner** | **String** | owner of the repo | [required] | +**repo** | **String** | name of the repo | [required] | + +### Return type + +[**Vec**](User.md) + +### Authorization + +[AccessToken](../README.md#AccessToken), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [BasicAuth](../README.md#BasicAuth), [SudoHeader](../README.md#SudoHeader), [SudoParam](../README.md#SudoParam), [TOTPHeader](../README.md#TOTPHeader), [Token](../README.md#Token) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +## repo_get_single_commit + +> crate::models::Commit repo_get_single_commit(owner, repo, sha) +Get a single commit from a repository + +### Parameters + + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**owner** | **String** | owner of the repo | [required] | +**repo** | **String** | name of the repo | [required] | +**sha** | **String** | a git ref or commit sha | [required] | + +### Return type + +[**crate::models::Commit**](Commit.md) + +### Authorization + +[AccessToken](../README.md#AccessToken), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [BasicAuth](../README.md#BasicAuth), [SudoHeader](../README.md#SudoHeader), [SudoParam](../README.md#SudoParam), [TOTPHeader](../README.md#TOTPHeader), [Token](../README.md#Token) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +## repo_get_tag + +> crate::models::Tag repo_get_tag(owner, repo, tag) +Get the tag of a repository by tag name + +### Parameters + + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**owner** | **String** | owner of the repo | [required] | +**repo** | **String** | name of the repo | [required] | +**tag** | **String** | name of tag | [required] | + +### Return type + +[**crate::models::Tag**](Tag.md) + +### Authorization + +[AccessToken](../README.md#AccessToken), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [BasicAuth](../README.md#BasicAuth), [SudoHeader](../README.md#SudoHeader), [SudoParam](../README.md#SudoParam), [TOTPHeader](../README.md#TOTPHeader), [Token](../README.md#Token) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +## repo_get_wiki_page + +> crate::models::WikiPage repo_get_wiki_page(owner, repo, page_name) +Get a wiki page + +### Parameters + + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**owner** | **String** | owner of the repo | [required] | +**repo** | **String** | name of the repo | [required] | +**page_name** | **String** | name of the page | [required] | + +### Return type + +[**crate::models::WikiPage**](WikiPage.md) + +### Authorization + +[AccessToken](../README.md#AccessToken), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [BasicAuth](../README.md#BasicAuth), [SudoHeader](../README.md#SudoHeader), [SudoParam](../README.md#SudoParam), [TOTPHeader](../README.md#TOTPHeader), [Token](../README.md#Token) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +## repo_get_wiki_page_revisions + +> crate::models::WikiCommitList repo_get_wiki_page_revisions(owner, repo, page_name, page) +Get revisions of a wiki page + +### Parameters + + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**owner** | **String** | owner of the repo | [required] | +**repo** | **String** | name of the repo | [required] | +**page_name** | **String** | name of the page | [required] | +**page** | Option<**i32**> | page number of results to return (1-based) | | + +### Return type + +[**crate::models::WikiCommitList**](WikiCommitList.md) + +### Authorization + +[AccessToken](../README.md#AccessToken), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [BasicAuth](../README.md#BasicAuth), [SudoHeader](../README.md#SudoHeader), [SudoParam](../README.md#SudoParam), [TOTPHeader](../README.md#TOTPHeader), [Token](../README.md#Token) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +## repo_get_wiki_pages + +> Vec repo_get_wiki_pages(owner, repo, page, limit) +Get all wiki pages + +### Parameters + + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**owner** | **String** | owner of the repo | [required] | +**repo** | **String** | name of the repo | [required] | +**page** | Option<**i32**> | page number of results to return (1-based) | | +**limit** | Option<**i32**> | page size of results | | + +### Return type + +[**Vec**](WikiPageMetaData.md) + +### Authorization + +[AccessToken](../README.md#AccessToken), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [BasicAuth](../README.md#BasicAuth), [SudoHeader](../README.md#SudoHeader), [SudoParam](../README.md#SudoParam), [TOTPHeader](../README.md#TOTPHeader), [Token](../README.md#Token) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +## repo_list_all_git_refs + +> Vec repo_list_all_git_refs(owner, repo) +Get specified ref or filtered repository's refs + +### Parameters + + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**owner** | **String** | owner of the repo | [required] | +**repo** | **String** | name of the repo | [required] | + +### Return type + +[**Vec**](Reference.md) + +### Authorization + +[AccessToken](../README.md#AccessToken), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [BasicAuth](../README.md#BasicAuth), [SudoHeader](../README.md#SudoHeader), [SudoParam](../README.md#SudoParam), [TOTPHeader](../README.md#TOTPHeader), [Token](../README.md#Token) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +## repo_list_branch_protection + +> Vec repo_list_branch_protection(owner, repo) +List branch protections for a repository + +### Parameters + + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**owner** | **String** | owner of the repo | [required] | +**repo** | **String** | name of the repo | [required] | + +### Return type + +[**Vec**](BranchProtection.md) + +### Authorization + +[AccessToken](../README.md#AccessToken), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [BasicAuth](../README.md#BasicAuth), [SudoHeader](../README.md#SudoHeader), [SudoParam](../README.md#SudoParam), [TOTPHeader](../README.md#TOTPHeader), [Token](../README.md#Token) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +## repo_list_branches + +> Vec repo_list_branches(owner, repo, page, limit) +List a repository's branches + +### Parameters + + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**owner** | **String** | owner of the repo | [required] | +**repo** | **String** | name of the repo | [required] | +**page** | Option<**i32**> | page number of results to return (1-based) | | +**limit** | Option<**i32**> | page size of results | | + +### Return type + +[**Vec**](Branch.md) + +### Authorization + +[AccessToken](../README.md#AccessToken), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [BasicAuth](../README.md#BasicAuth), [SudoHeader](../README.md#SudoHeader), [SudoParam](../README.md#SudoParam), [TOTPHeader](../README.md#TOTPHeader), [Token](../README.md#Token) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +## repo_list_collaborators + +> Vec repo_list_collaborators(owner, repo, page, limit) +List a repository's collaborators + +### Parameters + + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**owner** | **String** | owner of the repo | [required] | +**repo** | **String** | name of the repo | [required] | +**page** | Option<**i32**> | page number of results to return (1-based) | | +**limit** | Option<**i32**> | page size of results | | + +### Return type + +[**Vec**](User.md) + +### Authorization + +[AccessToken](../README.md#AccessToken), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [BasicAuth](../README.md#BasicAuth), [SudoHeader](../README.md#SudoHeader), [SudoParam](../README.md#SudoParam), [TOTPHeader](../README.md#TOTPHeader), [Token](../README.md#Token) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +## repo_list_git_hooks + +> Vec repo_list_git_hooks(owner, repo) +List the Git hooks in a repository + +### Parameters + + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**owner** | **String** | owner of the repo | [required] | +**repo** | **String** | name of the repo | [required] | + +### Return type + +[**Vec**](GitHook.md) + +### Authorization + +[AccessToken](../README.md#AccessToken), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [BasicAuth](../README.md#BasicAuth), [SudoHeader](../README.md#SudoHeader), [SudoParam](../README.md#SudoParam), [TOTPHeader](../README.md#TOTPHeader), [Token](../README.md#Token) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +## repo_list_git_refs + +> Vec repo_list_git_refs(owner, repo, r#ref) +Get specified ref or filtered repository's refs + +### Parameters + + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**owner** | **String** | owner of the repo | [required] | +**repo** | **String** | name of the repo | [required] | +**r#ref** | **String** | part or full name of the ref | [required] | + +### Return type + +[**Vec**](Reference.md) + +### Authorization + +[AccessToken](../README.md#AccessToken), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [BasicAuth](../README.md#BasicAuth), [SudoHeader](../README.md#SudoHeader), [SudoParam](../README.md#SudoParam), [TOTPHeader](../README.md#TOTPHeader), [Token](../README.md#Token) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +## repo_list_hooks + +> Vec repo_list_hooks(owner, repo, page, limit) +List the hooks in a repository + +### Parameters + + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**owner** | **String** | owner of the repo | [required] | +**repo** | **String** | name of the repo | [required] | +**page** | Option<**i32**> | page number of results to return (1-based) | | +**limit** | Option<**i32**> | page size of results | | + +### Return type + +[**Vec**](Hook.md) + +### Authorization + +[AccessToken](../README.md#AccessToken), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [BasicAuth](../README.md#BasicAuth), [SudoHeader](../README.md#SudoHeader), [SudoParam](../README.md#SudoParam), [TOTPHeader](../README.md#TOTPHeader), [Token](../README.md#Token) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +## repo_list_keys + +> Vec repo_list_keys(owner, repo, key_id, fingerprint, page, limit) +List a repository's keys + +### Parameters + + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**owner** | **String** | owner of the repo | [required] | +**repo** | **String** | name of the repo | [required] | +**key_id** | Option<**i32**> | the key_id to search for | | +**fingerprint** | Option<**String**> | fingerprint of the key | | +**page** | Option<**i32**> | page number of results to return (1-based) | | +**limit** | Option<**i32**> | page size of results | | + +### Return type + +[**Vec**](DeployKey.md) + +### Authorization + +[AccessToken](../README.md#AccessToken), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [BasicAuth](../README.md#BasicAuth), [SudoHeader](../README.md#SudoHeader), [SudoParam](../README.md#SudoParam), [TOTPHeader](../README.md#TOTPHeader), [Token](../README.md#Token) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +## repo_list_pull_requests + +> Vec repo_list_pull_requests(owner, repo, state, sort, milestone, labels, page, limit) +List a repo's pull requests + +### Parameters + + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**owner** | **String** | owner of the repo | [required] | +**repo** | **String** | name of the repo | [required] | +**state** | Option<**String**> | State of pull request: open or closed (optional) | | +**sort** | Option<**String**> | Type of sort | | +**milestone** | Option<**i64**> | ID of the milestone | | +**labels** | Option<[**Vec**](i64.md)> | Label IDs | | +**page** | Option<**i32**> | page number of results to return (1-based) | | +**limit** | Option<**i32**> | page size of results | | + +### Return type + +[**Vec**](PullRequest.md) + +### Authorization + +[AccessToken](../README.md#AccessToken), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [BasicAuth](../README.md#BasicAuth), [SudoHeader](../README.md#SudoHeader), [SudoParam](../README.md#SudoParam), [TOTPHeader](../README.md#TOTPHeader), [Token](../README.md#Token) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +## repo_list_pull_reviews + +> Vec repo_list_pull_reviews(owner, repo, index, page, limit) +List all reviews for a pull request + +### Parameters + + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**owner** | **String** | owner of the repo | [required] | +**repo** | **String** | name of the repo | [required] | +**index** | **i64** | index of the pull request | [required] | +**page** | Option<**i32**> | page number of results to return (1-based) | | +**limit** | Option<**i32**> | page size of results | | + +### Return type + +[**Vec**](PullReview.md) + +### Authorization + +[AccessToken](../README.md#AccessToken), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [BasicAuth](../README.md#BasicAuth), [SudoHeader](../README.md#SudoHeader), [SudoParam](../README.md#SudoParam), [TOTPHeader](../README.md#TOTPHeader), [Token](../README.md#Token) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +## repo_list_release_attachments + +> Vec repo_list_release_attachments(owner, repo, id) +List release's attachments + +### Parameters + + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**owner** | **String** | owner of the repo | [required] | +**repo** | **String** | name of the repo | [required] | +**id** | **i64** | id of the release | [required] | + +### Return type + +[**Vec**](Attachment.md) + +### Authorization + +[AccessToken](../README.md#AccessToken), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [BasicAuth](../README.md#BasicAuth), [SudoHeader](../README.md#SudoHeader), [SudoParam](../README.md#SudoParam), [TOTPHeader](../README.md#TOTPHeader), [Token](../README.md#Token) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +## repo_list_releases + +> Vec repo_list_releases(owner, repo, draft, pre_release, per_page, page, limit) +List a repo's releases + +### Parameters + + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**owner** | **String** | owner of the repo | [required] | +**repo** | **String** | name of the repo | [required] | +**draft** | Option<**bool**> | filter (exclude / include) drafts, if you dont have repo write access none will show | | +**pre_release** | Option<**bool**> | filter (exclude / include) pre-releases | | +**per_page** | Option<**i32**> | page size of results, deprecated - use limit | | +**page** | Option<**i32**> | page number of results to return (1-based) | | +**limit** | Option<**i32**> | page size of results | | + +### Return type + +[**Vec**](Release.md) + +### Authorization + +[AccessToken](../README.md#AccessToken), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [BasicAuth](../README.md#BasicAuth), [SudoHeader](../README.md#SudoHeader), [SudoParam](../README.md#SudoParam), [TOTPHeader](../README.md#TOTPHeader), [Token](../README.md#Token) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +## repo_list_stargazers + +> Vec repo_list_stargazers(owner, repo, page, limit) +List a repo's stargazers + +### Parameters + + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**owner** | **String** | owner of the repo | [required] | +**repo** | **String** | name of the repo | [required] | +**page** | Option<**i32**> | page number of results to return (1-based) | | +**limit** | Option<**i32**> | page size of results | | + +### Return type + +[**Vec**](User.md) + +### Authorization + +[AccessToken](../README.md#AccessToken), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [BasicAuth](../README.md#BasicAuth), [SudoHeader](../README.md#SudoHeader), [SudoParam](../README.md#SudoParam), [TOTPHeader](../README.md#TOTPHeader), [Token](../README.md#Token) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +## repo_list_statuses + +> Vec repo_list_statuses(owner, repo, sha, sort, state, page, limit) +Get a commit's statuses + +### Parameters + + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**owner** | **String** | owner of the repo | [required] | +**repo** | **String** | name of the repo | [required] | +**sha** | **String** | sha of the commit | [required] | +**sort** | Option<**String**> | type of sort | | +**state** | Option<**String**> | type of state | | +**page** | Option<**i32**> | page number of results to return (1-based) | | +**limit** | Option<**i32**> | page size of results | | + +### Return type + +[**Vec**](CommitStatus.md) + +### Authorization + +[AccessToken](../README.md#AccessToken), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [BasicAuth](../README.md#BasicAuth), [SudoHeader](../README.md#SudoHeader), [SudoParam](../README.md#SudoParam), [TOTPHeader](../README.md#TOTPHeader), [Token](../README.md#Token) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +## repo_list_statuses_by_ref + +> Vec repo_list_statuses_by_ref(owner, repo, r#ref, sort, state, page, limit) +Get a commit's statuses, by branch/tag/commit reference + +### Parameters + + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**owner** | **String** | owner of the repo | [required] | +**repo** | **String** | name of the repo | [required] | +**r#ref** | **String** | name of branch/tag/commit | [required] | +**sort** | Option<**String**> | type of sort | | +**state** | Option<**String**> | type of state | | +**page** | Option<**i32**> | page number of results to return (1-based) | | +**limit** | Option<**i32**> | page size of results | | + +### Return type + +[**Vec**](CommitStatus.md) + +### Authorization + +[AccessToken](../README.md#AccessToken), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [BasicAuth](../README.md#BasicAuth), [SudoHeader](../README.md#SudoHeader), [SudoParam](../README.md#SudoParam), [TOTPHeader](../README.md#TOTPHeader), [Token](../README.md#Token) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +## repo_list_subscribers + +> Vec repo_list_subscribers(owner, repo, page, limit) +List a repo's watchers + +### Parameters + + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**owner** | **String** | owner of the repo | [required] | +**repo** | **String** | name of the repo | [required] | +**page** | Option<**i32**> | page number of results to return (1-based) | | +**limit** | Option<**i32**> | page size of results | | + +### Return type + +[**Vec**](User.md) + +### Authorization + +[AccessToken](../README.md#AccessToken), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [BasicAuth](../README.md#BasicAuth), [SudoHeader](../README.md#SudoHeader), [SudoParam](../README.md#SudoParam), [TOTPHeader](../README.md#TOTPHeader), [Token](../README.md#Token) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +## repo_list_tags + +> Vec repo_list_tags(owner, repo, page, limit) +List a repository's tags + +### Parameters + + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**owner** | **String** | owner of the repo | [required] | +**repo** | **String** | name of the repo | [required] | +**page** | Option<**i32**> | page number of results to return (1-based) | | +**limit** | Option<**i32**> | page size of results, default maximum page size is 50 | | + +### Return type + +[**Vec**](Tag.md) + +### Authorization + +[AccessToken](../README.md#AccessToken), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [BasicAuth](../README.md#BasicAuth), [SudoHeader](../README.md#SudoHeader), [SudoParam](../README.md#SudoParam), [TOTPHeader](../README.md#TOTPHeader), [Token](../README.md#Token) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +## repo_list_teams + +> Vec repo_list_teams(owner, repo) +List a repository's teams + +### Parameters + + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**owner** | **String** | owner of the repo | [required] | +**repo** | **String** | name of the repo | [required] | + +### Return type + +[**Vec**](Team.md) + +### Authorization + +[AccessToken](../README.md#AccessToken), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [BasicAuth](../README.md#BasicAuth), [SudoHeader](../README.md#SudoHeader), [SudoParam](../README.md#SudoParam), [TOTPHeader](../README.md#TOTPHeader), [Token](../README.md#Token) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +## repo_list_topics + +> crate::models::TopicName repo_list_topics(owner, repo, page, limit) +Get list of topics that a repository has + +### Parameters + + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**owner** | **String** | owner of the repo | [required] | +**repo** | **String** | name of the repo | [required] | +**page** | Option<**i32**> | page number of results to return (1-based) | | +**limit** | Option<**i32**> | page size of results | | + +### Return type + +[**crate::models::TopicName**](TopicName.md) + +### Authorization + +[AccessToken](../README.md#AccessToken), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [BasicAuth](../README.md#BasicAuth), [SudoHeader](../README.md#SudoHeader), [SudoParam](../README.md#SudoParam), [TOTPHeader](../README.md#TOTPHeader), [Token](../README.md#Token) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +## repo_merge_pull_request + +> repo_merge_pull_request(owner, repo, index, body) +Merge a pull request + +### Parameters + + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**owner** | **String** | owner of the repo | [required] | +**repo** | **String** | name of the repo | [required] | +**index** | **i64** | index of the pull request to merge | [required] | +**body** | Option<[**MergePullRequestOption**](MergePullRequestOption.md)> | | | + +### Return type + + (empty response body) + +### Authorization + +[AccessToken](../README.md#AccessToken), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [BasicAuth](../README.md#BasicAuth), [SudoHeader](../README.md#SudoHeader), [SudoParam](../README.md#SudoParam), [TOTPHeader](../README.md#TOTPHeader), [Token](../README.md#Token) + +### HTTP request headers + +- **Content-Type**: application/json, text/plain +- **Accept**: Not defined + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +## repo_migrate + +> crate::models::Repository repo_migrate(body) +Migrate a remote git repository + +### Parameters + + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**body** | Option<[**MigrateRepoOptions**](MigrateRepoOptions.md)> | | | + +### Return type + +[**crate::models::Repository**](Repository.md) + +### Authorization + +[AccessToken](../README.md#AccessToken), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [BasicAuth](../README.md#BasicAuth), [SudoHeader](../README.md#SudoHeader), [SudoParam](../README.md#SudoParam), [TOTPHeader](../README.md#TOTPHeader), [Token](../README.md#Token) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +## repo_mirror_sync + +> repo_mirror_sync(owner, repo) +Sync a mirrored repository + +### Parameters + + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**owner** | **String** | owner of the repo to sync | [required] | +**repo** | **String** | name of the repo to sync | [required] | + +### Return type + + (empty response body) + +### Authorization + +[AccessToken](../README.md#AccessToken), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [BasicAuth](../README.md#BasicAuth), [SudoHeader](../README.md#SudoHeader), [SudoParam](../README.md#SudoParam), [TOTPHeader](../README.md#TOTPHeader), [Token](../README.md#Token) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: Not defined + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +## repo_pull_request_is_merged + +> repo_pull_request_is_merged(owner, repo, index) +Check if a pull request has been merged + +### Parameters + + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**owner** | **String** | owner of the repo | [required] | +**repo** | **String** | name of the repo | [required] | +**index** | **i64** | index of the pull request | [required] | + +### Return type + + (empty response body) + +### Authorization + +[AccessToken](../README.md#AccessToken), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [BasicAuth](../README.md#BasicAuth), [SudoHeader](../README.md#SudoHeader), [SudoParam](../README.md#SudoParam), [TOTPHeader](../README.md#TOTPHeader), [Token](../README.md#Token) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: Not defined + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +## repo_search + +> crate::models::SearchResults repo_search(q, topic, include_desc, uid, priority_owner_id, team_id, starred_by, private, is_private, template, archived, mode, exclusive, sort, order, page, limit) +Search for repositories + +### Parameters + + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**q** | Option<**String**> | keyword | | +**topic** | Option<**bool**> | Limit search to repositories with keyword as topic | | +**include_desc** | Option<**bool**> | include search of keyword within repository description | | +**uid** | Option<**i64**> | search only for repos that the user with the given id owns or contributes to | | +**priority_owner_id** | Option<**i64**> | repo owner to prioritize in the results | | +**team_id** | Option<**i64**> | search only for repos that belong to the given team id | | +**starred_by** | Option<**i64**> | search only for repos that the user with the given id has starred | | +**private** | Option<**bool**> | include private repositories this user has access to (defaults to true) | | +**is_private** | Option<**bool**> | show only pubic, private or all repositories (defaults to all) | | +**template** | Option<**bool**> | include template repositories this user has access to (defaults to true) | | +**archived** | Option<**bool**> | show only archived, non-archived or all repositories (defaults to all) | | +**mode** | Option<**String**> | type of repository to search for. Supported values are \"fork\", \"source\", \"mirror\" and \"collaborative\" | | +**exclusive** | Option<**bool**> | if `uid` is given, search only for repos that the user owns | | +**sort** | Option<**String**> | sort repos by attribute. Supported values are \"alpha\", \"created\", \"updated\", \"size\", and \"id\". Default is \"alpha\" | | +**order** | Option<**String**> | sort order, either \"asc\" (ascending) or \"desc\" (descending). Default is \"asc\", ignored if \"sort\" is not specified. | | +**page** | Option<**i32**> | page number of results to return (1-based) | | +**limit** | Option<**i32**> | page size of results | | + +### Return type + +[**crate::models::SearchResults**](SearchResults.md) + +### Authorization + +[AccessToken](../README.md#AccessToken), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [BasicAuth](../README.md#BasicAuth), [SudoHeader](../README.md#SudoHeader), [SudoParam](../README.md#SudoParam), [TOTPHeader](../README.md#TOTPHeader), [Token](../README.md#Token) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +## repo_signing_key + +> String repo_signing_key(owner, repo) +Get signing-key.gpg for given repository + +### Parameters + + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**owner** | **String** | owner of the repo | [required] | +**repo** | **String** | name of the repo | [required] | + +### Return type + +**String** + +### Authorization + +[AccessToken](../README.md#AccessToken), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [BasicAuth](../README.md#BasicAuth), [SudoHeader](../README.md#SudoHeader), [SudoParam](../README.md#SudoParam), [TOTPHeader](../README.md#TOTPHeader), [Token](../README.md#Token) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: text/plain + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +## repo_submit_pull_review + +> crate::models::PullReview repo_submit_pull_review(owner, repo, index, id, body) +Submit a pending review to an pull request + +### Parameters + + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**owner** | **String** | owner of the repo | [required] | +**repo** | **String** | name of the repo | [required] | +**index** | **i64** | index of the pull request | [required] | +**id** | **i64** | id of the review | [required] | +**body** | [**SubmitPullReviewOptions**](SubmitPullReviewOptions.md) | | [required] | + +### Return type + +[**crate::models::PullReview**](PullReview.md) + +### Authorization + +[AccessToken](../README.md#AccessToken), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [BasicAuth](../README.md#BasicAuth), [SudoHeader](../README.md#SudoHeader), [SudoParam](../README.md#SudoParam), [TOTPHeader](../README.md#TOTPHeader), [Token](../README.md#Token) + +### HTTP request headers + +- **Content-Type**: application/json, text/plain +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +## repo_test_hook + +> repo_test_hook(owner, repo, id, r#ref) +Test a push webhook + +### Parameters + + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**owner** | **String** | owner of the repo | [required] | +**repo** | **String** | name of the repo | [required] | +**id** | **i64** | id of the hook to test | [required] | +**r#ref** | Option<**String**> | The name of the commit/branch/tag, indicates which commit will be loaded to the webhook payload. | | + +### Return type + + (empty response body) + +### Authorization + +[AccessToken](../README.md#AccessToken), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [BasicAuth](../README.md#BasicAuth), [SudoHeader](../README.md#SudoHeader), [SudoParam](../README.md#SudoParam), [TOTPHeader](../README.md#TOTPHeader), [Token](../README.md#Token) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: Not defined + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +## repo_tracked_times + +> Vec repo_tracked_times(owner, repo, user, since, before, page, limit) +List a repo's tracked times + +### Parameters + + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**owner** | **String** | owner of the repo | [required] | +**repo** | **String** | name of the repo | [required] | +**user** | Option<**String**> | optional filter by user (available for issue managers) | | +**since** | Option<**String**> | Only show times updated after the given time. This is a timestamp in RFC 3339 format | | +**before** | Option<**String**> | Only show times updated before the given time. This is a timestamp in RFC 3339 format | | +**page** | Option<**i32**> | page number of results to return (1-based) | | +**limit** | Option<**i32**> | page size of results | | + +### Return type + +[**Vec**](TrackedTime.md) + +### Authorization + +[AccessToken](../README.md#AccessToken), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [BasicAuth](../README.md#BasicAuth), [SudoHeader](../README.md#SudoHeader), [SudoParam](../README.md#SudoParam), [TOTPHeader](../README.md#TOTPHeader), [Token](../README.md#Token) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +## repo_transfer + +> crate::models::Repository repo_transfer(owner, repo, body) +Transfer a repo ownership + +### Parameters + + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**owner** | **String** | owner of the repo to transfer | [required] | +**repo** | **String** | name of the repo to transfer | [required] | +**body** | [**TransferRepoOption**](TransferRepoOption.md) | Transfer Options | [required] | + +### Return type + +[**crate::models::Repository**](Repository.md) + +### Authorization + +[AccessToken](../README.md#AccessToken), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [BasicAuth](../README.md#BasicAuth), [SudoHeader](../README.md#SudoHeader), [SudoParam](../README.md#SudoParam), [TOTPHeader](../README.md#TOTPHeader), [Token](../README.md#Token) + +### HTTP request headers + +- **Content-Type**: application/json, text/plain +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +## repo_un_dismiss_pull_review + +> crate::models::PullReview repo_un_dismiss_pull_review(owner, repo, index, id) +Cancel to dismiss a review for a pull request + +### Parameters + + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**owner** | **String** | owner of the repo | [required] | +**repo** | **String** | name of the repo | [required] | +**index** | **i64** | index of the pull request | [required] | +**id** | **i64** | id of the review | [required] | + +### Return type + +[**crate::models::PullReview**](PullReview.md) + +### Authorization + +[AccessToken](../README.md#AccessToken), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [BasicAuth](../README.md#BasicAuth), [SudoHeader](../README.md#SudoHeader), [SudoParam](../README.md#SudoParam), [TOTPHeader](../README.md#TOTPHeader), [Token](../README.md#Token) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +## repo_update_file + +> crate::models::FileResponse repo_update_file(owner, repo, filepath, body) +Update a file in a repository + +### Parameters + + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**owner** | **String** | owner of the repo | [required] | +**repo** | **String** | name of the repo | [required] | +**filepath** | **String** | path of the file to update | [required] | +**body** | [**UpdateFileOptions**](UpdateFileOptions.md) | | [required] | + +### Return type + +[**crate::models::FileResponse**](FileResponse.md) + +### Authorization + +[AccessToken](../README.md#AccessToken), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [BasicAuth](../README.md#BasicAuth), [SudoHeader](../README.md#SudoHeader), [SudoParam](../README.md#SudoParam), [TOTPHeader](../README.md#TOTPHeader), [Token](../README.md#Token) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +## repo_update_pull_request + +> repo_update_pull_request(owner, repo, index, style) +Merge PR's baseBranch into headBranch + +### Parameters + + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**owner** | **String** | owner of the repo | [required] | +**repo** | **String** | name of the repo | [required] | +**index** | **i64** | index of the pull request to get | [required] | +**style** | Option<**String**> | how to update pull request | | + +### Return type + + (empty response body) + +### Authorization + +[AccessToken](../README.md#AccessToken), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [BasicAuth](../README.md#BasicAuth), [SudoHeader](../README.md#SudoHeader), [SudoParam](../README.md#SudoParam), [TOTPHeader](../README.md#TOTPHeader), [Token](../README.md#Token) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: Not defined + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +## repo_update_topics + +> repo_update_topics(owner, repo, body) +Replace list of topics for a repository + +### Parameters + + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**owner** | **String** | owner of the repo | [required] | +**repo** | **String** | name of the repo | [required] | +**body** | Option<[**RepoTopicOptions**](RepoTopicOptions.md)> | | | + +### Return type + + (empty response body) + +### Authorization + +[AccessToken](../README.md#AccessToken), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [BasicAuth](../README.md#BasicAuth), [SudoHeader](../README.md#SudoHeader), [SudoParam](../README.md#SudoParam), [TOTPHeader](../README.md#TOTPHeader), [Token](../README.md#Token) + +### HTTP request headers + +- **Content-Type**: application/json, text/plain +- **Accept**: Not defined + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +## topic_search + +> Vec topic_search(q, page, limit) +search topics via keyword + +### Parameters + + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**q** | **String** | keywords to search | [required] | +**page** | Option<**i32**> | page number of results to return (1-based) | | +**limit** | Option<**i32**> | page size of results | | + +### Return type + +[**Vec**](TopicResponse.md) + +### Authorization + +[AccessToken](../README.md#AccessToken), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [BasicAuth](../README.md#BasicAuth), [SudoHeader](../README.md#SudoHeader), [SudoParam](../README.md#SudoParam), [TOTPHeader](../README.md#TOTPHeader), [Token](../README.md#Token) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +## user_current_check_subscription + +> crate::models::WatchInfo user_current_check_subscription(owner, repo) +Check if the current user is watching a repo + +### Parameters + + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**owner** | **String** | owner of the repo | [required] | +**repo** | **String** | name of the repo | [required] | + +### Return type + +[**crate::models::WatchInfo**](WatchInfo.md) + +### Authorization + +[AccessToken](../README.md#AccessToken), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [BasicAuth](../README.md#BasicAuth), [SudoHeader](../README.md#SudoHeader), [SudoParam](../README.md#SudoParam), [TOTPHeader](../README.md#TOTPHeader), [Token](../README.md#Token) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json, text/html + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +## user_current_delete_subscription + +> user_current_delete_subscription(owner, repo) +Unwatch a repo + +### Parameters + + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**owner** | **String** | owner of the repo | [required] | +**repo** | **String** | name of the repo | [required] | + +### Return type + + (empty response body) + +### Authorization + +[AccessToken](../README.md#AccessToken), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [BasicAuth](../README.md#BasicAuth), [SudoHeader](../README.md#SudoHeader), [SudoParam](../README.md#SudoParam), [TOTPHeader](../README.md#TOTPHeader), [Token](../README.md#Token) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: Not defined + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +## user_current_put_subscription + +> crate::models::WatchInfo user_current_put_subscription(owner, repo) +Watch a repo + +### Parameters + + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**owner** | **String** | owner of the repo | [required] | +**repo** | **String** | name of the repo | [required] | + +### Return type + +[**crate::models::WatchInfo**](WatchInfo.md) + +### Authorization + +[AccessToken](../README.md#AccessToken), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [BasicAuth](../README.md#BasicAuth), [SudoHeader](../README.md#SudoHeader), [SudoParam](../README.md#SudoParam), [TOTPHeader](../README.md#TOTPHeader), [Token](../README.md#Token) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json, text/html + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +## user_tracked_times + +> Vec user_tracked_times(owner, repo, user) +List a user's tracked times in a repo + +### Parameters + + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**owner** | **String** | owner of the repo | [required] | +**repo** | **String** | name of the repo | [required] | +**user** | **String** | username of user | [required] | + +### Return type + +[**Vec**](TrackedTime.md) + +### Authorization + +[AccessToken](../README.md#AccessToken), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [BasicAuth](../README.md#BasicAuth), [SudoHeader](../README.md#SudoHeader), [SudoParam](../README.md#SudoParam), [TOTPHeader](../README.md#TOTPHeader), [Token](../README.md#Token) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + diff --git a/crates/gitea_raw_client/docs/RepositoryMeta.md b/crates/gitea_raw_client/docs/RepositoryMeta.md new file mode 100644 index 0000000..58daa18 --- /dev/null +++ b/crates/gitea_raw_client/docs/RepositoryMeta.md @@ -0,0 +1,14 @@ +# RepositoryMeta + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**full_name** | Option<**String**> | | [optional] +**id** | Option<**i64**> | | [optional] +**name** | Option<**String**> | | [optional] +**owner** | Option<**String**> | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/crates/gitea_raw_client/docs/SearchResults.md b/crates/gitea_raw_client/docs/SearchResults.md new file mode 100644 index 0000000..d34f731 --- /dev/null +++ b/crates/gitea_raw_client/docs/SearchResults.md @@ -0,0 +1,12 @@ +# SearchResults + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**data** | Option<[**Vec**](Repository.md)> | | [optional] +**ok** | Option<**bool**> | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/crates/gitea_raw_client/docs/ServerVersion.md b/crates/gitea_raw_client/docs/ServerVersion.md new file mode 100644 index 0000000..96ba26f --- /dev/null +++ b/crates/gitea_raw_client/docs/ServerVersion.md @@ -0,0 +1,11 @@ +# ServerVersion + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**version** | Option<**String**> | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/crates/gitea_raw_client/docs/SettingsApi.md b/crates/gitea_raw_client/docs/SettingsApi.md new file mode 100644 index 0000000..f3ac91b --- /dev/null +++ b/crates/gitea_raw_client/docs/SettingsApi.md @@ -0,0 +1,112 @@ +# \SettingsApi + +All URIs are relative to */api/v1* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**get_general_api_settings**](SettingsApi.md#get_general_api_settings) | **GET** /settings/api | Get instance's global settings for api +[**get_general_attachment_settings**](SettingsApi.md#get_general_attachment_settings) | **GET** /settings/attachment | Get instance's global settings for Attachment +[**get_general_repository_settings**](SettingsApi.md#get_general_repository_settings) | **GET** /settings/repository | Get instance's global settings for repositories +[**get_general_ui_settings**](SettingsApi.md#get_general_ui_settings) | **GET** /settings/ui | Get instance's global settings for ui + + + +## get_general_api_settings + +> crate::models::GeneralApiSettings get_general_api_settings() +Get instance's global settings for api + +### Parameters + +This endpoint does not need any parameter. + +### Return type + +[**crate::models::GeneralApiSettings**](GeneralAPISettings.md) + +### Authorization + +[AccessToken](../README.md#AccessToken), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [BasicAuth](../README.md#BasicAuth), [SudoHeader](../README.md#SudoHeader), [SudoParam](../README.md#SudoParam), [TOTPHeader](../README.md#TOTPHeader), [Token](../README.md#Token) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +## get_general_attachment_settings + +> crate::models::GeneralAttachmentSettings get_general_attachment_settings() +Get instance's global settings for Attachment + +### Parameters + +This endpoint does not need any parameter. + +### Return type + +[**crate::models::GeneralAttachmentSettings**](GeneralAttachmentSettings.md) + +### Authorization + +[AccessToken](../README.md#AccessToken), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [BasicAuth](../README.md#BasicAuth), [SudoHeader](../README.md#SudoHeader), [SudoParam](../README.md#SudoParam), [TOTPHeader](../README.md#TOTPHeader), [Token](../README.md#Token) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +## get_general_repository_settings + +> crate::models::GeneralRepoSettings get_general_repository_settings() +Get instance's global settings for repositories + +### Parameters + +This endpoint does not need any parameter. + +### Return type + +[**crate::models::GeneralRepoSettings**](GeneralRepoSettings.md) + +### Authorization + +[AccessToken](../README.md#AccessToken), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [BasicAuth](../README.md#BasicAuth), [SudoHeader](../README.md#SudoHeader), [SudoParam](../README.md#SudoParam), [TOTPHeader](../README.md#TOTPHeader), [Token](../README.md#Token) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +## get_general_ui_settings + +> crate::models::GeneralUiSettings get_general_ui_settings() +Get instance's global settings for ui + +### Parameters + +This endpoint does not need any parameter. + +### Return type + +[**crate::models::GeneralUiSettings**](GeneralUISettings.md) + +### Authorization + +[AccessToken](../README.md#AccessToken), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [BasicAuth](../README.md#BasicAuth), [SudoHeader](../README.md#SudoHeader), [SudoParam](../README.md#SudoParam), [TOTPHeader](../README.md#TOTPHeader), [Token](../README.md#Token) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + diff --git a/crates/gitea_raw_client/docs/StopWatch.md b/crates/gitea_raw_client/docs/StopWatch.md new file mode 100644 index 0000000..fb0b10b --- /dev/null +++ b/crates/gitea_raw_client/docs/StopWatch.md @@ -0,0 +1,17 @@ +# StopWatch + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**created** | Option<**String**> | | [optional] +**duration** | Option<**String**> | | [optional] +**issue_index** | Option<**i64**> | | [optional] +**issue_title** | Option<**String**> | | [optional] +**repo_name** | Option<**String**> | | [optional] +**repo_owner_name** | Option<**String**> | | [optional] +**seconds** | Option<**i64**> | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/crates/gitea_raw_client/docs/SubmitPullReviewOptions.md b/crates/gitea_raw_client/docs/SubmitPullReviewOptions.md new file mode 100644 index 0000000..2be076a --- /dev/null +++ b/crates/gitea_raw_client/docs/SubmitPullReviewOptions.md @@ -0,0 +1,12 @@ +# SubmitPullReviewOptions + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**body** | Option<**String**> | | [optional] +**event** | Option<**String**> | ReviewStateType review state type | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/crates/gitea_raw_client/docs/Tag.md b/crates/gitea_raw_client/docs/Tag.md new file mode 100644 index 0000000..36fb6cb --- /dev/null +++ b/crates/gitea_raw_client/docs/Tag.md @@ -0,0 +1,16 @@ +# Tag + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**commit** | Option<[**crate::models::CommitMeta**](CommitMeta.md)> | | [optional] +**id** | Option<**String**> | | [optional] +**message** | Option<**String**> | | [optional] +**name** | Option<**String**> | | [optional] +**tarball_url** | Option<**String**> | | [optional] +**zipball_url** | Option<**String**> | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/crates/gitea_raw_client/docs/Team.md b/crates/gitea_raw_client/docs/Team.md new file mode 100644 index 0000000..82796b8 --- /dev/null +++ b/crates/gitea_raw_client/docs/Team.md @@ -0,0 +1,19 @@ +# Team + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**can_create_org_repo** | Option<**bool**> | | [optional] +**description** | Option<**String**> | | [optional] +**id** | Option<**i64**> | | [optional] +**includes_all_repositories** | Option<**bool**> | | [optional] +**name** | Option<**String**> | | [optional] +**organization** | Option<[**crate::models::Organization**](Organization.md)> | | [optional] +**permission** | Option<**String**> | | [optional] +**units** | Option<**Vec**> | | [optional] +**units_map** | Option<**::std::collections::HashMap**> | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/crates/gitea_raw_client/docs/TeamSearch200Response.md b/crates/gitea_raw_client/docs/TeamSearch200Response.md new file mode 100644 index 0000000..2f528c8 --- /dev/null +++ b/crates/gitea_raw_client/docs/TeamSearch200Response.md @@ -0,0 +1,12 @@ +# TeamSearch200Response + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**data** | Option<[**Vec**](Team.md)> | | [optional] +**ok** | Option<**bool**> | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/crates/gitea_raw_client/docs/TimelineComment.md b/crates/gitea_raw_client/docs/TimelineComment.md new file mode 100644 index 0000000..3cbef2c --- /dev/null +++ b/crates/gitea_raw_client/docs/TimelineComment.md @@ -0,0 +1,39 @@ +# TimelineComment + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**assignee** | Option<[**crate::models::User**](User.md)> | | [optional] +**assignee_team** | Option<[**crate::models::Team**](Team.md)> | | [optional] +**body** | Option<**String**> | | [optional] +**created_at** | Option<**String**> | | [optional] +**dependent_issue** | Option<[**crate::models::Issue**](Issue.md)> | | [optional] +**html_url** | Option<**String**> | | [optional] +**id** | Option<**i64**> | | [optional] +**issue_url** | Option<**String**> | | [optional] +**label** | Option<[**crate::models::Label**](Label.md)> | | [optional] +**milestone** | Option<[**crate::models::Milestone**](Milestone.md)> | | [optional] +**new_ref** | Option<**String**> | | [optional] +**new_title** | Option<**String**> | | [optional] +**old_milestone** | Option<[**crate::models::Milestone**](Milestone.md)> | | [optional] +**old_project_id** | Option<**i64**> | | [optional] +**old_ref** | Option<**String**> | | [optional] +**old_title** | Option<**String**> | | [optional] +**project_id** | Option<**i64**> | | [optional] +**pull_request_url** | Option<**String**> | | [optional] +**ref_action** | Option<**String**> | | [optional] +**ref_comment** | Option<[**crate::models::Comment**](Comment.md)> | | [optional] +**ref_commit_sha** | Option<**String**> | commit SHA where issue/PR was referenced | [optional] +**ref_issue** | Option<[**crate::models::Issue**](Issue.md)> | | [optional] +**removed_assignee** | Option<**bool**> | whether the assignees were removed or added | [optional] +**resolve_doer** | Option<[**crate::models::User**](User.md)> | | [optional] +**review_id** | Option<**i64**> | | [optional] +**tracked_time** | Option<[**crate::models::TrackedTime**](TrackedTime.md)> | | [optional] +**r#type** | Option<**String**> | | [optional] +**updated_at** | Option<**String**> | | [optional] +**user** | Option<[**crate::models::User**](User.md)> | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/crates/gitea_raw_client/docs/TopicName.md b/crates/gitea_raw_client/docs/TopicName.md new file mode 100644 index 0000000..8a07731 --- /dev/null +++ b/crates/gitea_raw_client/docs/TopicName.md @@ -0,0 +1,11 @@ +# TopicName + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**topics** | Option<**Vec**> | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/crates/gitea_raw_client/docs/TopicResponse.md b/crates/gitea_raw_client/docs/TopicResponse.md new file mode 100644 index 0000000..e018c94 --- /dev/null +++ b/crates/gitea_raw_client/docs/TopicResponse.md @@ -0,0 +1,15 @@ +# TopicResponse + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**created** | Option<**String**> | | [optional] +**id** | Option<**i64**> | | [optional] +**repo_count** | Option<**i64**> | | [optional] +**topic_name** | Option<**String**> | | [optional] +**updated** | Option<**String**> | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/crates/gitea_raw_client/docs/TrackedTime.md b/crates/gitea_raw_client/docs/TrackedTime.md new file mode 100644 index 0000000..8f636dc --- /dev/null +++ b/crates/gitea_raw_client/docs/TrackedTime.md @@ -0,0 +1,17 @@ +# TrackedTime + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**created** | Option<**String**> | | [optional] +**id** | Option<**i64**> | | [optional] +**issue** | Option<[**crate::models::Issue**](Issue.md)> | | [optional] +**issue_id** | Option<**i64**> | deprecated (only for backwards compatibility) | [optional] +**time** | Option<**i64**> | Time in seconds | [optional] +**user_id** | Option<**i64**> | deprecated (only for backwards compatibility) | [optional] +**user_name** | Option<**String**> | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/crates/gitea_raw_client/docs/TransferRepoOption.md b/crates/gitea_raw_client/docs/TransferRepoOption.md new file mode 100644 index 0000000..04b5f3e --- /dev/null +++ b/crates/gitea_raw_client/docs/TransferRepoOption.md @@ -0,0 +1,12 @@ +# TransferRepoOption + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**new_owner** | **String** | | +**team_ids** | Option<**Vec**> | ID of the team or teams to add to the repository. Teams can only be added to organization-owned repositories. | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/crates/gitea_raw_client/docs/UpdateFileOptions.md b/crates/gitea_raw_client/docs/UpdateFileOptions.md new file mode 100644 index 0000000..379fdf2 --- /dev/null +++ b/crates/gitea_raw_client/docs/UpdateFileOptions.md @@ -0,0 +1,20 @@ +# UpdateFileOptions + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**author** | Option<[**crate::models::Identity**](Identity.md)> | | [optional] +**branch** | Option<**String**> | branch (optional) to base this file from. if not given, the default branch is used | [optional] +**committer** | Option<[**crate::models::Identity**](Identity.md)> | | [optional] +**content** | **String** | content must be base64 encoded | +**dates** | Option<[**crate::models::CommitDateOptions**](CommitDateOptions.md)> | | [optional] +**from_path** | Option<**String**> | from_path (optional) is the path of the original file which will be moved/renamed to the path in the URL | [optional] +**message** | Option<**String**> | message (optional) for the commit of this file. if not supplied, a default message will be used | [optional] +**new_branch** | Option<**String**> | new_branch (optional) will make a new branch from `branch` before creating the file | [optional] +**sha** | **String** | sha is the SHA for the file that already exists | +**signoff** | Option<**bool**> | Add a Signed-off-by trailer by the committer at the end of the commit log message. | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/crates/gitea_raw_client/docs/User.md b/crates/gitea_raw_client/docs/User.md new file mode 100644 index 0000000..c70fb02 --- /dev/null +++ b/crates/gitea_raw_client/docs/User.md @@ -0,0 +1,29 @@ +# User + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**active** | Option<**bool**> | Is user active | [optional] +**avatar_url** | Option<**String**> | URL to the user's avatar | [optional] +**created** | Option<**String**> | | [optional] +**description** | Option<**String**> | the user's description | [optional] +**email** | Option<**String**> | | [optional] +**followers_count** | Option<**i64**> | user counts | [optional] +**following_count** | Option<**i64**> | | [optional] +**full_name** | Option<**String**> | the user's full name | [optional] +**id** | Option<**i64**> | the user's id | [optional] +**is_admin** | Option<**bool**> | Is the user an administrator | [optional] +**language** | Option<**String**> | User locale | [optional] +**last_login** | Option<**String**> | | [optional] +**location** | Option<**String**> | the user's location | [optional] +**login** | Option<**String**> | the user's username | [optional] +**prohibit_login** | Option<**bool**> | Is user login prohibited | [optional] +**restricted** | Option<**bool**> | Is user restricted | [optional] +**starred_repos_count** | Option<**i64**> | | [optional] +**visibility** | Option<**String**> | User visibility level option: public, limited, private | [optional] +**website** | Option<**String**> | the user's website | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/crates/gitea_raw_client/docs/UserApi.md b/crates/gitea_raw_client/docs/UserApi.md new file mode 100644 index 0000000..b972c1b --- /dev/null +++ b/crates/gitea_raw_client/docs/UserApi.md @@ -0,0 +1,1484 @@ +# \UserApi + +All URIs are relative to */api/v1* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**create_current_user_repo**](UserApi.md#create_current_user_repo) | **POST** /user/repos | Create a repository +[**get_user_settings**](UserApi.md#get_user_settings) | **GET** /user/settings | Get user settings +[**get_verification_token**](UserApi.md#get_verification_token) | **GET** /user/gpg_key_token | Get a Token to verify +[**update_user_settings**](UserApi.md#update_user_settings) | **PATCH** /user/settings | Update user settings +[**user_add_email**](UserApi.md#user_add_email) | **POST** /user/emails | Add email addresses +[**user_check_following**](UserApi.md#user_check_following) | **GET** /users/{username}/following/{target} | Check if one user is following another user +[**user_create_o_auth2_application**](UserApi.md#user_create_o_auth2_application) | **POST** /user/applications/oauth2 | creates a new OAuth2 application +[**user_create_token**](UserApi.md#user_create_token) | **POST** /users/{username}/tokens | Create an access token +[**user_current_check_following**](UserApi.md#user_current_check_following) | **GET** /user/following/{username} | Check whether a user is followed by the authenticated user +[**user_current_check_starring**](UserApi.md#user_current_check_starring) | **GET** /user/starred/{owner}/{repo} | Whether the authenticated is starring the repo +[**user_current_delete_follow**](UserApi.md#user_current_delete_follow) | **DELETE** /user/following/{username} | Unfollow a user +[**user_current_delete_gpg_key**](UserApi.md#user_current_delete_gpg_key) | **DELETE** /user/gpg_keys/{id} | Remove a GPG key +[**user_current_delete_key**](UserApi.md#user_current_delete_key) | **DELETE** /user/keys/{id} | Delete a public key +[**user_current_delete_star**](UserApi.md#user_current_delete_star) | **DELETE** /user/starred/{owner}/{repo} | Unstar the given repo +[**user_current_get_gpg_key**](UserApi.md#user_current_get_gpg_key) | **GET** /user/gpg_keys/{id} | Get a GPG key +[**user_current_get_key**](UserApi.md#user_current_get_key) | **GET** /user/keys/{id} | Get a public key +[**user_current_list_followers**](UserApi.md#user_current_list_followers) | **GET** /user/followers | List the authenticated user's followers +[**user_current_list_following**](UserApi.md#user_current_list_following) | **GET** /user/following | List the users that the authenticated user is following +[**user_current_list_gpg_keys**](UserApi.md#user_current_list_gpg_keys) | **GET** /user/gpg_keys | List the authenticated user's GPG keys +[**user_current_list_keys**](UserApi.md#user_current_list_keys) | **GET** /user/keys | List the authenticated user's public keys +[**user_current_list_repos**](UserApi.md#user_current_list_repos) | **GET** /user/repos | List the repos that the authenticated user owns +[**user_current_list_starred**](UserApi.md#user_current_list_starred) | **GET** /user/starred | The repos that the authenticated user has starred +[**user_current_list_subscriptions**](UserApi.md#user_current_list_subscriptions) | **GET** /user/subscriptions | List repositories watched by the authenticated user +[**user_current_post_gpg_key**](UserApi.md#user_current_post_gpg_key) | **POST** /user/gpg_keys | Create a GPG key +[**user_current_post_key**](UserApi.md#user_current_post_key) | **POST** /user/keys | Create a public key +[**user_current_put_follow**](UserApi.md#user_current_put_follow) | **PUT** /user/following/{username} | Follow a user +[**user_current_put_star**](UserApi.md#user_current_put_star) | **PUT** /user/starred/{owner}/{repo} | Star the given repo +[**user_current_tracked_times**](UserApi.md#user_current_tracked_times) | **GET** /user/times | List the current user's tracked times +[**user_delete_access_token**](UserApi.md#user_delete_access_token) | **DELETE** /users/{username}/tokens/{token} | delete an access token +[**user_delete_email**](UserApi.md#user_delete_email) | **DELETE** /user/emails | Delete email addresses +[**user_delete_o_auth2_application**](UserApi.md#user_delete_o_auth2_application) | **DELETE** /user/applications/oauth2/{id} | delete an OAuth2 Application +[**user_get**](UserApi.md#user_get) | **GET** /users/{username} | Get a user +[**user_get_current**](UserApi.md#user_get_current) | **GET** /user | Get the authenticated user +[**user_get_heatmap_data**](UserApi.md#user_get_heatmap_data) | **GET** /users/{username}/heatmap | Get a user's heatmap +[**user_get_o_auth2_application**](UserApi.md#user_get_o_auth2_application) | **GET** /user/applications/oauth2/{id} | get an OAuth2 Application +[**user_get_oauth2_application**](UserApi.md#user_get_oauth2_application) | **GET** /user/applications/oauth2 | List the authenticated user's oauth2 applications +[**user_get_stop_watches**](UserApi.md#user_get_stop_watches) | **GET** /user/stopwatches | Get list of all existing stopwatches +[**user_get_tokens**](UserApi.md#user_get_tokens) | **GET** /users/{username}/tokens | List the authenticated user's access tokens +[**user_list_emails**](UserApi.md#user_list_emails) | **GET** /user/emails | List the authenticated user's email addresses +[**user_list_followers**](UserApi.md#user_list_followers) | **GET** /users/{username}/followers | List the given user's followers +[**user_list_following**](UserApi.md#user_list_following) | **GET** /users/{username}/following | List the users that the given user is following +[**user_list_gpg_keys**](UserApi.md#user_list_gpg_keys) | **GET** /users/{username}/gpg_keys | List the given user's GPG keys +[**user_list_keys**](UserApi.md#user_list_keys) | **GET** /users/{username}/keys | List the given user's public keys +[**user_list_repos**](UserApi.md#user_list_repos) | **GET** /users/{username}/repos | List the repos owned by the given user +[**user_list_starred**](UserApi.md#user_list_starred) | **GET** /users/{username}/starred | The repos that the given user has starred +[**user_list_subscriptions**](UserApi.md#user_list_subscriptions) | **GET** /users/{username}/subscriptions | List the repositories watched by a user +[**user_list_teams**](UserApi.md#user_list_teams) | **GET** /user/teams | List all the teams a user belongs to +[**user_search**](UserApi.md#user_search) | **GET** /users/search | Search for users +[**user_update_o_auth2_application**](UserApi.md#user_update_o_auth2_application) | **PATCH** /user/applications/oauth2/{id} | update an OAuth2 Application, this includes regenerating the client secret +[**user_verify_gpg_key**](UserApi.md#user_verify_gpg_key) | **POST** /user/gpg_key_verify | Verify a GPG key + + + +## create_current_user_repo + +> crate::models::Repository create_current_user_repo(body) +Create a repository + +### Parameters + + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**body** | Option<[**CreateRepoOption**](CreateRepoOption.md)> | | | + +### Return type + +[**crate::models::Repository**](Repository.md) + +### Authorization + +[AccessToken](../README.md#AccessToken), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [BasicAuth](../README.md#BasicAuth), [SudoHeader](../README.md#SudoHeader), [SudoParam](../README.md#SudoParam), [TOTPHeader](../README.md#TOTPHeader), [Token](../README.md#Token) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +## get_user_settings + +> Vec get_user_settings() +Get user settings + +### Parameters + +This endpoint does not need any parameter. + +### Return type + +[**Vec**](UserSettings.md) + +### Authorization + +[AccessToken](../README.md#AccessToken), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [BasicAuth](../README.md#BasicAuth), [SudoHeader](../README.md#SudoHeader), [SudoParam](../README.md#SudoParam), [TOTPHeader](../README.md#TOTPHeader), [Token](../README.md#Token) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +## get_verification_token + +> String get_verification_token() +Get a Token to verify + +### Parameters + +This endpoint does not need any parameter. + +### Return type + +**String** + +### Authorization + +[AccessToken](../README.md#AccessToken), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [BasicAuth](../README.md#BasicAuth), [SudoHeader](../README.md#SudoHeader), [SudoParam](../README.md#SudoParam), [TOTPHeader](../README.md#TOTPHeader), [Token](../README.md#Token) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: text/plain + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +## update_user_settings + +> Vec update_user_settings(body) +Update user settings + +### Parameters + + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**body** | Option<[**UserSettingsOptions**](UserSettingsOptions.md)> | | | + +### Return type + +[**Vec**](UserSettings.md) + +### Authorization + +[AccessToken](../README.md#AccessToken), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [BasicAuth](../README.md#BasicAuth), [SudoHeader](../README.md#SudoHeader), [SudoParam](../README.md#SudoParam), [TOTPHeader](../README.md#TOTPHeader), [Token](../README.md#Token) + +### HTTP request headers + +- **Content-Type**: application/json, text/plain +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +## user_add_email + +> Vec user_add_email(body) +Add email addresses + +### Parameters + + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**body** | Option<[**CreateEmailOption**](CreateEmailOption.md)> | | | + +### Return type + +[**Vec**](Email.md) + +### Authorization + +[AccessToken](../README.md#AccessToken), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [BasicAuth](../README.md#BasicAuth), [SudoHeader](../README.md#SudoHeader), [SudoParam](../README.md#SudoParam), [TOTPHeader](../README.md#TOTPHeader), [Token](../README.md#Token) + +### HTTP request headers + +- **Content-Type**: application/json, text/plain +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +## user_check_following + +> user_check_following(username, target) +Check if one user is following another user + +### Parameters + + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**username** | **String** | username of following user | [required] | +**target** | **String** | username of followed user | [required] | + +### Return type + + (empty response body) + +### Authorization + +[AccessToken](../README.md#AccessToken), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [BasicAuth](../README.md#BasicAuth), [SudoHeader](../README.md#SudoHeader), [SudoParam](../README.md#SudoParam), [TOTPHeader](../README.md#TOTPHeader), [Token](../README.md#Token) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: Not defined + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +## user_create_o_auth2_application + +> crate::models::OAuth2Application user_create_o_auth2_application(body) +creates a new OAuth2 application + +### Parameters + + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**body** | [**CreateOAuth2ApplicationOptions**](CreateOAuth2ApplicationOptions.md) | | [required] | + +### Return type + +[**crate::models::OAuth2Application**](OAuth2Application.md) + +### Authorization + +[AccessToken](../README.md#AccessToken), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [BasicAuth](../README.md#BasicAuth), [SudoHeader](../README.md#SudoHeader), [SudoParam](../README.md#SudoParam), [TOTPHeader](../README.md#TOTPHeader), [Token](../README.md#Token) + +### HTTP request headers + +- **Content-Type**: application/json, text/plain +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +## user_create_token + +> crate::models::AccessToken user_create_token(username, user_create_token) +Create an access token + +### Parameters + + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**username** | **String** | username of user | [required] | +**user_create_token** | Option<[**CreateAccessTokenOption**](CreateAccessTokenOption.md)> | | | + +### Return type + +[**crate::models::AccessToken**](AccessToken.md) + +### Authorization + +[AccessToken](../README.md#AccessToken), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [BasicAuth](../README.md#BasicAuth), [SudoHeader](../README.md#SudoHeader), [SudoParam](../README.md#SudoParam), [TOTPHeader](../README.md#TOTPHeader), [Token](../README.md#Token) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +## user_current_check_following + +> user_current_check_following(username) +Check whether a user is followed by the authenticated user + +### Parameters + + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**username** | **String** | username of followed user | [required] | + +### Return type + + (empty response body) + +### Authorization + +[AccessToken](../README.md#AccessToken), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [BasicAuth](../README.md#BasicAuth), [SudoHeader](../README.md#SudoHeader), [SudoParam](../README.md#SudoParam), [TOTPHeader](../README.md#TOTPHeader), [Token](../README.md#Token) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: Not defined + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +## user_current_check_starring + +> user_current_check_starring(owner, repo) +Whether the authenticated is starring the repo + +### Parameters + + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**owner** | **String** | owner of the repo | [required] | +**repo** | **String** | name of the repo | [required] | + +### Return type + + (empty response body) + +### Authorization + +[AccessToken](../README.md#AccessToken), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [BasicAuth](../README.md#BasicAuth), [SudoHeader](../README.md#SudoHeader), [SudoParam](../README.md#SudoParam), [TOTPHeader](../README.md#TOTPHeader), [Token](../README.md#Token) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: Not defined + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +## user_current_delete_follow + +> user_current_delete_follow(username) +Unfollow a user + +### Parameters + + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**username** | **String** | username of user to unfollow | [required] | + +### Return type + + (empty response body) + +### Authorization + +[AccessToken](../README.md#AccessToken), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [BasicAuth](../README.md#BasicAuth), [SudoHeader](../README.md#SudoHeader), [SudoParam](../README.md#SudoParam), [TOTPHeader](../README.md#TOTPHeader), [Token](../README.md#Token) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: Not defined + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +## user_current_delete_gpg_key + +> user_current_delete_gpg_key(id) +Remove a GPG key + +### Parameters + + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**id** | **i64** | id of key to delete | [required] | + +### Return type + + (empty response body) + +### Authorization + +[AccessToken](../README.md#AccessToken), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [BasicAuth](../README.md#BasicAuth), [SudoHeader](../README.md#SudoHeader), [SudoParam](../README.md#SudoParam), [TOTPHeader](../README.md#TOTPHeader), [Token](../README.md#Token) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: Not defined + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +## user_current_delete_key + +> user_current_delete_key(id) +Delete a public key + +### Parameters + + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**id** | **i64** | id of key to delete | [required] | + +### Return type + + (empty response body) + +### Authorization + +[AccessToken](../README.md#AccessToken), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [BasicAuth](../README.md#BasicAuth), [SudoHeader](../README.md#SudoHeader), [SudoParam](../README.md#SudoParam), [TOTPHeader](../README.md#TOTPHeader), [Token](../README.md#Token) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: Not defined + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +## user_current_delete_star + +> user_current_delete_star(owner, repo) +Unstar the given repo + +### Parameters + + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**owner** | **String** | owner of the repo to unstar | [required] | +**repo** | **String** | name of the repo to unstar | [required] | + +### Return type + + (empty response body) + +### Authorization + +[AccessToken](../README.md#AccessToken), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [BasicAuth](../README.md#BasicAuth), [SudoHeader](../README.md#SudoHeader), [SudoParam](../README.md#SudoParam), [TOTPHeader](../README.md#TOTPHeader), [Token](../README.md#Token) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: Not defined + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +## user_current_get_gpg_key + +> crate::models::GpgKey user_current_get_gpg_key(id) +Get a GPG key + +### Parameters + + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**id** | **i64** | id of key to get | [required] | + +### Return type + +[**crate::models::GpgKey**](GPGKey.md) + +### Authorization + +[AccessToken](../README.md#AccessToken), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [BasicAuth](../README.md#BasicAuth), [SudoHeader](../README.md#SudoHeader), [SudoParam](../README.md#SudoParam), [TOTPHeader](../README.md#TOTPHeader), [Token](../README.md#Token) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +## user_current_get_key + +> crate::models::PublicKey user_current_get_key(id) +Get a public key + +### Parameters + + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**id** | **i64** | id of key to get | [required] | + +### Return type + +[**crate::models::PublicKey**](PublicKey.md) + +### Authorization + +[AccessToken](../README.md#AccessToken), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [BasicAuth](../README.md#BasicAuth), [SudoHeader](../README.md#SudoHeader), [SudoParam](../README.md#SudoParam), [TOTPHeader](../README.md#TOTPHeader), [Token](../README.md#Token) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +## user_current_list_followers + +> Vec user_current_list_followers(page, limit) +List the authenticated user's followers + +### Parameters + + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**page** | Option<**i32**> | page number of results to return (1-based) | | +**limit** | Option<**i32**> | page size of results | | + +### Return type + +[**Vec**](User.md) + +### Authorization + +[AccessToken](../README.md#AccessToken), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [BasicAuth](../README.md#BasicAuth), [SudoHeader](../README.md#SudoHeader), [SudoParam](../README.md#SudoParam), [TOTPHeader](../README.md#TOTPHeader), [Token](../README.md#Token) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +## user_current_list_following + +> Vec user_current_list_following(page, limit) +List the users that the authenticated user is following + +### Parameters + + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**page** | Option<**i32**> | page number of results to return (1-based) | | +**limit** | Option<**i32**> | page size of results | | + +### Return type + +[**Vec**](User.md) + +### Authorization + +[AccessToken](../README.md#AccessToken), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [BasicAuth](../README.md#BasicAuth), [SudoHeader](../README.md#SudoHeader), [SudoParam](../README.md#SudoParam), [TOTPHeader](../README.md#TOTPHeader), [Token](../README.md#Token) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +## user_current_list_gpg_keys + +> Vec user_current_list_gpg_keys(page, limit) +List the authenticated user's GPG keys + +### Parameters + + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**page** | Option<**i32**> | page number of results to return (1-based) | | +**limit** | Option<**i32**> | page size of results | | + +### Return type + +[**Vec**](GPGKey.md) + +### Authorization + +[AccessToken](../README.md#AccessToken), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [BasicAuth](../README.md#BasicAuth), [SudoHeader](../README.md#SudoHeader), [SudoParam](../README.md#SudoParam), [TOTPHeader](../README.md#TOTPHeader), [Token](../README.md#Token) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +## user_current_list_keys + +> Vec user_current_list_keys(fingerprint, page, limit) +List the authenticated user's public keys + +### Parameters + + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**fingerprint** | Option<**String**> | fingerprint of the key | | +**page** | Option<**i32**> | page number of results to return (1-based) | | +**limit** | Option<**i32**> | page size of results | | + +### Return type + +[**Vec**](PublicKey.md) + +### Authorization + +[AccessToken](../README.md#AccessToken), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [BasicAuth](../README.md#BasicAuth), [SudoHeader](../README.md#SudoHeader), [SudoParam](../README.md#SudoParam), [TOTPHeader](../README.md#TOTPHeader), [Token](../README.md#Token) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +## user_current_list_repos + +> Vec user_current_list_repos(page, limit) +List the repos that the authenticated user owns + +### Parameters + + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**page** | Option<**i32**> | page number of results to return (1-based) | | +**limit** | Option<**i32**> | page size of results | | + +### Return type + +[**Vec**](Repository.md) + +### Authorization + +[AccessToken](../README.md#AccessToken), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [BasicAuth](../README.md#BasicAuth), [SudoHeader](../README.md#SudoHeader), [SudoParam](../README.md#SudoParam), [TOTPHeader](../README.md#TOTPHeader), [Token](../README.md#Token) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +## user_current_list_starred + +> Vec user_current_list_starred(page, limit) +The repos that the authenticated user has starred + +### Parameters + + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**page** | Option<**i32**> | page number of results to return (1-based) | | +**limit** | Option<**i32**> | page size of results | | + +### Return type + +[**Vec**](Repository.md) + +### Authorization + +[AccessToken](../README.md#AccessToken), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [BasicAuth](../README.md#BasicAuth), [SudoHeader](../README.md#SudoHeader), [SudoParam](../README.md#SudoParam), [TOTPHeader](../README.md#TOTPHeader), [Token](../README.md#Token) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +## user_current_list_subscriptions + +> Vec user_current_list_subscriptions(page, limit) +List repositories watched by the authenticated user + +### Parameters + + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**page** | Option<**i32**> | page number of results to return (1-based) | | +**limit** | Option<**i32**> | page size of results | | + +### Return type + +[**Vec**](Repository.md) + +### Authorization + +[AccessToken](../README.md#AccessToken), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [BasicAuth](../README.md#BasicAuth), [SudoHeader](../README.md#SudoHeader), [SudoParam](../README.md#SudoParam), [TOTPHeader](../README.md#TOTPHeader), [Token](../README.md#Token) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +## user_current_post_gpg_key + +> crate::models::GpgKey user_current_post_gpg_key(form) +Create a GPG key + +### Parameters + + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**form** | Option<[**CreateGpgKeyOption**](CreateGpgKeyOption.md)> | | | + +### Return type + +[**crate::models::GpgKey**](GPGKey.md) + +### Authorization + +[AccessToken](../README.md#AccessToken), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [BasicAuth](../README.md#BasicAuth), [SudoHeader](../README.md#SudoHeader), [SudoParam](../README.md#SudoParam), [TOTPHeader](../README.md#TOTPHeader), [Token](../README.md#Token) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +## user_current_post_key + +> crate::models::PublicKey user_current_post_key(body) +Create a public key + +### Parameters + + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**body** | Option<[**CreateKeyOption**](CreateKeyOption.md)> | | | + +### Return type + +[**crate::models::PublicKey**](PublicKey.md) + +### Authorization + +[AccessToken](../README.md#AccessToken), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [BasicAuth](../README.md#BasicAuth), [SudoHeader](../README.md#SudoHeader), [SudoParam](../README.md#SudoParam), [TOTPHeader](../README.md#TOTPHeader), [Token](../README.md#Token) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +## user_current_put_follow + +> user_current_put_follow(username) +Follow a user + +### Parameters + + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**username** | **String** | username of user to follow | [required] | + +### Return type + + (empty response body) + +### Authorization + +[AccessToken](../README.md#AccessToken), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [BasicAuth](../README.md#BasicAuth), [SudoHeader](../README.md#SudoHeader), [SudoParam](../README.md#SudoParam), [TOTPHeader](../README.md#TOTPHeader), [Token](../README.md#Token) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: Not defined + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +## user_current_put_star + +> user_current_put_star(owner, repo) +Star the given repo + +### Parameters + + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**owner** | **String** | owner of the repo to star | [required] | +**repo** | **String** | name of the repo to star | [required] | + +### Return type + + (empty response body) + +### Authorization + +[AccessToken](../README.md#AccessToken), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [BasicAuth](../README.md#BasicAuth), [SudoHeader](../README.md#SudoHeader), [SudoParam](../README.md#SudoParam), [TOTPHeader](../README.md#TOTPHeader), [Token](../README.md#Token) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: Not defined + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +## user_current_tracked_times + +> Vec user_current_tracked_times(page, limit, since, before) +List the current user's tracked times + +### Parameters + + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**page** | Option<**i32**> | page number of results to return (1-based) | | +**limit** | Option<**i32**> | page size of results | | +**since** | Option<**String**> | Only show times updated after the given time. This is a timestamp in RFC 3339 format | | +**before** | Option<**String**> | Only show times updated before the given time. This is a timestamp in RFC 3339 format | | + +### Return type + +[**Vec**](TrackedTime.md) + +### Authorization + +[AccessToken](../README.md#AccessToken), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [BasicAuth](../README.md#BasicAuth), [SudoHeader](../README.md#SudoHeader), [SudoParam](../README.md#SudoParam), [TOTPHeader](../README.md#TOTPHeader), [Token](../README.md#Token) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +## user_delete_access_token + +> user_delete_access_token(username, token) +delete an access token + +### Parameters + + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**username** | **String** | username of user | [required] | +**token** | **String** | token to be deleted, identified by ID and if not available by name | [required] | + +### Return type + + (empty response body) + +### Authorization + +[AccessToken](../README.md#AccessToken), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [BasicAuth](../README.md#BasicAuth), [SudoHeader](../README.md#SudoHeader), [SudoParam](../README.md#SudoParam), [TOTPHeader](../README.md#TOTPHeader), [Token](../README.md#Token) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: Not defined + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +## user_delete_email + +> user_delete_email(body) +Delete email addresses + +### Parameters + + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**body** | Option<[**DeleteEmailOption**](DeleteEmailOption.md)> | | | + +### Return type + + (empty response body) + +### Authorization + +[AccessToken](../README.md#AccessToken), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [BasicAuth](../README.md#BasicAuth), [SudoHeader](../README.md#SudoHeader), [SudoParam](../README.md#SudoParam), [TOTPHeader](../README.md#TOTPHeader), [Token](../README.md#Token) + +### HTTP request headers + +- **Content-Type**: application/json, text/plain +- **Accept**: Not defined + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +## user_delete_o_auth2_application + +> user_delete_o_auth2_application(id) +delete an OAuth2 Application + +### Parameters + + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**id** | **i64** | token to be deleted | [required] | + +### Return type + + (empty response body) + +### Authorization + +[AccessToken](../README.md#AccessToken), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [BasicAuth](../README.md#BasicAuth), [SudoHeader](../README.md#SudoHeader), [SudoParam](../README.md#SudoParam), [TOTPHeader](../README.md#TOTPHeader), [Token](../README.md#Token) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: Not defined + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +## user_get + +> crate::models::User user_get(username) +Get a user + +### Parameters + + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**username** | **String** | username of user to get | [required] | + +### Return type + +[**crate::models::User**](User.md) + +### Authorization + +[AccessToken](../README.md#AccessToken), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [BasicAuth](../README.md#BasicAuth), [SudoHeader](../README.md#SudoHeader), [SudoParam](../README.md#SudoParam), [TOTPHeader](../README.md#TOTPHeader), [Token](../README.md#Token) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +## user_get_current + +> crate::models::User user_get_current() +Get the authenticated user + +### Parameters + +This endpoint does not need any parameter. + +### Return type + +[**crate::models::User**](User.md) + +### Authorization + +[AccessToken](../README.md#AccessToken), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [BasicAuth](../README.md#BasicAuth), [SudoHeader](../README.md#SudoHeader), [SudoParam](../README.md#SudoParam), [TOTPHeader](../README.md#TOTPHeader), [Token](../README.md#Token) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +## user_get_heatmap_data + +> Vec user_get_heatmap_data(username) +Get a user's heatmap + +### Parameters + + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**username** | **String** | username of user to get | [required] | + +### Return type + +[**Vec**](UserHeatmapData.md) + +### Authorization + +[AccessToken](../README.md#AccessToken), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [BasicAuth](../README.md#BasicAuth), [SudoHeader](../README.md#SudoHeader), [SudoParam](../README.md#SudoParam), [TOTPHeader](../README.md#TOTPHeader), [Token](../README.md#Token) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +## user_get_o_auth2_application + +> crate::models::OAuth2Application user_get_o_auth2_application(id) +get an OAuth2 Application + +### Parameters + + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**id** | **i64** | Application ID to be found | [required] | + +### Return type + +[**crate::models::OAuth2Application**](OAuth2Application.md) + +### Authorization + +[AccessToken](../README.md#AccessToken), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [BasicAuth](../README.md#BasicAuth), [SudoHeader](../README.md#SudoHeader), [SudoParam](../README.md#SudoParam), [TOTPHeader](../README.md#TOTPHeader), [Token](../README.md#Token) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +## user_get_oauth2_application + +> Vec user_get_oauth2_application(page, limit) +List the authenticated user's oauth2 applications + +### Parameters + + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**page** | Option<**i32**> | page number of results to return (1-based) | | +**limit** | Option<**i32**> | page size of results | | + +### Return type + +[**Vec**](OAuth2Application.md) + +### Authorization + +[AccessToken](../README.md#AccessToken), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [BasicAuth](../README.md#BasicAuth), [SudoHeader](../README.md#SudoHeader), [SudoParam](../README.md#SudoParam), [TOTPHeader](../README.md#TOTPHeader), [Token](../README.md#Token) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +## user_get_stop_watches + +> Vec user_get_stop_watches(page, limit) +Get list of all existing stopwatches + +### Parameters + + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**page** | Option<**i32**> | page number of results to return (1-based) | | +**limit** | Option<**i32**> | page size of results | | + +### Return type + +[**Vec**](StopWatch.md) + +### Authorization + +[AccessToken](../README.md#AccessToken), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [BasicAuth](../README.md#BasicAuth), [SudoHeader](../README.md#SudoHeader), [SudoParam](../README.md#SudoParam), [TOTPHeader](../README.md#TOTPHeader), [Token](../README.md#Token) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +## user_get_tokens + +> Vec user_get_tokens(username, page, limit) +List the authenticated user's access tokens + +### Parameters + + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**username** | **String** | username of user | [required] | +**page** | Option<**i32**> | page number of results to return (1-based) | | +**limit** | Option<**i32**> | page size of results | | + +### Return type + +[**Vec**](AccessToken.md) + +### Authorization + +[AccessToken](../README.md#AccessToken), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [BasicAuth](../README.md#BasicAuth), [SudoHeader](../README.md#SudoHeader), [SudoParam](../README.md#SudoParam), [TOTPHeader](../README.md#TOTPHeader), [Token](../README.md#Token) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +## user_list_emails + +> Vec user_list_emails() +List the authenticated user's email addresses + +### Parameters + +This endpoint does not need any parameter. + +### Return type + +[**Vec**](Email.md) + +### Authorization + +[AccessToken](../README.md#AccessToken), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [BasicAuth](../README.md#BasicAuth), [SudoHeader](../README.md#SudoHeader), [SudoParam](../README.md#SudoParam), [TOTPHeader](../README.md#TOTPHeader), [Token](../README.md#Token) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +## user_list_followers + +> Vec user_list_followers(username, page, limit) +List the given user's followers + +### Parameters + + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**username** | **String** | username of user | [required] | +**page** | Option<**i32**> | page number of results to return (1-based) | | +**limit** | Option<**i32**> | page size of results | | + +### Return type + +[**Vec**](User.md) + +### Authorization + +[AccessToken](../README.md#AccessToken), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [BasicAuth](../README.md#BasicAuth), [SudoHeader](../README.md#SudoHeader), [SudoParam](../README.md#SudoParam), [TOTPHeader](../README.md#TOTPHeader), [Token](../README.md#Token) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +## user_list_following + +> Vec user_list_following(username, page, limit) +List the users that the given user is following + +### Parameters + + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**username** | **String** | username of user | [required] | +**page** | Option<**i32**> | page number of results to return (1-based) | | +**limit** | Option<**i32**> | page size of results | | + +### Return type + +[**Vec**](User.md) + +### Authorization + +[AccessToken](../README.md#AccessToken), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [BasicAuth](../README.md#BasicAuth), [SudoHeader](../README.md#SudoHeader), [SudoParam](../README.md#SudoParam), [TOTPHeader](../README.md#TOTPHeader), [Token](../README.md#Token) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +## user_list_gpg_keys + +> Vec user_list_gpg_keys(username, page, limit) +List the given user's GPG keys + +### Parameters + + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**username** | **String** | username of user | [required] | +**page** | Option<**i32**> | page number of results to return (1-based) | | +**limit** | Option<**i32**> | page size of results | | + +### Return type + +[**Vec**](GPGKey.md) + +### Authorization + +[AccessToken](../README.md#AccessToken), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [BasicAuth](../README.md#BasicAuth), [SudoHeader](../README.md#SudoHeader), [SudoParam](../README.md#SudoParam), [TOTPHeader](../README.md#TOTPHeader), [Token](../README.md#Token) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +## user_list_keys + +> Vec user_list_keys(username, fingerprint, page, limit) +List the given user's public keys + +### Parameters + + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**username** | **String** | username of user | [required] | +**fingerprint** | Option<**String**> | fingerprint of the key | | +**page** | Option<**i32**> | page number of results to return (1-based) | | +**limit** | Option<**i32**> | page size of results | | + +### Return type + +[**Vec**](PublicKey.md) + +### Authorization + +[AccessToken](../README.md#AccessToken), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [BasicAuth](../README.md#BasicAuth), [SudoHeader](../README.md#SudoHeader), [SudoParam](../README.md#SudoParam), [TOTPHeader](../README.md#TOTPHeader), [Token](../README.md#Token) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +## user_list_repos + +> Vec user_list_repos(username, page, limit) +List the repos owned by the given user + +### Parameters + + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**username** | **String** | username of user | [required] | +**page** | Option<**i32**> | page number of results to return (1-based) | | +**limit** | Option<**i32**> | page size of results | | + +### Return type + +[**Vec**](Repository.md) + +### Authorization + +[AccessToken](../README.md#AccessToken), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [BasicAuth](../README.md#BasicAuth), [SudoHeader](../README.md#SudoHeader), [SudoParam](../README.md#SudoParam), [TOTPHeader](../README.md#TOTPHeader), [Token](../README.md#Token) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +## user_list_starred + +> Vec user_list_starred(username, page, limit) +The repos that the given user has starred + +### Parameters + + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**username** | **String** | username of user | [required] | +**page** | Option<**i32**> | page number of results to return (1-based) | | +**limit** | Option<**i32**> | page size of results | | + +### Return type + +[**Vec**](Repository.md) + +### Authorization + +[AccessToken](../README.md#AccessToken), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [BasicAuth](../README.md#BasicAuth), [SudoHeader](../README.md#SudoHeader), [SudoParam](../README.md#SudoParam), [TOTPHeader](../README.md#TOTPHeader), [Token](../README.md#Token) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +## user_list_subscriptions + +> Vec user_list_subscriptions(username, page, limit) +List the repositories watched by a user + +### Parameters + + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**username** | **String** | username of the user | [required] | +**page** | Option<**i32**> | page number of results to return (1-based) | | +**limit** | Option<**i32**> | page size of results | | + +### Return type + +[**Vec**](Repository.md) + +### Authorization + +[AccessToken](../README.md#AccessToken), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [BasicAuth](../README.md#BasicAuth), [SudoHeader](../README.md#SudoHeader), [SudoParam](../README.md#SudoParam), [TOTPHeader](../README.md#TOTPHeader), [Token](../README.md#Token) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +## user_list_teams + +> Vec user_list_teams(page, limit) +List all the teams a user belongs to + +### Parameters + + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**page** | Option<**i32**> | page number of results to return (1-based) | | +**limit** | Option<**i32**> | page size of results | | + +### Return type + +[**Vec**](Team.md) + +### Authorization + +[AccessToken](../README.md#AccessToken), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [BasicAuth](../README.md#BasicAuth), [SudoHeader](../README.md#SudoHeader), [SudoParam](../README.md#SudoParam), [TOTPHeader](../README.md#TOTPHeader), [Token](../README.md#Token) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +## user_search + +> crate::models::UserSearch200Response user_search(q, uid, page, limit) +Search for users + +### Parameters + + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**q** | Option<**String**> | keyword | | +**uid** | Option<**i64**> | ID of the user to search for | | +**page** | Option<**i32**> | page number of results to return (1-based) | | +**limit** | Option<**i32**> | page size of results | | + +### Return type + +[**crate::models::UserSearch200Response**](userSearch_200_response.md) + +### Authorization + +[AccessToken](../README.md#AccessToken), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [BasicAuth](../README.md#BasicAuth), [SudoHeader](../README.md#SudoHeader), [SudoParam](../README.md#SudoParam), [TOTPHeader](../README.md#TOTPHeader), [Token](../README.md#Token) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +## user_update_o_auth2_application + +> crate::models::OAuth2Application user_update_o_auth2_application(id, body) +update an OAuth2 Application, this includes regenerating the client secret + +### Parameters + + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**id** | **i64** | application to be updated | [required] | +**body** | [**CreateOAuth2ApplicationOptions**](CreateOAuth2ApplicationOptions.md) | | [required] | + +### Return type + +[**crate::models::OAuth2Application**](OAuth2Application.md) + +### Authorization + +[AccessToken](../README.md#AccessToken), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [BasicAuth](../README.md#BasicAuth), [SudoHeader](../README.md#SudoHeader), [SudoParam](../README.md#SudoParam), [TOTPHeader](../README.md#TOTPHeader), [Token](../README.md#Token) + +### HTTP request headers + +- **Content-Type**: application/json, text/plain +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +## user_verify_gpg_key + +> crate::models::GpgKey user_verify_gpg_key() +Verify a GPG key + +### Parameters + +This endpoint does not need any parameter. + +### Return type + +[**crate::models::GpgKey**](GPGKey.md) + +### Authorization + +[AccessToken](../README.md#AccessToken), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [BasicAuth](../README.md#BasicAuth), [SudoHeader](../README.md#SudoHeader), [SudoParam](../README.md#SudoParam), [TOTPHeader](../README.md#TOTPHeader), [Token](../README.md#Token) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + diff --git a/crates/gitea_raw_client/docs/UserHeatmapData.md b/crates/gitea_raw_client/docs/UserHeatmapData.md new file mode 100644 index 0000000..8ad2caa --- /dev/null +++ b/crates/gitea_raw_client/docs/UserHeatmapData.md @@ -0,0 +1,12 @@ +# UserHeatmapData + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**contributions** | Option<**i64**> | | [optional] +**timestamp** | Option<**i64**> | TimeStamp defines a timestamp | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/crates/gitea_raw_client/docs/UserSearch200Response.md b/crates/gitea_raw_client/docs/UserSearch200Response.md new file mode 100644 index 0000000..6b9d372 --- /dev/null +++ b/crates/gitea_raw_client/docs/UserSearch200Response.md @@ -0,0 +1,12 @@ +# UserSearch200Response + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**data** | Option<[**Vec**](User.md)> | | [optional] +**ok** | Option<**bool**> | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/crates/gitea_raw_client/docs/UserSettings.md b/crates/gitea_raw_client/docs/UserSettings.md new file mode 100644 index 0000000..a2b70c4 --- /dev/null +++ b/crates/gitea_raw_client/docs/UserSettings.md @@ -0,0 +1,19 @@ +# UserSettings + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**description** | Option<**String**> | | [optional] +**diff_view_style** | Option<**String**> | | [optional] +**full_name** | Option<**String**> | | [optional] +**hide_activity** | Option<**bool**> | | [optional] +**hide_email** | Option<**bool**> | Privacy | [optional] +**language** | Option<**String**> | | [optional] +**location** | Option<**String**> | | [optional] +**theme** | Option<**String**> | | [optional] +**website** | Option<**String**> | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/crates/gitea_raw_client/docs/UserSettingsOptions.md b/crates/gitea_raw_client/docs/UserSettingsOptions.md new file mode 100644 index 0000000..6497411 --- /dev/null +++ b/crates/gitea_raw_client/docs/UserSettingsOptions.md @@ -0,0 +1,19 @@ +# UserSettingsOptions + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**description** | Option<**String**> | | [optional] +**diff_view_style** | Option<**String**> | | [optional] +**full_name** | Option<**String**> | | [optional] +**hide_activity** | Option<**bool**> | | [optional] +**hide_email** | Option<**bool**> | Privacy | [optional] +**language** | Option<**String**> | | [optional] +**location** | Option<**String**> | | [optional] +**theme** | Option<**String**> | | [optional] +**website** | Option<**String**> | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/crates/gitea_raw_client/docs/WatchInfo.md b/crates/gitea_raw_client/docs/WatchInfo.md new file mode 100644 index 0000000..511197e --- /dev/null +++ b/crates/gitea_raw_client/docs/WatchInfo.md @@ -0,0 +1,16 @@ +# WatchInfo + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**created_at** | Option<**String**> | | [optional] +**ignored** | Option<**bool**> | | [optional] +**reason** | Option<[**serde_json::Value**](.md)> | | [optional] +**repository_url** | Option<**String**> | | [optional] +**subscribed** | Option<**bool**> | | [optional] +**url** | Option<**String**> | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/crates/gitea_raw_client/docs/WikiCommit.md b/crates/gitea_raw_client/docs/WikiCommit.md new file mode 100644 index 0000000..3c59861 --- /dev/null +++ b/crates/gitea_raw_client/docs/WikiCommit.md @@ -0,0 +1,14 @@ +# WikiCommit + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**author** | Option<[**crate::models::CommitUser**](CommitUser.md)> | | [optional] +**commiter** | Option<[**crate::models::CommitUser**](CommitUser.md)> | | [optional] +**message** | Option<**String**> | | [optional] +**sha** | Option<**String**> | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/crates/gitea_raw_client/docs/WikiCommitList.md b/crates/gitea_raw_client/docs/WikiCommitList.md new file mode 100644 index 0000000..5a58f4d --- /dev/null +++ b/crates/gitea_raw_client/docs/WikiCommitList.md @@ -0,0 +1,12 @@ +# WikiCommitList + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**commits** | Option<[**Vec**](WikiCommit.md)> | | [optional] +**count** | Option<**i64**> | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/crates/gitea_raw_client/docs/WikiPage.md b/crates/gitea_raw_client/docs/WikiPage.md new file mode 100644 index 0000000..29a34a1 --- /dev/null +++ b/crates/gitea_raw_client/docs/WikiPage.md @@ -0,0 +1,18 @@ +# WikiPage + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**commit_count** | Option<**i64**> | | [optional] +**content_base64** | Option<**String**> | Page content, base64 encoded | [optional] +**footer** | Option<**String**> | | [optional] +**html_url** | Option<**String**> | | [optional] +**last_commit** | Option<[**crate::models::WikiCommit**](WikiCommit.md)> | | [optional] +**sidebar** | Option<**String**> | | [optional] +**sub_url** | Option<**String**> | | [optional] +**title** | Option<**String**> | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/crates/gitea_raw_client/docs/WikiPageMetaData.md b/crates/gitea_raw_client/docs/WikiPageMetaData.md new file mode 100644 index 0000000..2b73adc --- /dev/null +++ b/crates/gitea_raw_client/docs/WikiPageMetaData.md @@ -0,0 +1,14 @@ +# WikiPageMetaData + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**html_url** | Option<**String**> | | [optional] +**last_commit** | Option<[**crate::models::WikiCommit**](WikiCommit.md)> | | [optional] +**sub_url** | Option<**String**> | | [optional] +**title** | Option<**String**> | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/crates/gitea_raw_client/git_push.sh b/crates/gitea_raw_client/git_push.sh new file mode 100644 index 0000000..f53a75d --- /dev/null +++ b/crates/gitea_raw_client/git_push.sh @@ -0,0 +1,57 @@ +#!/bin/sh +# ref: https://help.github.com/articles/adding-an-existing-project-to-github-using-the-command-line/ +# +# Usage example: /bin/sh ./git_push.sh wing328 openapi-petstore-perl "minor update" "gitlab.com" + +git_user_id=$1 +git_repo_id=$2 +release_note=$3 +git_host=$4 + +if [ "$git_host" = "" ]; then + git_host="github.com" + echo "[INFO] No command line input provided. Set \$git_host to $git_host" +fi + +if [ "$git_user_id" = "" ]; then + git_user_id="GIT_USER_ID" + echo "[INFO] No command line input provided. Set \$git_user_id to $git_user_id" +fi + +if [ "$git_repo_id" = "" ]; then + git_repo_id="GIT_REPO_ID" + echo "[INFO] No command line input provided. Set \$git_repo_id to $git_repo_id" +fi + +if [ "$release_note" = "" ]; then + release_note="Minor update" + echo "[INFO] No command line input provided. Set \$release_note to $release_note" +fi + +# Initialize the local directory as a Git repository +git init + +# Adds the files in the local repository and stages them for commit. +git add . + +# Commits the tracked changes and prepares them to be pushed to a remote repository. +git commit -m "$release_note" + +# Sets the new remote +git_remote=$(git remote) +if [ "$git_remote" = "" ]; then # git remote not defined + + if [ "$GIT_TOKEN" = "" ]; then + echo "[INFO] \$GIT_TOKEN (environment variable) is not set. Using the git credential in your environment." + git remote add origin https://${git_host}/${git_user_id}/${git_repo_id}.git + else + git remote add origin https://${git_user_id}:"${GIT_TOKEN}"@${git_host}/${git_user_id}/${git_repo_id}.git + fi + +fi + +git pull origin master + +# Pushes (Forces) the changes in the local repository up to the remote repository +echo "Git pushing to https://${git_host}/${git_user_id}/${git_repo_id}.git" +git push origin master 2>&1 | grep -v 'To https' diff --git a/crates/gitea_raw_client/scripts/generate_client.Dockerfile b/crates/gitea_raw_client/scripts/generate_client.Dockerfile index fae7cf7..a594199 100644 --- a/crates/gitea_raw_client/scripts/generate_client.Dockerfile +++ b/crates/gitea_raw_client/scripts/generate_client.Dockerfile @@ -1,5 +1,3 @@ FROM openapitools/openapi-generator-cli WORKDIR /src/app - -COPY scripts/generate_client.entrypoint.sh . diff --git a/crates/gitea_raw_client/scripts/generate_client.docker-compose.yml b/crates/gitea_raw_client/scripts/generate_client.docker-compose.yml index f3f9684..2430b24 100644 --- a/crates/gitea_raw_client/scripts/generate_client.docker-compose.yml +++ b/crates/gitea_raw_client/scripts/generate_client.docker-compose.yml @@ -17,7 +17,7 @@ services: build: dockerfile: scripts/generate_client.Dockerfile context: ../ - command: "generate -i http://gitea:3000/swagger.v1.json -g rust -o /mnt/generated/" + command: "generate -i http://gitea:3000/swagger.v1.json -g rust -o /mnt/generated/ -p packageName=gitea_raw_client" volumes: - "../:/mnt/generated/" depends_on: diff --git a/crates/gitea_raw_client/scripts/generate_client.dockerignore b/crates/gitea_raw_client/scripts/generate_client.dockerignore deleted file mode 100644 index 2e4fb41..0000000 --- a/crates/gitea_raw_client/scripts/generate_client.dockerignore +++ /dev/null @@ -1,2 +0,0 @@ -target/ -git/ diff --git a/crates/gitea_raw_client/scripts/generate_client.entrypoint.sh b/crates/gitea_raw_client/scripts/generate_client.entrypoint.sh deleted file mode 100755 index cecf648..0000000 --- a/crates/gitea_raw_client/scripts/generate_client.entrypoint.sh +++ /dev/null @@ -1,15 +0,0 @@ -#!/bin/bash - -set -e - -echo "waiting for gitea..." -curl --silent --head --retry 5 --retry-connrefused --retry-delay 0 --max-time 10 --retry-max-time 40 "http://gitea:3000/" > /dev/null - -echo "fetching swagger spec" - -curl -L http://gitea:3000/swagger.v1.json > gitea.swagger.json - -echo "fetched gitea.swagger.json" - -exit 0 - diff --git a/crates/gitea_raw_client/src/apis/admin_api.rs b/crates/gitea_raw_client/src/apis/admin_api.rs new file mode 100644 index 0000000..1a7038b --- /dev/null +++ b/crates/gitea_raw_client/src/apis/admin_api.rs @@ -0,0 +1,1265 @@ +/* + * Gitea API. + * + * This documentation describes the Gitea API. + * + * The version of the OpenAPI document: 1.17.3 + * + * Generated by: https://openapi-generator.tech + */ + + +use reqwest; + +use crate::apis::ResponseContent; +use super::{Error, configuration}; + + +/// struct for typed errors of method [`admin_adopt_repository`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum AdminAdoptRepositoryError { + Status403(), + Status404(), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`admin_create_org`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum AdminCreateOrgError { + Status403(), + Status422(), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`admin_create_public_key`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum AdminCreatePublicKeyError { + Status403(), + Status422(), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`admin_create_repo`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum AdminCreateRepoError { + Status403(), + Status404(), + Status409(), + Status422(), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`admin_create_user`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum AdminCreateUserError { + Status400(), + Status403(), + Status422(), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`admin_cron_list`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum AdminCronListError { + Status403(), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`admin_cron_run`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum AdminCronRunError { + Status404(), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`admin_delete_unadopted_repository`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum AdminDeleteUnadoptedRepositoryError { + Status403(), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`admin_delete_user`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum AdminDeleteUserError { + Status403(), + Status422(), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`admin_delete_user_public_key`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum AdminDeleteUserPublicKeyError { + Status403(), + Status404(), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`admin_edit_user`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum AdminEditUserError { + Status403(), + Status422(), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`admin_get_all_orgs`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum AdminGetAllOrgsError { + Status403(), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`admin_get_all_users`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum AdminGetAllUsersError { + Status403(), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`admin_unadopted_list`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum AdminUnadoptedListError { + Status403(), + UnknownValue(serde_json::Value), +} + + +pub async fn admin_adopt_repository(configuration: &configuration::Configuration, owner: &str, repo: &str) -> Result<(), Error> { + let local_var_configuration = configuration; + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!("{}/admin/unadopted/{owner}/{repo}", local_var_configuration.base_path, owner=crate::apis::urlencode(owner), repo=crate::apis::urlencode(repo)); + let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str()); + + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.query(&[("access_token", local_var_value)]); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.query(&[("sudo", local_var_value)]); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.query(&[("token", local_var_value)]); + } + if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { + local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("Authorization", local_var_value); + }; + if let Some(ref local_var_auth_conf) = local_var_configuration.basic_auth { + local_var_req_builder = local_var_req_builder.basic_auth(local_var_auth_conf.0.to_owned(), local_var_auth_conf.1.to_owned()); + }; + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("Sudo", local_var_value); + }; + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("X-GITEA-OTP", local_var_value); + }; + + let local_var_req = local_var_req_builder.build()?; + let local_var_resp = local_var_client.execute(local_var_req).await?; + + let local_var_status = local_var_resp.status(); + let local_var_content = local_var_resp.text().await?; + + if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + Ok(()) + } else { + let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); + let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; + Err(Error::ResponseError(local_var_error)) + } +} + +pub async fn admin_create_org(configuration: &configuration::Configuration, username: &str, organization: crate::models::CreateOrgOption) -> Result> { + let local_var_configuration = configuration; + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!("{}/admin/users/{username}/orgs", local_var_configuration.base_path, username=crate::apis::urlencode(username)); + let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str()); + + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.query(&[("access_token", local_var_value)]); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.query(&[("sudo", local_var_value)]); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.query(&[("token", local_var_value)]); + } + if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { + local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("Authorization", local_var_value); + }; + if let Some(ref local_var_auth_conf) = local_var_configuration.basic_auth { + local_var_req_builder = local_var_req_builder.basic_auth(local_var_auth_conf.0.to_owned(), local_var_auth_conf.1.to_owned()); + }; + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("Sudo", local_var_value); + }; + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("X-GITEA-OTP", local_var_value); + }; + local_var_req_builder = local_var_req_builder.json(&organization); + + let local_var_req = local_var_req_builder.build()?; + let local_var_resp = local_var_client.execute(local_var_req).await?; + + let local_var_status = local_var_resp.status(); + let local_var_content = local_var_resp.text().await?; + + if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + serde_json::from_str(&local_var_content).map_err(Error::from) + } else { + let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); + let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; + Err(Error::ResponseError(local_var_error)) + } +} + +pub async fn admin_create_public_key(configuration: &configuration::Configuration, username: &str, key: Option) -> Result> { + let local_var_configuration = configuration; + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!("{}/admin/users/{username}/keys", local_var_configuration.base_path, username=crate::apis::urlencode(username)); + let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str()); + + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.query(&[("access_token", local_var_value)]); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.query(&[("sudo", local_var_value)]); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.query(&[("token", local_var_value)]); + } + if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { + local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("Authorization", local_var_value); + }; + if let Some(ref local_var_auth_conf) = local_var_configuration.basic_auth { + local_var_req_builder = local_var_req_builder.basic_auth(local_var_auth_conf.0.to_owned(), local_var_auth_conf.1.to_owned()); + }; + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("Sudo", local_var_value); + }; + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("X-GITEA-OTP", local_var_value); + }; + local_var_req_builder = local_var_req_builder.json(&key); + + let local_var_req = local_var_req_builder.build()?; + let local_var_resp = local_var_client.execute(local_var_req).await?; + + let local_var_status = local_var_resp.status(); + let local_var_content = local_var_resp.text().await?; + + if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + serde_json::from_str(&local_var_content).map_err(Error::from) + } else { + let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); + let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; + Err(Error::ResponseError(local_var_error)) + } +} + +pub async fn admin_create_repo(configuration: &configuration::Configuration, username: &str, repository: crate::models::CreateRepoOption) -> Result> { + let local_var_configuration = configuration; + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!("{}/admin/users/{username}/repos", local_var_configuration.base_path, username=crate::apis::urlencode(username)); + let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str()); + + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.query(&[("access_token", local_var_value)]); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.query(&[("sudo", local_var_value)]); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.query(&[("token", local_var_value)]); + } + if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { + local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("Authorization", local_var_value); + }; + if let Some(ref local_var_auth_conf) = local_var_configuration.basic_auth { + local_var_req_builder = local_var_req_builder.basic_auth(local_var_auth_conf.0.to_owned(), local_var_auth_conf.1.to_owned()); + }; + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("Sudo", local_var_value); + }; + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("X-GITEA-OTP", local_var_value); + }; + local_var_req_builder = local_var_req_builder.json(&repository); + + let local_var_req = local_var_req_builder.build()?; + let local_var_resp = local_var_client.execute(local_var_req).await?; + + let local_var_status = local_var_resp.status(); + let local_var_content = local_var_resp.text().await?; + + if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + serde_json::from_str(&local_var_content).map_err(Error::from) + } else { + let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); + let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; + Err(Error::ResponseError(local_var_error)) + } +} + +pub async fn admin_create_user(configuration: &configuration::Configuration, body: Option) -> Result> { + let local_var_configuration = configuration; + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!("{}/admin/users", local_var_configuration.base_path); + let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str()); + + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.query(&[("access_token", local_var_value)]); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.query(&[("sudo", local_var_value)]); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.query(&[("token", local_var_value)]); + } + if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { + local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("Authorization", local_var_value); + }; + if let Some(ref local_var_auth_conf) = local_var_configuration.basic_auth { + local_var_req_builder = local_var_req_builder.basic_auth(local_var_auth_conf.0.to_owned(), local_var_auth_conf.1.to_owned()); + }; + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("Sudo", local_var_value); + }; + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("X-GITEA-OTP", local_var_value); + }; + local_var_req_builder = local_var_req_builder.json(&body); + + let local_var_req = local_var_req_builder.build()?; + let local_var_resp = local_var_client.execute(local_var_req).await?; + + let local_var_status = local_var_resp.status(); + let local_var_content = local_var_resp.text().await?; + + if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + serde_json::from_str(&local_var_content).map_err(Error::from) + } else { + let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); + let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; + Err(Error::ResponseError(local_var_error)) + } +} + +pub async fn admin_cron_list(configuration: &configuration::Configuration, page: Option, limit: Option) -> Result, Error> { + let local_var_configuration = configuration; + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!("{}/admin/cron", local_var_configuration.base_path); + let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str()); + + if let Some(ref local_var_str) = page { + local_var_req_builder = local_var_req_builder.query(&[("page", &local_var_str.to_string())]); + } + if let Some(ref local_var_str) = limit { + local_var_req_builder = local_var_req_builder.query(&[("limit", &local_var_str.to_string())]); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.query(&[("access_token", local_var_value)]); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.query(&[("sudo", local_var_value)]); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.query(&[("token", local_var_value)]); + } + if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { + local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("Authorization", local_var_value); + }; + if let Some(ref local_var_auth_conf) = local_var_configuration.basic_auth { + local_var_req_builder = local_var_req_builder.basic_auth(local_var_auth_conf.0.to_owned(), local_var_auth_conf.1.to_owned()); + }; + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("Sudo", local_var_value); + }; + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("X-GITEA-OTP", local_var_value); + }; + + let local_var_req = local_var_req_builder.build()?; + let local_var_resp = local_var_client.execute(local_var_req).await?; + + let local_var_status = local_var_resp.status(); + let local_var_content = local_var_resp.text().await?; + + if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + serde_json::from_str(&local_var_content).map_err(Error::from) + } else { + let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); + let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; + Err(Error::ResponseError(local_var_error)) + } +} + +pub async fn admin_cron_run(configuration: &configuration::Configuration, task: &str) -> Result<(), Error> { + let local_var_configuration = configuration; + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!("{}/admin/cron/{task}", local_var_configuration.base_path, task=crate::apis::urlencode(task)); + let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str()); + + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.query(&[("access_token", local_var_value)]); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.query(&[("sudo", local_var_value)]); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.query(&[("token", local_var_value)]); + } + if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { + local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("Authorization", local_var_value); + }; + if let Some(ref local_var_auth_conf) = local_var_configuration.basic_auth { + local_var_req_builder = local_var_req_builder.basic_auth(local_var_auth_conf.0.to_owned(), local_var_auth_conf.1.to_owned()); + }; + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("Sudo", local_var_value); + }; + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("X-GITEA-OTP", local_var_value); + }; + + let local_var_req = local_var_req_builder.build()?; + let local_var_resp = local_var_client.execute(local_var_req).await?; + + let local_var_status = local_var_resp.status(); + let local_var_content = local_var_resp.text().await?; + + if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + Ok(()) + } else { + let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); + let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; + Err(Error::ResponseError(local_var_error)) + } +} + +pub async fn admin_delete_unadopted_repository(configuration: &configuration::Configuration, owner: &str, repo: &str) -> Result<(), Error> { + let local_var_configuration = configuration; + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!("{}/admin/unadopted/{owner}/{repo}", local_var_configuration.base_path, owner=crate::apis::urlencode(owner), repo=crate::apis::urlencode(repo)); + let mut local_var_req_builder = local_var_client.request(reqwest::Method::DELETE, local_var_uri_str.as_str()); + + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.query(&[("access_token", local_var_value)]); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.query(&[("sudo", local_var_value)]); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.query(&[("token", local_var_value)]); + } + if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { + local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("Authorization", local_var_value); + }; + if let Some(ref local_var_auth_conf) = local_var_configuration.basic_auth { + local_var_req_builder = local_var_req_builder.basic_auth(local_var_auth_conf.0.to_owned(), local_var_auth_conf.1.to_owned()); + }; + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("Sudo", local_var_value); + }; + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("X-GITEA-OTP", local_var_value); + }; + + let local_var_req = local_var_req_builder.build()?; + let local_var_resp = local_var_client.execute(local_var_req).await?; + + let local_var_status = local_var_resp.status(); + let local_var_content = local_var_resp.text().await?; + + if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + Ok(()) + } else { + let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); + let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; + Err(Error::ResponseError(local_var_error)) + } +} + +pub async fn admin_delete_user(configuration: &configuration::Configuration, username: &str) -> Result<(), Error> { + let local_var_configuration = configuration; + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!("{}/admin/users/{username}", local_var_configuration.base_path, username=crate::apis::urlencode(username)); + let mut local_var_req_builder = local_var_client.request(reqwest::Method::DELETE, local_var_uri_str.as_str()); + + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.query(&[("access_token", local_var_value)]); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.query(&[("sudo", local_var_value)]); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.query(&[("token", local_var_value)]); + } + if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { + local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("Authorization", local_var_value); + }; + if let Some(ref local_var_auth_conf) = local_var_configuration.basic_auth { + local_var_req_builder = local_var_req_builder.basic_auth(local_var_auth_conf.0.to_owned(), local_var_auth_conf.1.to_owned()); + }; + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("Sudo", local_var_value); + }; + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("X-GITEA-OTP", local_var_value); + }; + + let local_var_req = local_var_req_builder.build()?; + let local_var_resp = local_var_client.execute(local_var_req).await?; + + let local_var_status = local_var_resp.status(); + let local_var_content = local_var_resp.text().await?; + + if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + Ok(()) + } else { + let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); + let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; + Err(Error::ResponseError(local_var_error)) + } +} + +pub async fn admin_delete_user_public_key(configuration: &configuration::Configuration, username: &str, id: i64) -> Result<(), Error> { + let local_var_configuration = configuration; + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!("{}/admin/users/{username}/keys/{id}", local_var_configuration.base_path, username=crate::apis::urlencode(username), id=id); + let mut local_var_req_builder = local_var_client.request(reqwest::Method::DELETE, local_var_uri_str.as_str()); + + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.query(&[("access_token", local_var_value)]); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.query(&[("sudo", local_var_value)]); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.query(&[("token", local_var_value)]); + } + if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { + local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("Authorization", local_var_value); + }; + if let Some(ref local_var_auth_conf) = local_var_configuration.basic_auth { + local_var_req_builder = local_var_req_builder.basic_auth(local_var_auth_conf.0.to_owned(), local_var_auth_conf.1.to_owned()); + }; + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("Sudo", local_var_value); + }; + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("X-GITEA-OTP", local_var_value); + }; + + let local_var_req = local_var_req_builder.build()?; + let local_var_resp = local_var_client.execute(local_var_req).await?; + + let local_var_status = local_var_resp.status(); + let local_var_content = local_var_resp.text().await?; + + if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + Ok(()) + } else { + let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); + let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; + Err(Error::ResponseError(local_var_error)) + } +} + +pub async fn admin_edit_user(configuration: &configuration::Configuration, username: &str, body: Option) -> Result> { + let local_var_configuration = configuration; + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!("{}/admin/users/{username}", local_var_configuration.base_path, username=crate::apis::urlencode(username)); + let mut local_var_req_builder = local_var_client.request(reqwest::Method::PATCH, local_var_uri_str.as_str()); + + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.query(&[("access_token", local_var_value)]); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.query(&[("sudo", local_var_value)]); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.query(&[("token", local_var_value)]); + } + if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { + local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("Authorization", local_var_value); + }; + if let Some(ref local_var_auth_conf) = local_var_configuration.basic_auth { + local_var_req_builder = local_var_req_builder.basic_auth(local_var_auth_conf.0.to_owned(), local_var_auth_conf.1.to_owned()); + }; + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("Sudo", local_var_value); + }; + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("X-GITEA-OTP", local_var_value); + }; + local_var_req_builder = local_var_req_builder.json(&body); + + let local_var_req = local_var_req_builder.build()?; + let local_var_resp = local_var_client.execute(local_var_req).await?; + + let local_var_status = local_var_resp.status(); + let local_var_content = local_var_resp.text().await?; + + if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + serde_json::from_str(&local_var_content).map_err(Error::from) + } else { + let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); + let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; + Err(Error::ResponseError(local_var_error)) + } +} + +pub async fn admin_get_all_orgs(configuration: &configuration::Configuration, page: Option, limit: Option) -> Result, Error> { + let local_var_configuration = configuration; + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!("{}/admin/orgs", local_var_configuration.base_path); + let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str()); + + if let Some(ref local_var_str) = page { + local_var_req_builder = local_var_req_builder.query(&[("page", &local_var_str.to_string())]); + } + if let Some(ref local_var_str) = limit { + local_var_req_builder = local_var_req_builder.query(&[("limit", &local_var_str.to_string())]); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.query(&[("access_token", local_var_value)]); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.query(&[("sudo", local_var_value)]); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.query(&[("token", local_var_value)]); + } + if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { + local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("Authorization", local_var_value); + }; + if let Some(ref local_var_auth_conf) = local_var_configuration.basic_auth { + local_var_req_builder = local_var_req_builder.basic_auth(local_var_auth_conf.0.to_owned(), local_var_auth_conf.1.to_owned()); + }; + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("Sudo", local_var_value); + }; + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("X-GITEA-OTP", local_var_value); + }; + + let local_var_req = local_var_req_builder.build()?; + let local_var_resp = local_var_client.execute(local_var_req).await?; + + let local_var_status = local_var_resp.status(); + let local_var_content = local_var_resp.text().await?; + + if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + serde_json::from_str(&local_var_content).map_err(Error::from) + } else { + let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); + let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; + Err(Error::ResponseError(local_var_error)) + } +} + +pub async fn admin_get_all_users(configuration: &configuration::Configuration, page: Option, limit: Option) -> Result, Error> { + let local_var_configuration = configuration; + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!("{}/admin/users", local_var_configuration.base_path); + let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str()); + + if let Some(ref local_var_str) = page { + local_var_req_builder = local_var_req_builder.query(&[("page", &local_var_str.to_string())]); + } + if let Some(ref local_var_str) = limit { + local_var_req_builder = local_var_req_builder.query(&[("limit", &local_var_str.to_string())]); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.query(&[("access_token", local_var_value)]); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.query(&[("sudo", local_var_value)]); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.query(&[("token", local_var_value)]); + } + if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { + local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("Authorization", local_var_value); + }; + if let Some(ref local_var_auth_conf) = local_var_configuration.basic_auth { + local_var_req_builder = local_var_req_builder.basic_auth(local_var_auth_conf.0.to_owned(), local_var_auth_conf.1.to_owned()); + }; + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("Sudo", local_var_value); + }; + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("X-GITEA-OTP", local_var_value); + }; + + let local_var_req = local_var_req_builder.build()?; + let local_var_resp = local_var_client.execute(local_var_req).await?; + + let local_var_status = local_var_resp.status(); + let local_var_content = local_var_resp.text().await?; + + if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + serde_json::from_str(&local_var_content).map_err(Error::from) + } else { + let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); + let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; + Err(Error::ResponseError(local_var_error)) + } +} + +pub async fn admin_unadopted_list(configuration: &configuration::Configuration, page: Option, limit: Option, pattern: Option<&str>) -> Result, Error> { + let local_var_configuration = configuration; + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!("{}/admin/unadopted", local_var_configuration.base_path); + let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str()); + + if let Some(ref local_var_str) = page { + local_var_req_builder = local_var_req_builder.query(&[("page", &local_var_str.to_string())]); + } + if let Some(ref local_var_str) = limit { + local_var_req_builder = local_var_req_builder.query(&[("limit", &local_var_str.to_string())]); + } + if let Some(ref local_var_str) = pattern { + local_var_req_builder = local_var_req_builder.query(&[("pattern", &local_var_str.to_string())]); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.query(&[("access_token", local_var_value)]); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.query(&[("sudo", local_var_value)]); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.query(&[("token", local_var_value)]); + } + if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { + local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("Authorization", local_var_value); + }; + if let Some(ref local_var_auth_conf) = local_var_configuration.basic_auth { + local_var_req_builder = local_var_req_builder.basic_auth(local_var_auth_conf.0.to_owned(), local_var_auth_conf.1.to_owned()); + }; + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("Sudo", local_var_value); + }; + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("X-GITEA-OTP", local_var_value); + }; + + let local_var_req = local_var_req_builder.build()?; + let local_var_resp = local_var_client.execute(local_var_req).await?; + + let local_var_status = local_var_resp.status(); + let local_var_content = local_var_resp.text().await?; + + if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + serde_json::from_str(&local_var_content).map_err(Error::from) + } else { + let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); + let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; + Err(Error::ResponseError(local_var_error)) + } +} + diff --git a/crates/gitea_raw_client/src/apis/configuration.rs b/crates/gitea_raw_client/src/apis/configuration.rs new file mode 100644 index 0000000..2465aa9 --- /dev/null +++ b/crates/gitea_raw_client/src/apis/configuration.rs @@ -0,0 +1,53 @@ +/* + * Gitea API. + * + * This documentation describes the Gitea API. + * + * The version of the OpenAPI document: 1.17.3 + * + * Generated by: https://openapi-generator.tech + */ + + + +#[derive(Debug, Clone)] +pub struct Configuration { + pub base_path: String, + pub user_agent: Option, + pub client: reqwest::Client, + pub basic_auth: Option, + pub oauth_access_token: Option, + pub bearer_access_token: Option, + pub api_key: Option, + // TODO: take an oauth2 token source, similar to the go one +} + +pub type BasicAuth = (String, Option); + +#[derive(Debug, Clone)] +pub struct ApiKey { + pub prefix: Option, + pub key: String, +} + + +impl Configuration { + pub fn new() -> Configuration { + Configuration::default() + } +} + +impl Default for Configuration { + fn default() -> Self { + Configuration { + base_path: "/api/v1".to_owned(), + user_agent: Some("OpenAPI-Generator/1.17.3/rust".to_owned()), + client: reqwest::Client::new(), + basic_auth: None, + oauth_access_token: None, + bearer_access_token: None, + api_key: None, + + } + } +} diff --git a/crates/gitea_raw_client/src/apis/issue_api.rs b/crates/gitea_raw_client/src/apis/issue_api.rs new file mode 100644 index 0000000..c512f16 --- /dev/null +++ b/crates/gitea_raw_client/src/apis/issue_api.rs @@ -0,0 +1,4330 @@ +/* + * Gitea API. + * + * This documentation describes the Gitea API. + * + * The version of the OpenAPI document: 1.17.3 + * + * Generated by: https://openapi-generator.tech + */ + + +use reqwest; + +use crate::apis::ResponseContent; +use super::{Error, configuration}; + + +/// struct for typed errors of method [`issue_add_label`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum IssueAddLabelError { + Status403(), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`issue_add_subscription`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum IssueAddSubscriptionError { + Status404(), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`issue_add_time`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum IssueAddTimeError { + Status400(), + Status403(), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`issue_check_subscription`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum IssueCheckSubscriptionError { + Status404(), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`issue_clear_labels`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum IssueClearLabelsError { + Status403(), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`issue_create_comment`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum IssueCreateCommentError { + Status403(), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`issue_create_issue`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum IssueCreateIssueError { + Status403(), + Status412(), + Status422(), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`issue_create_label`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum IssueCreateLabelError { + Status422(), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`issue_create_milestone`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum IssueCreateMilestoneError { + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`issue_delete`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum IssueDeleteError { + Status403(), + Status404(), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`issue_delete_comment`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum IssueDeleteCommentError { + Status403(), + Status404(), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`issue_delete_comment_deprecated`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum IssueDeleteCommentDeprecatedError { + Status403(), + Status404(), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`issue_delete_comment_reaction`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum IssueDeleteCommentReactionError { + Status403(), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`issue_delete_issue_reaction`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum IssueDeleteIssueReactionError { + Status403(), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`issue_delete_label`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum IssueDeleteLabelError { + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`issue_delete_milestone`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum IssueDeleteMilestoneError { + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`issue_delete_stop_watch`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum IssueDeleteStopWatchError { + Status403(), + Status404(), + Status409(), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`issue_delete_subscription`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum IssueDeleteSubscriptionError { + Status404(), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`issue_delete_time`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum IssueDeleteTimeError { + Status400(), + Status403(), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`issue_edit_comment`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum IssueEditCommentError { + Status403(), + Status404(), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`issue_edit_comment_deprecated`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum IssueEditCommentDeprecatedError { + Status403(), + Status404(), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`issue_edit_issue`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum IssueEditIssueError { + Status403(), + Status404(), + Status412(), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`issue_edit_issue_deadline`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum IssueEditIssueDeadlineError { + Status403(), + Status404(), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`issue_edit_label`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum IssueEditLabelError { + Status422(), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`issue_edit_milestone`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum IssueEditMilestoneError { + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`issue_get_comment`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum IssueGetCommentError { + Status403(), + Status404(), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`issue_get_comment_reactions`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum IssueGetCommentReactionsError { + Status403(), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`issue_get_comments`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum IssueGetCommentsError { + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`issue_get_comments_and_timeline`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum IssueGetCommentsAndTimelineError { + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`issue_get_issue`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum IssueGetIssueError { + Status404(), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`issue_get_issue_reactions`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum IssueGetIssueReactionsError { + Status403(), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`issue_get_label`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum IssueGetLabelError { + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`issue_get_labels`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum IssueGetLabelsError { + Status404(), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`issue_get_milestone`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum IssueGetMilestoneError { + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`issue_get_milestones_list`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum IssueGetMilestonesListError { + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`issue_get_repo_comments`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum IssueGetRepoCommentsError { + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`issue_list_issues`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum IssueListIssuesError { + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`issue_list_labels`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum IssueListLabelsError { + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`issue_post_comment_reaction`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum IssuePostCommentReactionError { + Status403(), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`issue_post_issue_reaction`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum IssuePostIssueReactionError { + Status403(), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`issue_remove_label`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum IssueRemoveLabelError { + Status403(), + Status422(), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`issue_replace_labels`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum IssueReplaceLabelsError { + Status403(), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`issue_reset_time`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum IssueResetTimeError { + Status400(), + Status403(), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`issue_search_issues`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum IssueSearchIssuesError { + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`issue_start_stop_watch`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum IssueStartStopWatchError { + Status403(), + Status404(), + Status409(), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`issue_stop_stop_watch`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum IssueStopStopWatchError { + Status403(), + Status404(), + Status409(), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`issue_subscriptions`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum IssueSubscriptionsError { + Status404(), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`issue_tracked_times`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum IssueTrackedTimesError { + Status404(), + UnknownValue(serde_json::Value), +} + + +pub async fn issue_add_label(configuration: &configuration::Configuration, owner: &str, repo: &str, index: i64, body: Option) -> Result, Error> { + let local_var_configuration = configuration; + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!("{}/repos/{owner}/{repo}/issues/{index}/labels", local_var_configuration.base_path, owner=crate::apis::urlencode(owner), repo=crate::apis::urlencode(repo), index=index); + let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str()); + + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.query(&[("access_token", local_var_value)]); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.query(&[("sudo", local_var_value)]); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.query(&[("token", local_var_value)]); + } + if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { + local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("Authorization", local_var_value); + }; + if let Some(ref local_var_auth_conf) = local_var_configuration.basic_auth { + local_var_req_builder = local_var_req_builder.basic_auth(local_var_auth_conf.0.to_owned(), local_var_auth_conf.1.to_owned()); + }; + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("Sudo", local_var_value); + }; + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("X-GITEA-OTP", local_var_value); + }; + local_var_req_builder = local_var_req_builder.json(&body); + + let local_var_req = local_var_req_builder.build()?; + let local_var_resp = local_var_client.execute(local_var_req).await?; + + let local_var_status = local_var_resp.status(); + let local_var_content = local_var_resp.text().await?; + + if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + serde_json::from_str(&local_var_content).map_err(Error::from) + } else { + let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); + let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; + Err(Error::ResponseError(local_var_error)) + } +} + +pub async fn issue_add_subscription(configuration: &configuration::Configuration, owner: &str, repo: &str, index: i64, user: &str) -> Result<(), Error> { + let local_var_configuration = configuration; + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!("{}/repos/{owner}/{repo}/issues/{index}/subscriptions/{user}", local_var_configuration.base_path, owner=crate::apis::urlencode(owner), repo=crate::apis::urlencode(repo), index=index, user=crate::apis::urlencode(user)); + let mut local_var_req_builder = local_var_client.request(reqwest::Method::PUT, local_var_uri_str.as_str()); + + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.query(&[("access_token", local_var_value)]); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.query(&[("sudo", local_var_value)]); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.query(&[("token", local_var_value)]); + } + if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { + local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("Authorization", local_var_value); + }; + if let Some(ref local_var_auth_conf) = local_var_configuration.basic_auth { + local_var_req_builder = local_var_req_builder.basic_auth(local_var_auth_conf.0.to_owned(), local_var_auth_conf.1.to_owned()); + }; + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("Sudo", local_var_value); + }; + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("X-GITEA-OTP", local_var_value); + }; + + let local_var_req = local_var_req_builder.build()?; + let local_var_resp = local_var_client.execute(local_var_req).await?; + + let local_var_status = local_var_resp.status(); + let local_var_content = local_var_resp.text().await?; + + if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + Ok(()) + } else { + let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); + let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; + Err(Error::ResponseError(local_var_error)) + } +} + +pub async fn issue_add_time(configuration: &configuration::Configuration, owner: &str, repo: &str, index: i64, body: Option) -> Result> { + let local_var_configuration = configuration; + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!("{}/repos/{owner}/{repo}/issues/{index}/times", local_var_configuration.base_path, owner=crate::apis::urlencode(owner), repo=crate::apis::urlencode(repo), index=index); + let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str()); + + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.query(&[("access_token", local_var_value)]); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.query(&[("sudo", local_var_value)]); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.query(&[("token", local_var_value)]); + } + if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { + local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("Authorization", local_var_value); + }; + if let Some(ref local_var_auth_conf) = local_var_configuration.basic_auth { + local_var_req_builder = local_var_req_builder.basic_auth(local_var_auth_conf.0.to_owned(), local_var_auth_conf.1.to_owned()); + }; + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("Sudo", local_var_value); + }; + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("X-GITEA-OTP", local_var_value); + }; + local_var_req_builder = local_var_req_builder.json(&body); + + let local_var_req = local_var_req_builder.build()?; + let local_var_resp = local_var_client.execute(local_var_req).await?; + + let local_var_status = local_var_resp.status(); + let local_var_content = local_var_resp.text().await?; + + if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + serde_json::from_str(&local_var_content).map_err(Error::from) + } else { + let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); + let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; + Err(Error::ResponseError(local_var_error)) + } +} + +pub async fn issue_check_subscription(configuration: &configuration::Configuration, owner: &str, repo: &str, index: i64) -> Result> { + let local_var_configuration = configuration; + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!("{}/repos/{owner}/{repo}/issues/{index}/subscriptions/check", local_var_configuration.base_path, owner=crate::apis::urlencode(owner), repo=crate::apis::urlencode(repo), index=index); + let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str()); + + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.query(&[("access_token", local_var_value)]); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.query(&[("sudo", local_var_value)]); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.query(&[("token", local_var_value)]); + } + if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { + local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("Authorization", local_var_value); + }; + if let Some(ref local_var_auth_conf) = local_var_configuration.basic_auth { + local_var_req_builder = local_var_req_builder.basic_auth(local_var_auth_conf.0.to_owned(), local_var_auth_conf.1.to_owned()); + }; + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("Sudo", local_var_value); + }; + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("X-GITEA-OTP", local_var_value); + }; + + let local_var_req = local_var_req_builder.build()?; + let local_var_resp = local_var_client.execute(local_var_req).await?; + + let local_var_status = local_var_resp.status(); + let local_var_content = local_var_resp.text().await?; + + if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + serde_json::from_str(&local_var_content).map_err(Error::from) + } else { + let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); + let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; + Err(Error::ResponseError(local_var_error)) + } +} + +pub async fn issue_clear_labels(configuration: &configuration::Configuration, owner: &str, repo: &str, index: i64) -> Result<(), Error> { + let local_var_configuration = configuration; + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!("{}/repos/{owner}/{repo}/issues/{index}/labels", local_var_configuration.base_path, owner=crate::apis::urlencode(owner), repo=crate::apis::urlencode(repo), index=index); + let mut local_var_req_builder = local_var_client.request(reqwest::Method::DELETE, local_var_uri_str.as_str()); + + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.query(&[("access_token", local_var_value)]); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.query(&[("sudo", local_var_value)]); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.query(&[("token", local_var_value)]); + } + if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { + local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("Authorization", local_var_value); + }; + if let Some(ref local_var_auth_conf) = local_var_configuration.basic_auth { + local_var_req_builder = local_var_req_builder.basic_auth(local_var_auth_conf.0.to_owned(), local_var_auth_conf.1.to_owned()); + }; + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("Sudo", local_var_value); + }; + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("X-GITEA-OTP", local_var_value); + }; + + let local_var_req = local_var_req_builder.build()?; + let local_var_resp = local_var_client.execute(local_var_req).await?; + + let local_var_status = local_var_resp.status(); + let local_var_content = local_var_resp.text().await?; + + if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + Ok(()) + } else { + let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); + let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; + Err(Error::ResponseError(local_var_error)) + } +} + +pub async fn issue_create_comment(configuration: &configuration::Configuration, owner: &str, repo: &str, index: i64, body: Option) -> Result> { + let local_var_configuration = configuration; + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!("{}/repos/{owner}/{repo}/issues/{index}/comments", local_var_configuration.base_path, owner=crate::apis::urlencode(owner), repo=crate::apis::urlencode(repo), index=index); + let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str()); + + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.query(&[("access_token", local_var_value)]); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.query(&[("sudo", local_var_value)]); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.query(&[("token", local_var_value)]); + } + if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { + local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("Authorization", local_var_value); + }; + if let Some(ref local_var_auth_conf) = local_var_configuration.basic_auth { + local_var_req_builder = local_var_req_builder.basic_auth(local_var_auth_conf.0.to_owned(), local_var_auth_conf.1.to_owned()); + }; + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("Sudo", local_var_value); + }; + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("X-GITEA-OTP", local_var_value); + }; + local_var_req_builder = local_var_req_builder.json(&body); + + let local_var_req = local_var_req_builder.build()?; + let local_var_resp = local_var_client.execute(local_var_req).await?; + + let local_var_status = local_var_resp.status(); + let local_var_content = local_var_resp.text().await?; + + if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + serde_json::from_str(&local_var_content).map_err(Error::from) + } else { + let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); + let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; + Err(Error::ResponseError(local_var_error)) + } +} + +pub async fn issue_create_issue(configuration: &configuration::Configuration, owner: &str, repo: &str, body: Option) -> Result> { + let local_var_configuration = configuration; + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!("{}/repos/{owner}/{repo}/issues", local_var_configuration.base_path, owner=crate::apis::urlencode(owner), repo=crate::apis::urlencode(repo)); + let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str()); + + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.query(&[("access_token", local_var_value)]); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.query(&[("sudo", local_var_value)]); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.query(&[("token", local_var_value)]); + } + if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { + local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("Authorization", local_var_value); + }; + if let Some(ref local_var_auth_conf) = local_var_configuration.basic_auth { + local_var_req_builder = local_var_req_builder.basic_auth(local_var_auth_conf.0.to_owned(), local_var_auth_conf.1.to_owned()); + }; + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("Sudo", local_var_value); + }; + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("X-GITEA-OTP", local_var_value); + }; + local_var_req_builder = local_var_req_builder.json(&body); + + let local_var_req = local_var_req_builder.build()?; + let local_var_resp = local_var_client.execute(local_var_req).await?; + + let local_var_status = local_var_resp.status(); + let local_var_content = local_var_resp.text().await?; + + if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + serde_json::from_str(&local_var_content).map_err(Error::from) + } else { + let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); + let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; + Err(Error::ResponseError(local_var_error)) + } +} + +pub async fn issue_create_label(configuration: &configuration::Configuration, owner: &str, repo: &str, body: Option) -> Result> { + let local_var_configuration = configuration; + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!("{}/repos/{owner}/{repo}/labels", local_var_configuration.base_path, owner=crate::apis::urlencode(owner), repo=crate::apis::urlencode(repo)); + let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str()); + + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.query(&[("access_token", local_var_value)]); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.query(&[("sudo", local_var_value)]); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.query(&[("token", local_var_value)]); + } + if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { + local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("Authorization", local_var_value); + }; + if let Some(ref local_var_auth_conf) = local_var_configuration.basic_auth { + local_var_req_builder = local_var_req_builder.basic_auth(local_var_auth_conf.0.to_owned(), local_var_auth_conf.1.to_owned()); + }; + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("Sudo", local_var_value); + }; + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("X-GITEA-OTP", local_var_value); + }; + local_var_req_builder = local_var_req_builder.json(&body); + + let local_var_req = local_var_req_builder.build()?; + let local_var_resp = local_var_client.execute(local_var_req).await?; + + let local_var_status = local_var_resp.status(); + let local_var_content = local_var_resp.text().await?; + + if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + serde_json::from_str(&local_var_content).map_err(Error::from) + } else { + let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); + let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; + Err(Error::ResponseError(local_var_error)) + } +} + +pub async fn issue_create_milestone(configuration: &configuration::Configuration, owner: &str, repo: &str, body: Option) -> Result> { + let local_var_configuration = configuration; + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!("{}/repos/{owner}/{repo}/milestones", local_var_configuration.base_path, owner=crate::apis::urlencode(owner), repo=crate::apis::urlencode(repo)); + let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str()); + + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.query(&[("access_token", local_var_value)]); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.query(&[("sudo", local_var_value)]); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.query(&[("token", local_var_value)]); + } + if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { + local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("Authorization", local_var_value); + }; + if let Some(ref local_var_auth_conf) = local_var_configuration.basic_auth { + local_var_req_builder = local_var_req_builder.basic_auth(local_var_auth_conf.0.to_owned(), local_var_auth_conf.1.to_owned()); + }; + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("Sudo", local_var_value); + }; + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("X-GITEA-OTP", local_var_value); + }; + local_var_req_builder = local_var_req_builder.json(&body); + + let local_var_req = local_var_req_builder.build()?; + let local_var_resp = local_var_client.execute(local_var_req).await?; + + let local_var_status = local_var_resp.status(); + let local_var_content = local_var_resp.text().await?; + + if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + serde_json::from_str(&local_var_content).map_err(Error::from) + } else { + let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); + let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; + Err(Error::ResponseError(local_var_error)) + } +} + +pub async fn issue_delete(configuration: &configuration::Configuration, owner: &str, repo: &str, index: i64) -> Result<(), Error> { + let local_var_configuration = configuration; + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!("{}/repos/{owner}/{repo}/issues/{index}", local_var_configuration.base_path, owner=crate::apis::urlencode(owner), repo=crate::apis::urlencode(repo), index=index); + let mut local_var_req_builder = local_var_client.request(reqwest::Method::DELETE, local_var_uri_str.as_str()); + + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.query(&[("access_token", local_var_value)]); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.query(&[("sudo", local_var_value)]); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.query(&[("token", local_var_value)]); + } + if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { + local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("Authorization", local_var_value); + }; + if let Some(ref local_var_auth_conf) = local_var_configuration.basic_auth { + local_var_req_builder = local_var_req_builder.basic_auth(local_var_auth_conf.0.to_owned(), local_var_auth_conf.1.to_owned()); + }; + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("Sudo", local_var_value); + }; + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("X-GITEA-OTP", local_var_value); + }; + + let local_var_req = local_var_req_builder.build()?; + let local_var_resp = local_var_client.execute(local_var_req).await?; + + let local_var_status = local_var_resp.status(); + let local_var_content = local_var_resp.text().await?; + + if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + Ok(()) + } else { + let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); + let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; + Err(Error::ResponseError(local_var_error)) + } +} + +pub async fn issue_delete_comment(configuration: &configuration::Configuration, owner: &str, repo: &str, id: i64) -> Result<(), Error> { + let local_var_configuration = configuration; + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!("{}/repos/{owner}/{repo}/issues/comments/{id}", local_var_configuration.base_path, owner=crate::apis::urlencode(owner), repo=crate::apis::urlencode(repo), id=id); + let mut local_var_req_builder = local_var_client.request(reqwest::Method::DELETE, local_var_uri_str.as_str()); + + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.query(&[("access_token", local_var_value)]); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.query(&[("sudo", local_var_value)]); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.query(&[("token", local_var_value)]); + } + if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { + local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("Authorization", local_var_value); + }; + if let Some(ref local_var_auth_conf) = local_var_configuration.basic_auth { + local_var_req_builder = local_var_req_builder.basic_auth(local_var_auth_conf.0.to_owned(), local_var_auth_conf.1.to_owned()); + }; + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("Sudo", local_var_value); + }; + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("X-GITEA-OTP", local_var_value); + }; + + let local_var_req = local_var_req_builder.build()?; + let local_var_resp = local_var_client.execute(local_var_req).await?; + + let local_var_status = local_var_resp.status(); + let local_var_content = local_var_resp.text().await?; + + if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + Ok(()) + } else { + let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); + let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; + Err(Error::ResponseError(local_var_error)) + } +} + +pub async fn issue_delete_comment_deprecated(configuration: &configuration::Configuration, owner: &str, repo: &str, index: i32, id: i64) -> Result<(), Error> { + let local_var_configuration = configuration; + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!("{}/repos/{owner}/{repo}/issues/{index}/comments/{id}", local_var_configuration.base_path, owner=crate::apis::urlencode(owner), repo=crate::apis::urlencode(repo), index=index, id=id); + let mut local_var_req_builder = local_var_client.request(reqwest::Method::DELETE, local_var_uri_str.as_str()); + + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.query(&[("access_token", local_var_value)]); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.query(&[("sudo", local_var_value)]); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.query(&[("token", local_var_value)]); + } + if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { + local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("Authorization", local_var_value); + }; + if let Some(ref local_var_auth_conf) = local_var_configuration.basic_auth { + local_var_req_builder = local_var_req_builder.basic_auth(local_var_auth_conf.0.to_owned(), local_var_auth_conf.1.to_owned()); + }; + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("Sudo", local_var_value); + }; + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("X-GITEA-OTP", local_var_value); + }; + + let local_var_req = local_var_req_builder.build()?; + let local_var_resp = local_var_client.execute(local_var_req).await?; + + let local_var_status = local_var_resp.status(); + let local_var_content = local_var_resp.text().await?; + + if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + Ok(()) + } else { + let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); + let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; + Err(Error::ResponseError(local_var_error)) + } +} + +pub async fn issue_delete_comment_reaction(configuration: &configuration::Configuration, owner: &str, repo: &str, id: i64, content: Option) -> Result<(), Error> { + let local_var_configuration = configuration; + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!("{}/repos/{owner}/{repo}/issues/comments/{id}/reactions", local_var_configuration.base_path, owner=crate::apis::urlencode(owner), repo=crate::apis::urlencode(repo), id=id); + let mut local_var_req_builder = local_var_client.request(reqwest::Method::DELETE, local_var_uri_str.as_str()); + + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.query(&[("access_token", local_var_value)]); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.query(&[("sudo", local_var_value)]); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.query(&[("token", local_var_value)]); + } + if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { + local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("Authorization", local_var_value); + }; + if let Some(ref local_var_auth_conf) = local_var_configuration.basic_auth { + local_var_req_builder = local_var_req_builder.basic_auth(local_var_auth_conf.0.to_owned(), local_var_auth_conf.1.to_owned()); + }; + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("Sudo", local_var_value); + }; + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("X-GITEA-OTP", local_var_value); + }; + local_var_req_builder = local_var_req_builder.json(&content); + + let local_var_req = local_var_req_builder.build()?; + let local_var_resp = local_var_client.execute(local_var_req).await?; + + let local_var_status = local_var_resp.status(); + let local_var_content = local_var_resp.text().await?; + + if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + Ok(()) + } else { + let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); + let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; + Err(Error::ResponseError(local_var_error)) + } +} + +pub async fn issue_delete_issue_reaction(configuration: &configuration::Configuration, owner: &str, repo: &str, index: i64, content: Option) -> Result<(), Error> { + let local_var_configuration = configuration; + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!("{}/repos/{owner}/{repo}/issues/{index}/reactions", local_var_configuration.base_path, owner=crate::apis::urlencode(owner), repo=crate::apis::urlencode(repo), index=index); + let mut local_var_req_builder = local_var_client.request(reqwest::Method::DELETE, local_var_uri_str.as_str()); + + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.query(&[("access_token", local_var_value)]); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.query(&[("sudo", local_var_value)]); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.query(&[("token", local_var_value)]); + } + if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { + local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("Authorization", local_var_value); + }; + if let Some(ref local_var_auth_conf) = local_var_configuration.basic_auth { + local_var_req_builder = local_var_req_builder.basic_auth(local_var_auth_conf.0.to_owned(), local_var_auth_conf.1.to_owned()); + }; + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("Sudo", local_var_value); + }; + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("X-GITEA-OTP", local_var_value); + }; + local_var_req_builder = local_var_req_builder.json(&content); + + let local_var_req = local_var_req_builder.build()?; + let local_var_resp = local_var_client.execute(local_var_req).await?; + + let local_var_status = local_var_resp.status(); + let local_var_content = local_var_resp.text().await?; + + if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + Ok(()) + } else { + let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); + let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; + Err(Error::ResponseError(local_var_error)) + } +} + +pub async fn issue_delete_label(configuration: &configuration::Configuration, owner: &str, repo: &str, id: i64) -> Result<(), Error> { + let local_var_configuration = configuration; + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!("{}/repos/{owner}/{repo}/labels/{id}", local_var_configuration.base_path, owner=crate::apis::urlencode(owner), repo=crate::apis::urlencode(repo), id=id); + let mut local_var_req_builder = local_var_client.request(reqwest::Method::DELETE, local_var_uri_str.as_str()); + + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.query(&[("access_token", local_var_value)]); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.query(&[("sudo", local_var_value)]); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.query(&[("token", local_var_value)]); + } + if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { + local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("Authorization", local_var_value); + }; + if let Some(ref local_var_auth_conf) = local_var_configuration.basic_auth { + local_var_req_builder = local_var_req_builder.basic_auth(local_var_auth_conf.0.to_owned(), local_var_auth_conf.1.to_owned()); + }; + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("Sudo", local_var_value); + }; + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("X-GITEA-OTP", local_var_value); + }; + + let local_var_req = local_var_req_builder.build()?; + let local_var_resp = local_var_client.execute(local_var_req).await?; + + let local_var_status = local_var_resp.status(); + let local_var_content = local_var_resp.text().await?; + + if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + Ok(()) + } else { + let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); + let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; + Err(Error::ResponseError(local_var_error)) + } +} + +pub async fn issue_delete_milestone(configuration: &configuration::Configuration, owner: &str, repo: &str, id: &str) -> Result<(), Error> { + let local_var_configuration = configuration; + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!("{}/repos/{owner}/{repo}/milestones/{id}", local_var_configuration.base_path, owner=crate::apis::urlencode(owner), repo=crate::apis::urlencode(repo), id=crate::apis::urlencode(id)); + let mut local_var_req_builder = local_var_client.request(reqwest::Method::DELETE, local_var_uri_str.as_str()); + + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.query(&[("access_token", local_var_value)]); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.query(&[("sudo", local_var_value)]); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.query(&[("token", local_var_value)]); + } + if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { + local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("Authorization", local_var_value); + }; + if let Some(ref local_var_auth_conf) = local_var_configuration.basic_auth { + local_var_req_builder = local_var_req_builder.basic_auth(local_var_auth_conf.0.to_owned(), local_var_auth_conf.1.to_owned()); + }; + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("Sudo", local_var_value); + }; + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("X-GITEA-OTP", local_var_value); + }; + + let local_var_req = local_var_req_builder.build()?; + let local_var_resp = local_var_client.execute(local_var_req).await?; + + let local_var_status = local_var_resp.status(); + let local_var_content = local_var_resp.text().await?; + + if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + Ok(()) + } else { + let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); + let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; + Err(Error::ResponseError(local_var_error)) + } +} + +pub async fn issue_delete_stop_watch(configuration: &configuration::Configuration, owner: &str, repo: &str, index: i64) -> Result<(), Error> { + let local_var_configuration = configuration; + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!("{}/repos/{owner}/{repo}/issues/{index}/stopwatch/delete", local_var_configuration.base_path, owner=crate::apis::urlencode(owner), repo=crate::apis::urlencode(repo), index=index); + let mut local_var_req_builder = local_var_client.request(reqwest::Method::DELETE, local_var_uri_str.as_str()); + + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.query(&[("access_token", local_var_value)]); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.query(&[("sudo", local_var_value)]); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.query(&[("token", local_var_value)]); + } + if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { + local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("Authorization", local_var_value); + }; + if let Some(ref local_var_auth_conf) = local_var_configuration.basic_auth { + local_var_req_builder = local_var_req_builder.basic_auth(local_var_auth_conf.0.to_owned(), local_var_auth_conf.1.to_owned()); + }; + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("Sudo", local_var_value); + }; + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("X-GITEA-OTP", local_var_value); + }; + + let local_var_req = local_var_req_builder.build()?; + let local_var_resp = local_var_client.execute(local_var_req).await?; + + let local_var_status = local_var_resp.status(); + let local_var_content = local_var_resp.text().await?; + + if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + Ok(()) + } else { + let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); + let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; + Err(Error::ResponseError(local_var_error)) + } +} + +pub async fn issue_delete_subscription(configuration: &configuration::Configuration, owner: &str, repo: &str, index: i64, user: &str) -> Result<(), Error> { + let local_var_configuration = configuration; + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!("{}/repos/{owner}/{repo}/issues/{index}/subscriptions/{user}", local_var_configuration.base_path, owner=crate::apis::urlencode(owner), repo=crate::apis::urlencode(repo), index=index, user=crate::apis::urlencode(user)); + let mut local_var_req_builder = local_var_client.request(reqwest::Method::DELETE, local_var_uri_str.as_str()); + + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.query(&[("access_token", local_var_value)]); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.query(&[("sudo", local_var_value)]); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.query(&[("token", local_var_value)]); + } + if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { + local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("Authorization", local_var_value); + }; + if let Some(ref local_var_auth_conf) = local_var_configuration.basic_auth { + local_var_req_builder = local_var_req_builder.basic_auth(local_var_auth_conf.0.to_owned(), local_var_auth_conf.1.to_owned()); + }; + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("Sudo", local_var_value); + }; + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("X-GITEA-OTP", local_var_value); + }; + + let local_var_req = local_var_req_builder.build()?; + let local_var_resp = local_var_client.execute(local_var_req).await?; + + let local_var_status = local_var_resp.status(); + let local_var_content = local_var_resp.text().await?; + + if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + Ok(()) + } else { + let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); + let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; + Err(Error::ResponseError(local_var_error)) + } +} + +pub async fn issue_delete_time(configuration: &configuration::Configuration, owner: &str, repo: &str, index: i64, id: i64) -> Result<(), Error> { + let local_var_configuration = configuration; + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!("{}/repos/{owner}/{repo}/issues/{index}/times/{id}", local_var_configuration.base_path, owner=crate::apis::urlencode(owner), repo=crate::apis::urlencode(repo), index=index, id=id); + let mut local_var_req_builder = local_var_client.request(reqwest::Method::DELETE, local_var_uri_str.as_str()); + + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.query(&[("access_token", local_var_value)]); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.query(&[("sudo", local_var_value)]); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.query(&[("token", local_var_value)]); + } + if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { + local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("Authorization", local_var_value); + }; + if let Some(ref local_var_auth_conf) = local_var_configuration.basic_auth { + local_var_req_builder = local_var_req_builder.basic_auth(local_var_auth_conf.0.to_owned(), local_var_auth_conf.1.to_owned()); + }; + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("Sudo", local_var_value); + }; + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("X-GITEA-OTP", local_var_value); + }; + + let local_var_req = local_var_req_builder.build()?; + let local_var_resp = local_var_client.execute(local_var_req).await?; + + let local_var_status = local_var_resp.status(); + let local_var_content = local_var_resp.text().await?; + + if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + Ok(()) + } else { + let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); + let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; + Err(Error::ResponseError(local_var_error)) + } +} + +pub async fn issue_edit_comment(configuration: &configuration::Configuration, owner: &str, repo: &str, id: i64, body: Option) -> Result> { + let local_var_configuration = configuration; + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!("{}/repos/{owner}/{repo}/issues/comments/{id}", local_var_configuration.base_path, owner=crate::apis::urlencode(owner), repo=crate::apis::urlencode(repo), id=id); + let mut local_var_req_builder = local_var_client.request(reqwest::Method::PATCH, local_var_uri_str.as_str()); + + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.query(&[("access_token", local_var_value)]); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.query(&[("sudo", local_var_value)]); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.query(&[("token", local_var_value)]); + } + if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { + local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("Authorization", local_var_value); + }; + if let Some(ref local_var_auth_conf) = local_var_configuration.basic_auth { + local_var_req_builder = local_var_req_builder.basic_auth(local_var_auth_conf.0.to_owned(), local_var_auth_conf.1.to_owned()); + }; + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("Sudo", local_var_value); + }; + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("X-GITEA-OTP", local_var_value); + }; + local_var_req_builder = local_var_req_builder.json(&body); + + let local_var_req = local_var_req_builder.build()?; + let local_var_resp = local_var_client.execute(local_var_req).await?; + + let local_var_status = local_var_resp.status(); + let local_var_content = local_var_resp.text().await?; + + if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + serde_json::from_str(&local_var_content).map_err(Error::from) + } else { + let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); + let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; + Err(Error::ResponseError(local_var_error)) + } +} + +pub async fn issue_edit_comment_deprecated(configuration: &configuration::Configuration, owner: &str, repo: &str, index: i32, id: i64, body: Option) -> Result> { + let local_var_configuration = configuration; + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!("{}/repos/{owner}/{repo}/issues/{index}/comments/{id}", local_var_configuration.base_path, owner=crate::apis::urlencode(owner), repo=crate::apis::urlencode(repo), index=index, id=id); + let mut local_var_req_builder = local_var_client.request(reqwest::Method::PATCH, local_var_uri_str.as_str()); + + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.query(&[("access_token", local_var_value)]); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.query(&[("sudo", local_var_value)]); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.query(&[("token", local_var_value)]); + } + if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { + local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("Authorization", local_var_value); + }; + if let Some(ref local_var_auth_conf) = local_var_configuration.basic_auth { + local_var_req_builder = local_var_req_builder.basic_auth(local_var_auth_conf.0.to_owned(), local_var_auth_conf.1.to_owned()); + }; + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("Sudo", local_var_value); + }; + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("X-GITEA-OTP", local_var_value); + }; + local_var_req_builder = local_var_req_builder.json(&body); + + let local_var_req = local_var_req_builder.build()?; + let local_var_resp = local_var_client.execute(local_var_req).await?; + + let local_var_status = local_var_resp.status(); + let local_var_content = local_var_resp.text().await?; + + if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + serde_json::from_str(&local_var_content).map_err(Error::from) + } else { + let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); + let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; + Err(Error::ResponseError(local_var_error)) + } +} + +pub async fn issue_edit_issue(configuration: &configuration::Configuration, owner: &str, repo: &str, index: i64, body: Option) -> Result> { + let local_var_configuration = configuration; + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!("{}/repos/{owner}/{repo}/issues/{index}", local_var_configuration.base_path, owner=crate::apis::urlencode(owner), repo=crate::apis::urlencode(repo), index=index); + let mut local_var_req_builder = local_var_client.request(reqwest::Method::PATCH, local_var_uri_str.as_str()); + + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.query(&[("access_token", local_var_value)]); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.query(&[("sudo", local_var_value)]); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.query(&[("token", local_var_value)]); + } + if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { + local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("Authorization", local_var_value); + }; + if let Some(ref local_var_auth_conf) = local_var_configuration.basic_auth { + local_var_req_builder = local_var_req_builder.basic_auth(local_var_auth_conf.0.to_owned(), local_var_auth_conf.1.to_owned()); + }; + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("Sudo", local_var_value); + }; + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("X-GITEA-OTP", local_var_value); + }; + local_var_req_builder = local_var_req_builder.json(&body); + + let local_var_req = local_var_req_builder.build()?; + let local_var_resp = local_var_client.execute(local_var_req).await?; + + let local_var_status = local_var_resp.status(); + let local_var_content = local_var_resp.text().await?; + + if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + serde_json::from_str(&local_var_content).map_err(Error::from) + } else { + let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); + let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; + Err(Error::ResponseError(local_var_error)) + } +} + +pub async fn issue_edit_issue_deadline(configuration: &configuration::Configuration, owner: &str, repo: &str, index: i64, body: Option) -> Result> { + let local_var_configuration = configuration; + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!("{}/repos/{owner}/{repo}/issues/{index}/deadline", local_var_configuration.base_path, owner=crate::apis::urlencode(owner), repo=crate::apis::urlencode(repo), index=index); + let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str()); + + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.query(&[("access_token", local_var_value)]); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.query(&[("sudo", local_var_value)]); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.query(&[("token", local_var_value)]); + } + if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { + local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("Authorization", local_var_value); + }; + if let Some(ref local_var_auth_conf) = local_var_configuration.basic_auth { + local_var_req_builder = local_var_req_builder.basic_auth(local_var_auth_conf.0.to_owned(), local_var_auth_conf.1.to_owned()); + }; + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("Sudo", local_var_value); + }; + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("X-GITEA-OTP", local_var_value); + }; + local_var_req_builder = local_var_req_builder.json(&body); + + let local_var_req = local_var_req_builder.build()?; + let local_var_resp = local_var_client.execute(local_var_req).await?; + + let local_var_status = local_var_resp.status(); + let local_var_content = local_var_resp.text().await?; + + if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + serde_json::from_str(&local_var_content).map_err(Error::from) + } else { + let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); + let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; + Err(Error::ResponseError(local_var_error)) + } +} + +pub async fn issue_edit_label(configuration: &configuration::Configuration, owner: &str, repo: &str, id: i64, body: Option) -> Result> { + let local_var_configuration = configuration; + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!("{}/repos/{owner}/{repo}/labels/{id}", local_var_configuration.base_path, owner=crate::apis::urlencode(owner), repo=crate::apis::urlencode(repo), id=id); + let mut local_var_req_builder = local_var_client.request(reqwest::Method::PATCH, local_var_uri_str.as_str()); + + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.query(&[("access_token", local_var_value)]); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.query(&[("sudo", local_var_value)]); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.query(&[("token", local_var_value)]); + } + if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { + local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("Authorization", local_var_value); + }; + if let Some(ref local_var_auth_conf) = local_var_configuration.basic_auth { + local_var_req_builder = local_var_req_builder.basic_auth(local_var_auth_conf.0.to_owned(), local_var_auth_conf.1.to_owned()); + }; + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("Sudo", local_var_value); + }; + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("X-GITEA-OTP", local_var_value); + }; + local_var_req_builder = local_var_req_builder.json(&body); + + let local_var_req = local_var_req_builder.build()?; + let local_var_resp = local_var_client.execute(local_var_req).await?; + + let local_var_status = local_var_resp.status(); + let local_var_content = local_var_resp.text().await?; + + if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + serde_json::from_str(&local_var_content).map_err(Error::from) + } else { + let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); + let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; + Err(Error::ResponseError(local_var_error)) + } +} + +pub async fn issue_edit_milestone(configuration: &configuration::Configuration, owner: &str, repo: &str, id: &str, body: Option) -> Result> { + let local_var_configuration = configuration; + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!("{}/repos/{owner}/{repo}/milestones/{id}", local_var_configuration.base_path, owner=crate::apis::urlencode(owner), repo=crate::apis::urlencode(repo), id=crate::apis::urlencode(id)); + let mut local_var_req_builder = local_var_client.request(reqwest::Method::PATCH, local_var_uri_str.as_str()); + + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.query(&[("access_token", local_var_value)]); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.query(&[("sudo", local_var_value)]); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.query(&[("token", local_var_value)]); + } + if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { + local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("Authorization", local_var_value); + }; + if let Some(ref local_var_auth_conf) = local_var_configuration.basic_auth { + local_var_req_builder = local_var_req_builder.basic_auth(local_var_auth_conf.0.to_owned(), local_var_auth_conf.1.to_owned()); + }; + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("Sudo", local_var_value); + }; + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("X-GITEA-OTP", local_var_value); + }; + local_var_req_builder = local_var_req_builder.json(&body); + + let local_var_req = local_var_req_builder.build()?; + let local_var_resp = local_var_client.execute(local_var_req).await?; + + let local_var_status = local_var_resp.status(); + let local_var_content = local_var_resp.text().await?; + + if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + serde_json::from_str(&local_var_content).map_err(Error::from) + } else { + let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); + let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; + Err(Error::ResponseError(local_var_error)) + } +} + +pub async fn issue_get_comment(configuration: &configuration::Configuration, owner: &str, repo: &str, id: i64) -> Result> { + let local_var_configuration = configuration; + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!("{}/repos/{owner}/{repo}/issues/comments/{id}", local_var_configuration.base_path, owner=crate::apis::urlencode(owner), repo=crate::apis::urlencode(repo), id=id); + let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str()); + + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.query(&[("access_token", local_var_value)]); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.query(&[("sudo", local_var_value)]); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.query(&[("token", local_var_value)]); + } + if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { + local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("Authorization", local_var_value); + }; + if let Some(ref local_var_auth_conf) = local_var_configuration.basic_auth { + local_var_req_builder = local_var_req_builder.basic_auth(local_var_auth_conf.0.to_owned(), local_var_auth_conf.1.to_owned()); + }; + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("Sudo", local_var_value); + }; + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("X-GITEA-OTP", local_var_value); + }; + + let local_var_req = local_var_req_builder.build()?; + let local_var_resp = local_var_client.execute(local_var_req).await?; + + let local_var_status = local_var_resp.status(); + let local_var_content = local_var_resp.text().await?; + + if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + serde_json::from_str(&local_var_content).map_err(Error::from) + } else { + let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); + let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; + Err(Error::ResponseError(local_var_error)) + } +} + +pub async fn issue_get_comment_reactions(configuration: &configuration::Configuration, owner: &str, repo: &str, id: i64) -> Result, Error> { + let local_var_configuration = configuration; + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!("{}/repos/{owner}/{repo}/issues/comments/{id}/reactions", local_var_configuration.base_path, owner=crate::apis::urlencode(owner), repo=crate::apis::urlencode(repo), id=id); + let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str()); + + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.query(&[("access_token", local_var_value)]); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.query(&[("sudo", local_var_value)]); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.query(&[("token", local_var_value)]); + } + if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { + local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("Authorization", local_var_value); + }; + if let Some(ref local_var_auth_conf) = local_var_configuration.basic_auth { + local_var_req_builder = local_var_req_builder.basic_auth(local_var_auth_conf.0.to_owned(), local_var_auth_conf.1.to_owned()); + }; + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("Sudo", local_var_value); + }; + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("X-GITEA-OTP", local_var_value); + }; + + let local_var_req = local_var_req_builder.build()?; + let local_var_resp = local_var_client.execute(local_var_req).await?; + + let local_var_status = local_var_resp.status(); + let local_var_content = local_var_resp.text().await?; + + if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + serde_json::from_str(&local_var_content).map_err(Error::from) + } else { + let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); + let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; + Err(Error::ResponseError(local_var_error)) + } +} + +pub async fn issue_get_comments(configuration: &configuration::Configuration, owner: &str, repo: &str, index: i64, since: Option, before: Option) -> Result, Error> { + let local_var_configuration = configuration; + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!("{}/repos/{owner}/{repo}/issues/{index}/comments", local_var_configuration.base_path, owner=crate::apis::urlencode(owner), repo=crate::apis::urlencode(repo), index=index); + let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str()); + + if let Some(ref local_var_str) = since { + local_var_req_builder = local_var_req_builder.query(&[("since", &local_var_str.to_string())]); + } + if let Some(ref local_var_str) = before { + local_var_req_builder = local_var_req_builder.query(&[("before", &local_var_str.to_string())]); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.query(&[("access_token", local_var_value)]); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.query(&[("sudo", local_var_value)]); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.query(&[("token", local_var_value)]); + } + if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { + local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("Authorization", local_var_value); + }; + if let Some(ref local_var_auth_conf) = local_var_configuration.basic_auth { + local_var_req_builder = local_var_req_builder.basic_auth(local_var_auth_conf.0.to_owned(), local_var_auth_conf.1.to_owned()); + }; + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("Sudo", local_var_value); + }; + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("X-GITEA-OTP", local_var_value); + }; + + let local_var_req = local_var_req_builder.build()?; + let local_var_resp = local_var_client.execute(local_var_req).await?; + + let local_var_status = local_var_resp.status(); + let local_var_content = local_var_resp.text().await?; + + if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + serde_json::from_str(&local_var_content).map_err(Error::from) + } else { + let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); + let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; + Err(Error::ResponseError(local_var_error)) + } +} + +pub async fn issue_get_comments_and_timeline(configuration: &configuration::Configuration, owner: &str, repo: &str, index: i64, since: Option, page: Option, limit: Option, before: Option) -> Result, Error> { + let local_var_configuration = configuration; + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!("{}/repos/{owner}/{repo}/issues/{index}/timeline", local_var_configuration.base_path, owner=crate::apis::urlencode(owner), repo=crate::apis::urlencode(repo), index=index); + let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str()); + + if let Some(ref local_var_str) = since { + local_var_req_builder = local_var_req_builder.query(&[("since", &local_var_str.to_string())]); + } + if let Some(ref local_var_str) = page { + local_var_req_builder = local_var_req_builder.query(&[("page", &local_var_str.to_string())]); + } + if let Some(ref local_var_str) = limit { + local_var_req_builder = local_var_req_builder.query(&[("limit", &local_var_str.to_string())]); + } + if let Some(ref local_var_str) = before { + local_var_req_builder = local_var_req_builder.query(&[("before", &local_var_str.to_string())]); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.query(&[("access_token", local_var_value)]); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.query(&[("sudo", local_var_value)]); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.query(&[("token", local_var_value)]); + } + if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { + local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("Authorization", local_var_value); + }; + if let Some(ref local_var_auth_conf) = local_var_configuration.basic_auth { + local_var_req_builder = local_var_req_builder.basic_auth(local_var_auth_conf.0.to_owned(), local_var_auth_conf.1.to_owned()); + }; + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("Sudo", local_var_value); + }; + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("X-GITEA-OTP", local_var_value); + }; + + let local_var_req = local_var_req_builder.build()?; + let local_var_resp = local_var_client.execute(local_var_req).await?; + + let local_var_status = local_var_resp.status(); + let local_var_content = local_var_resp.text().await?; + + if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + serde_json::from_str(&local_var_content).map_err(Error::from) + } else { + let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); + let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; + Err(Error::ResponseError(local_var_error)) + } +} + +pub async fn issue_get_issue(configuration: &configuration::Configuration, owner: &str, repo: &str, index: i64) -> Result> { + let local_var_configuration = configuration; + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!("{}/repos/{owner}/{repo}/issues/{index}", local_var_configuration.base_path, owner=crate::apis::urlencode(owner), repo=crate::apis::urlencode(repo), index=index); + let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str()); + + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.query(&[("access_token", local_var_value)]); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.query(&[("sudo", local_var_value)]); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.query(&[("token", local_var_value)]); + } + if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { + local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("Authorization", local_var_value); + }; + if let Some(ref local_var_auth_conf) = local_var_configuration.basic_auth { + local_var_req_builder = local_var_req_builder.basic_auth(local_var_auth_conf.0.to_owned(), local_var_auth_conf.1.to_owned()); + }; + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("Sudo", local_var_value); + }; + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("X-GITEA-OTP", local_var_value); + }; + + let local_var_req = local_var_req_builder.build()?; + let local_var_resp = local_var_client.execute(local_var_req).await?; + + let local_var_status = local_var_resp.status(); + let local_var_content = local_var_resp.text().await?; + + if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + serde_json::from_str(&local_var_content).map_err(Error::from) + } else { + let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); + let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; + Err(Error::ResponseError(local_var_error)) + } +} + +pub async fn issue_get_issue_reactions(configuration: &configuration::Configuration, owner: &str, repo: &str, index: i64, page: Option, limit: Option) -> Result, Error> { + let local_var_configuration = configuration; + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!("{}/repos/{owner}/{repo}/issues/{index}/reactions", local_var_configuration.base_path, owner=crate::apis::urlencode(owner), repo=crate::apis::urlencode(repo), index=index); + let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str()); + + if let Some(ref local_var_str) = page { + local_var_req_builder = local_var_req_builder.query(&[("page", &local_var_str.to_string())]); + } + if let Some(ref local_var_str) = limit { + local_var_req_builder = local_var_req_builder.query(&[("limit", &local_var_str.to_string())]); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.query(&[("access_token", local_var_value)]); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.query(&[("sudo", local_var_value)]); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.query(&[("token", local_var_value)]); + } + if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { + local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("Authorization", local_var_value); + }; + if let Some(ref local_var_auth_conf) = local_var_configuration.basic_auth { + local_var_req_builder = local_var_req_builder.basic_auth(local_var_auth_conf.0.to_owned(), local_var_auth_conf.1.to_owned()); + }; + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("Sudo", local_var_value); + }; + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("X-GITEA-OTP", local_var_value); + }; + + let local_var_req = local_var_req_builder.build()?; + let local_var_resp = local_var_client.execute(local_var_req).await?; + + let local_var_status = local_var_resp.status(); + let local_var_content = local_var_resp.text().await?; + + if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + serde_json::from_str(&local_var_content).map_err(Error::from) + } else { + let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); + let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; + Err(Error::ResponseError(local_var_error)) + } +} + +pub async fn issue_get_label(configuration: &configuration::Configuration, owner: &str, repo: &str, id: i64) -> Result> { + let local_var_configuration = configuration; + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!("{}/repos/{owner}/{repo}/labels/{id}", local_var_configuration.base_path, owner=crate::apis::urlencode(owner), repo=crate::apis::urlencode(repo), id=id); + let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str()); + + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.query(&[("access_token", local_var_value)]); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.query(&[("sudo", local_var_value)]); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.query(&[("token", local_var_value)]); + } + if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { + local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("Authorization", local_var_value); + }; + if let Some(ref local_var_auth_conf) = local_var_configuration.basic_auth { + local_var_req_builder = local_var_req_builder.basic_auth(local_var_auth_conf.0.to_owned(), local_var_auth_conf.1.to_owned()); + }; + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("Sudo", local_var_value); + }; + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("X-GITEA-OTP", local_var_value); + }; + + let local_var_req = local_var_req_builder.build()?; + let local_var_resp = local_var_client.execute(local_var_req).await?; + + let local_var_status = local_var_resp.status(); + let local_var_content = local_var_resp.text().await?; + + if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + serde_json::from_str(&local_var_content).map_err(Error::from) + } else { + let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); + let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; + Err(Error::ResponseError(local_var_error)) + } +} + +pub async fn issue_get_labels(configuration: &configuration::Configuration, owner: &str, repo: &str, index: i64) -> Result, Error> { + let local_var_configuration = configuration; + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!("{}/repos/{owner}/{repo}/issues/{index}/labels", local_var_configuration.base_path, owner=crate::apis::urlencode(owner), repo=crate::apis::urlencode(repo), index=index); + let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str()); + + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.query(&[("access_token", local_var_value)]); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.query(&[("sudo", local_var_value)]); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.query(&[("token", local_var_value)]); + } + if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { + local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("Authorization", local_var_value); + }; + if let Some(ref local_var_auth_conf) = local_var_configuration.basic_auth { + local_var_req_builder = local_var_req_builder.basic_auth(local_var_auth_conf.0.to_owned(), local_var_auth_conf.1.to_owned()); + }; + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("Sudo", local_var_value); + }; + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("X-GITEA-OTP", local_var_value); + }; + + let local_var_req = local_var_req_builder.build()?; + let local_var_resp = local_var_client.execute(local_var_req).await?; + + let local_var_status = local_var_resp.status(); + let local_var_content = local_var_resp.text().await?; + + if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + serde_json::from_str(&local_var_content).map_err(Error::from) + } else { + let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); + let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; + Err(Error::ResponseError(local_var_error)) + } +} + +pub async fn issue_get_milestone(configuration: &configuration::Configuration, owner: &str, repo: &str, id: &str) -> Result> { + let local_var_configuration = configuration; + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!("{}/repos/{owner}/{repo}/milestones/{id}", local_var_configuration.base_path, owner=crate::apis::urlencode(owner), repo=crate::apis::urlencode(repo), id=crate::apis::urlencode(id)); + let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str()); + + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.query(&[("access_token", local_var_value)]); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.query(&[("sudo", local_var_value)]); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.query(&[("token", local_var_value)]); + } + if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { + local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("Authorization", local_var_value); + }; + if let Some(ref local_var_auth_conf) = local_var_configuration.basic_auth { + local_var_req_builder = local_var_req_builder.basic_auth(local_var_auth_conf.0.to_owned(), local_var_auth_conf.1.to_owned()); + }; + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("Sudo", local_var_value); + }; + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("X-GITEA-OTP", local_var_value); + }; + + let local_var_req = local_var_req_builder.build()?; + let local_var_resp = local_var_client.execute(local_var_req).await?; + + let local_var_status = local_var_resp.status(); + let local_var_content = local_var_resp.text().await?; + + if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + serde_json::from_str(&local_var_content).map_err(Error::from) + } else { + let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); + let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; + Err(Error::ResponseError(local_var_error)) + } +} + +pub async fn issue_get_milestones_list(configuration: &configuration::Configuration, owner: &str, repo: &str, state: Option<&str>, name: Option<&str>, page: Option, limit: Option) -> Result, Error> { + let local_var_configuration = configuration; + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!("{}/repos/{owner}/{repo}/milestones", local_var_configuration.base_path, owner=crate::apis::urlencode(owner), repo=crate::apis::urlencode(repo)); + let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str()); + + if let Some(ref local_var_str) = state { + local_var_req_builder = local_var_req_builder.query(&[("state", &local_var_str.to_string())]); + } + if let Some(ref local_var_str) = name { + local_var_req_builder = local_var_req_builder.query(&[("name", &local_var_str.to_string())]); + } + if let Some(ref local_var_str) = page { + local_var_req_builder = local_var_req_builder.query(&[("page", &local_var_str.to_string())]); + } + if let Some(ref local_var_str) = limit { + local_var_req_builder = local_var_req_builder.query(&[("limit", &local_var_str.to_string())]); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.query(&[("access_token", local_var_value)]); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.query(&[("sudo", local_var_value)]); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.query(&[("token", local_var_value)]); + } + if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { + local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("Authorization", local_var_value); + }; + if let Some(ref local_var_auth_conf) = local_var_configuration.basic_auth { + local_var_req_builder = local_var_req_builder.basic_auth(local_var_auth_conf.0.to_owned(), local_var_auth_conf.1.to_owned()); + }; + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("Sudo", local_var_value); + }; + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("X-GITEA-OTP", local_var_value); + }; + + let local_var_req = local_var_req_builder.build()?; + let local_var_resp = local_var_client.execute(local_var_req).await?; + + let local_var_status = local_var_resp.status(); + let local_var_content = local_var_resp.text().await?; + + if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + serde_json::from_str(&local_var_content).map_err(Error::from) + } else { + let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); + let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; + Err(Error::ResponseError(local_var_error)) + } +} + +pub async fn issue_get_repo_comments(configuration: &configuration::Configuration, owner: &str, repo: &str, since: Option, before: Option, page: Option, limit: Option) -> Result, Error> { + let local_var_configuration = configuration; + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!("{}/repos/{owner}/{repo}/issues/comments", local_var_configuration.base_path, owner=crate::apis::urlencode(owner), repo=crate::apis::urlencode(repo)); + let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str()); + + if let Some(ref local_var_str) = since { + local_var_req_builder = local_var_req_builder.query(&[("since", &local_var_str.to_string())]); + } + if let Some(ref local_var_str) = before { + local_var_req_builder = local_var_req_builder.query(&[("before", &local_var_str.to_string())]); + } + if let Some(ref local_var_str) = page { + local_var_req_builder = local_var_req_builder.query(&[("page", &local_var_str.to_string())]); + } + if let Some(ref local_var_str) = limit { + local_var_req_builder = local_var_req_builder.query(&[("limit", &local_var_str.to_string())]); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.query(&[("access_token", local_var_value)]); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.query(&[("sudo", local_var_value)]); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.query(&[("token", local_var_value)]); + } + if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { + local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("Authorization", local_var_value); + }; + if let Some(ref local_var_auth_conf) = local_var_configuration.basic_auth { + local_var_req_builder = local_var_req_builder.basic_auth(local_var_auth_conf.0.to_owned(), local_var_auth_conf.1.to_owned()); + }; + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("Sudo", local_var_value); + }; + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("X-GITEA-OTP", local_var_value); + }; + + let local_var_req = local_var_req_builder.build()?; + let local_var_resp = local_var_client.execute(local_var_req).await?; + + let local_var_status = local_var_resp.status(); + let local_var_content = local_var_resp.text().await?; + + if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + serde_json::from_str(&local_var_content).map_err(Error::from) + } else { + let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); + let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; + Err(Error::ResponseError(local_var_error)) + } +} + +pub async fn issue_list_issues(configuration: &configuration::Configuration, owner: &str, repo: &str, state: Option<&str>, labels: Option<&str>, q: Option<&str>, r#type: Option<&str>, milestones: Option<&str>, since: Option, before: Option, created_by: Option<&str>, assigned_by: Option<&str>, mentioned_by: Option<&str>, page: Option, limit: Option) -> Result, Error> { + let local_var_configuration = configuration; + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!("{}/repos/{owner}/{repo}/issues", local_var_configuration.base_path, owner=crate::apis::urlencode(owner), repo=crate::apis::urlencode(repo)); + let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str()); + + if let Some(ref local_var_str) = state { + local_var_req_builder = local_var_req_builder.query(&[("state", &local_var_str.to_string())]); + } + if let Some(ref local_var_str) = labels { + local_var_req_builder = local_var_req_builder.query(&[("labels", &local_var_str.to_string())]); + } + if let Some(ref local_var_str) = q { + local_var_req_builder = local_var_req_builder.query(&[("q", &local_var_str.to_string())]); + } + if let Some(ref local_var_str) = r#type { + local_var_req_builder = local_var_req_builder.query(&[("type", &local_var_str.to_string())]); + } + if let Some(ref local_var_str) = milestones { + local_var_req_builder = local_var_req_builder.query(&[("milestones", &local_var_str.to_string())]); + } + if let Some(ref local_var_str) = since { + local_var_req_builder = local_var_req_builder.query(&[("since", &local_var_str.to_string())]); + } + if let Some(ref local_var_str) = before { + local_var_req_builder = local_var_req_builder.query(&[("before", &local_var_str.to_string())]); + } + if let Some(ref local_var_str) = created_by { + local_var_req_builder = local_var_req_builder.query(&[("created_by", &local_var_str.to_string())]); + } + if let Some(ref local_var_str) = assigned_by { + local_var_req_builder = local_var_req_builder.query(&[("assigned_by", &local_var_str.to_string())]); + } + if let Some(ref local_var_str) = mentioned_by { + local_var_req_builder = local_var_req_builder.query(&[("mentioned_by", &local_var_str.to_string())]); + } + if let Some(ref local_var_str) = page { + local_var_req_builder = local_var_req_builder.query(&[("page", &local_var_str.to_string())]); + } + if let Some(ref local_var_str) = limit { + local_var_req_builder = local_var_req_builder.query(&[("limit", &local_var_str.to_string())]); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.query(&[("access_token", local_var_value)]); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.query(&[("sudo", local_var_value)]); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.query(&[("token", local_var_value)]); + } + if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { + local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("Authorization", local_var_value); + }; + if let Some(ref local_var_auth_conf) = local_var_configuration.basic_auth { + local_var_req_builder = local_var_req_builder.basic_auth(local_var_auth_conf.0.to_owned(), local_var_auth_conf.1.to_owned()); + }; + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("Sudo", local_var_value); + }; + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("X-GITEA-OTP", local_var_value); + }; + + let local_var_req = local_var_req_builder.build()?; + let local_var_resp = local_var_client.execute(local_var_req).await?; + + let local_var_status = local_var_resp.status(); + let local_var_content = local_var_resp.text().await?; + + if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + serde_json::from_str(&local_var_content).map_err(Error::from) + } else { + let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); + let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; + Err(Error::ResponseError(local_var_error)) + } +} + +pub async fn issue_list_labels(configuration: &configuration::Configuration, owner: &str, repo: &str, page: Option, limit: Option) -> Result, Error> { + let local_var_configuration = configuration; + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!("{}/repos/{owner}/{repo}/labels", local_var_configuration.base_path, owner=crate::apis::urlencode(owner), repo=crate::apis::urlencode(repo)); + let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str()); + + if let Some(ref local_var_str) = page { + local_var_req_builder = local_var_req_builder.query(&[("page", &local_var_str.to_string())]); + } + if let Some(ref local_var_str) = limit { + local_var_req_builder = local_var_req_builder.query(&[("limit", &local_var_str.to_string())]); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.query(&[("access_token", local_var_value)]); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.query(&[("sudo", local_var_value)]); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.query(&[("token", local_var_value)]); + } + if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { + local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("Authorization", local_var_value); + }; + if let Some(ref local_var_auth_conf) = local_var_configuration.basic_auth { + local_var_req_builder = local_var_req_builder.basic_auth(local_var_auth_conf.0.to_owned(), local_var_auth_conf.1.to_owned()); + }; + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("Sudo", local_var_value); + }; + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("X-GITEA-OTP", local_var_value); + }; + + let local_var_req = local_var_req_builder.build()?; + let local_var_resp = local_var_client.execute(local_var_req).await?; + + let local_var_status = local_var_resp.status(); + let local_var_content = local_var_resp.text().await?; + + if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + serde_json::from_str(&local_var_content).map_err(Error::from) + } else { + let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); + let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; + Err(Error::ResponseError(local_var_error)) + } +} + +pub async fn issue_post_comment_reaction(configuration: &configuration::Configuration, owner: &str, repo: &str, id: i64, content: Option) -> Result> { + let local_var_configuration = configuration; + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!("{}/repos/{owner}/{repo}/issues/comments/{id}/reactions", local_var_configuration.base_path, owner=crate::apis::urlencode(owner), repo=crate::apis::urlencode(repo), id=id); + let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str()); + + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.query(&[("access_token", local_var_value)]); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.query(&[("sudo", local_var_value)]); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.query(&[("token", local_var_value)]); + } + if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { + local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("Authorization", local_var_value); + }; + if let Some(ref local_var_auth_conf) = local_var_configuration.basic_auth { + local_var_req_builder = local_var_req_builder.basic_auth(local_var_auth_conf.0.to_owned(), local_var_auth_conf.1.to_owned()); + }; + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("Sudo", local_var_value); + }; + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("X-GITEA-OTP", local_var_value); + }; + local_var_req_builder = local_var_req_builder.json(&content); + + let local_var_req = local_var_req_builder.build()?; + let local_var_resp = local_var_client.execute(local_var_req).await?; + + let local_var_status = local_var_resp.status(); + let local_var_content = local_var_resp.text().await?; + + if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + serde_json::from_str(&local_var_content).map_err(Error::from) + } else { + let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); + let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; + Err(Error::ResponseError(local_var_error)) + } +} + +pub async fn issue_post_issue_reaction(configuration: &configuration::Configuration, owner: &str, repo: &str, index: i64, content: Option) -> Result> { + let local_var_configuration = configuration; + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!("{}/repos/{owner}/{repo}/issues/{index}/reactions", local_var_configuration.base_path, owner=crate::apis::urlencode(owner), repo=crate::apis::urlencode(repo), index=index); + let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str()); + + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.query(&[("access_token", local_var_value)]); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.query(&[("sudo", local_var_value)]); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.query(&[("token", local_var_value)]); + } + if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { + local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("Authorization", local_var_value); + }; + if let Some(ref local_var_auth_conf) = local_var_configuration.basic_auth { + local_var_req_builder = local_var_req_builder.basic_auth(local_var_auth_conf.0.to_owned(), local_var_auth_conf.1.to_owned()); + }; + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("Sudo", local_var_value); + }; + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("X-GITEA-OTP", local_var_value); + }; + local_var_req_builder = local_var_req_builder.json(&content); + + let local_var_req = local_var_req_builder.build()?; + let local_var_resp = local_var_client.execute(local_var_req).await?; + + let local_var_status = local_var_resp.status(); + let local_var_content = local_var_resp.text().await?; + + if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + serde_json::from_str(&local_var_content).map_err(Error::from) + } else { + let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); + let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; + Err(Error::ResponseError(local_var_error)) + } +} + +pub async fn issue_remove_label(configuration: &configuration::Configuration, owner: &str, repo: &str, index: i64, id: i64) -> Result<(), Error> { + let local_var_configuration = configuration; + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!("{}/repos/{owner}/{repo}/issues/{index}/labels/{id}", local_var_configuration.base_path, owner=crate::apis::urlencode(owner), repo=crate::apis::urlencode(repo), index=index, id=id); + let mut local_var_req_builder = local_var_client.request(reqwest::Method::DELETE, local_var_uri_str.as_str()); + + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.query(&[("access_token", local_var_value)]); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.query(&[("sudo", local_var_value)]); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.query(&[("token", local_var_value)]); + } + if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { + local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("Authorization", local_var_value); + }; + if let Some(ref local_var_auth_conf) = local_var_configuration.basic_auth { + local_var_req_builder = local_var_req_builder.basic_auth(local_var_auth_conf.0.to_owned(), local_var_auth_conf.1.to_owned()); + }; + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("Sudo", local_var_value); + }; + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("X-GITEA-OTP", local_var_value); + }; + + let local_var_req = local_var_req_builder.build()?; + let local_var_resp = local_var_client.execute(local_var_req).await?; + + let local_var_status = local_var_resp.status(); + let local_var_content = local_var_resp.text().await?; + + if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + Ok(()) + } else { + let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); + let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; + Err(Error::ResponseError(local_var_error)) + } +} + +pub async fn issue_replace_labels(configuration: &configuration::Configuration, owner: &str, repo: &str, index: i64, body: Option) -> Result, Error> { + let local_var_configuration = configuration; + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!("{}/repos/{owner}/{repo}/issues/{index}/labels", local_var_configuration.base_path, owner=crate::apis::urlencode(owner), repo=crate::apis::urlencode(repo), index=index); + let mut local_var_req_builder = local_var_client.request(reqwest::Method::PUT, local_var_uri_str.as_str()); + + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.query(&[("access_token", local_var_value)]); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.query(&[("sudo", local_var_value)]); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.query(&[("token", local_var_value)]); + } + if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { + local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("Authorization", local_var_value); + }; + if let Some(ref local_var_auth_conf) = local_var_configuration.basic_auth { + local_var_req_builder = local_var_req_builder.basic_auth(local_var_auth_conf.0.to_owned(), local_var_auth_conf.1.to_owned()); + }; + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("Sudo", local_var_value); + }; + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("X-GITEA-OTP", local_var_value); + }; + local_var_req_builder = local_var_req_builder.json(&body); + + let local_var_req = local_var_req_builder.build()?; + let local_var_resp = local_var_client.execute(local_var_req).await?; + + let local_var_status = local_var_resp.status(); + let local_var_content = local_var_resp.text().await?; + + if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + serde_json::from_str(&local_var_content).map_err(Error::from) + } else { + let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); + let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; + Err(Error::ResponseError(local_var_error)) + } +} + +pub async fn issue_reset_time(configuration: &configuration::Configuration, owner: &str, repo: &str, index: i64) -> Result<(), Error> { + let local_var_configuration = configuration; + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!("{}/repos/{owner}/{repo}/issues/{index}/times", local_var_configuration.base_path, owner=crate::apis::urlencode(owner), repo=crate::apis::urlencode(repo), index=index); + let mut local_var_req_builder = local_var_client.request(reqwest::Method::DELETE, local_var_uri_str.as_str()); + + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.query(&[("access_token", local_var_value)]); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.query(&[("sudo", local_var_value)]); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.query(&[("token", local_var_value)]); + } + if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { + local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("Authorization", local_var_value); + }; + if let Some(ref local_var_auth_conf) = local_var_configuration.basic_auth { + local_var_req_builder = local_var_req_builder.basic_auth(local_var_auth_conf.0.to_owned(), local_var_auth_conf.1.to_owned()); + }; + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("Sudo", local_var_value); + }; + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("X-GITEA-OTP", local_var_value); + }; + + let local_var_req = local_var_req_builder.build()?; + let local_var_resp = local_var_client.execute(local_var_req).await?; + + let local_var_status = local_var_resp.status(); + let local_var_content = local_var_resp.text().await?; + + if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + Ok(()) + } else { + let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); + let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; + Err(Error::ResponseError(local_var_error)) + } +} + +pub async fn issue_search_issues(configuration: &configuration::Configuration, state: Option<&str>, labels: Option<&str>, milestones: Option<&str>, q: Option<&str>, priority_repo_id: Option, r#type: Option<&str>, since: Option, before: Option, assigned: Option, created: Option, mentioned: Option, review_requested: Option, owner: Option<&str>, team: Option<&str>, page: Option, limit: Option) -> Result, Error> { + let local_var_configuration = configuration; + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!("{}/repos/issues/search", local_var_configuration.base_path); + let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str()); + + if let Some(ref local_var_str) = state { + local_var_req_builder = local_var_req_builder.query(&[("state", &local_var_str.to_string())]); + } + if let Some(ref local_var_str) = labels { + local_var_req_builder = local_var_req_builder.query(&[("labels", &local_var_str.to_string())]); + } + if let Some(ref local_var_str) = milestones { + local_var_req_builder = local_var_req_builder.query(&[("milestones", &local_var_str.to_string())]); + } + if let Some(ref local_var_str) = q { + local_var_req_builder = local_var_req_builder.query(&[("q", &local_var_str.to_string())]); + } + if let Some(ref local_var_str) = priority_repo_id { + local_var_req_builder = local_var_req_builder.query(&[("priority_repo_id", &local_var_str.to_string())]); + } + if let Some(ref local_var_str) = r#type { + local_var_req_builder = local_var_req_builder.query(&[("type", &local_var_str.to_string())]); + } + if let Some(ref local_var_str) = since { + local_var_req_builder = local_var_req_builder.query(&[("since", &local_var_str.to_string())]); + } + if let Some(ref local_var_str) = before { + local_var_req_builder = local_var_req_builder.query(&[("before", &local_var_str.to_string())]); + } + if let Some(ref local_var_str) = assigned { + local_var_req_builder = local_var_req_builder.query(&[("assigned", &local_var_str.to_string())]); + } + if let Some(ref local_var_str) = created { + local_var_req_builder = local_var_req_builder.query(&[("created", &local_var_str.to_string())]); + } + if let Some(ref local_var_str) = mentioned { + local_var_req_builder = local_var_req_builder.query(&[("mentioned", &local_var_str.to_string())]); + } + if let Some(ref local_var_str) = review_requested { + local_var_req_builder = local_var_req_builder.query(&[("review_requested", &local_var_str.to_string())]); + } + if let Some(ref local_var_str) = owner { + local_var_req_builder = local_var_req_builder.query(&[("owner", &local_var_str.to_string())]); + } + if let Some(ref local_var_str) = team { + local_var_req_builder = local_var_req_builder.query(&[("team", &local_var_str.to_string())]); + } + if let Some(ref local_var_str) = page { + local_var_req_builder = local_var_req_builder.query(&[("page", &local_var_str.to_string())]); + } + if let Some(ref local_var_str) = limit { + local_var_req_builder = local_var_req_builder.query(&[("limit", &local_var_str.to_string())]); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.query(&[("access_token", local_var_value)]); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.query(&[("sudo", local_var_value)]); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.query(&[("token", local_var_value)]); + } + if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { + local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("Authorization", local_var_value); + }; + if let Some(ref local_var_auth_conf) = local_var_configuration.basic_auth { + local_var_req_builder = local_var_req_builder.basic_auth(local_var_auth_conf.0.to_owned(), local_var_auth_conf.1.to_owned()); + }; + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("Sudo", local_var_value); + }; + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("X-GITEA-OTP", local_var_value); + }; + + let local_var_req = local_var_req_builder.build()?; + let local_var_resp = local_var_client.execute(local_var_req).await?; + + let local_var_status = local_var_resp.status(); + let local_var_content = local_var_resp.text().await?; + + if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + serde_json::from_str(&local_var_content).map_err(Error::from) + } else { + let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); + let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; + Err(Error::ResponseError(local_var_error)) + } +} + +pub async fn issue_start_stop_watch(configuration: &configuration::Configuration, owner: &str, repo: &str, index: i64) -> Result<(), Error> { + let local_var_configuration = configuration; + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!("{}/repos/{owner}/{repo}/issues/{index}/stopwatch/start", local_var_configuration.base_path, owner=crate::apis::urlencode(owner), repo=crate::apis::urlencode(repo), index=index); + let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str()); + + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.query(&[("access_token", local_var_value)]); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.query(&[("sudo", local_var_value)]); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.query(&[("token", local_var_value)]); + } + if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { + local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("Authorization", local_var_value); + }; + if let Some(ref local_var_auth_conf) = local_var_configuration.basic_auth { + local_var_req_builder = local_var_req_builder.basic_auth(local_var_auth_conf.0.to_owned(), local_var_auth_conf.1.to_owned()); + }; + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("Sudo", local_var_value); + }; + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("X-GITEA-OTP", local_var_value); + }; + + let local_var_req = local_var_req_builder.build()?; + let local_var_resp = local_var_client.execute(local_var_req).await?; + + let local_var_status = local_var_resp.status(); + let local_var_content = local_var_resp.text().await?; + + if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + Ok(()) + } else { + let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); + let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; + Err(Error::ResponseError(local_var_error)) + } +} + +pub async fn issue_stop_stop_watch(configuration: &configuration::Configuration, owner: &str, repo: &str, index: i64) -> Result<(), Error> { + let local_var_configuration = configuration; + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!("{}/repos/{owner}/{repo}/issues/{index}/stopwatch/stop", local_var_configuration.base_path, owner=crate::apis::urlencode(owner), repo=crate::apis::urlencode(repo), index=index); + let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str()); + + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.query(&[("access_token", local_var_value)]); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.query(&[("sudo", local_var_value)]); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.query(&[("token", local_var_value)]); + } + if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { + local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("Authorization", local_var_value); + }; + if let Some(ref local_var_auth_conf) = local_var_configuration.basic_auth { + local_var_req_builder = local_var_req_builder.basic_auth(local_var_auth_conf.0.to_owned(), local_var_auth_conf.1.to_owned()); + }; + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("Sudo", local_var_value); + }; + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("X-GITEA-OTP", local_var_value); + }; + + let local_var_req = local_var_req_builder.build()?; + let local_var_resp = local_var_client.execute(local_var_req).await?; + + let local_var_status = local_var_resp.status(); + let local_var_content = local_var_resp.text().await?; + + if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + Ok(()) + } else { + let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); + let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; + Err(Error::ResponseError(local_var_error)) + } +} + +pub async fn issue_subscriptions(configuration: &configuration::Configuration, owner: &str, repo: &str, index: i64, page: Option, limit: Option) -> Result, Error> { + let local_var_configuration = configuration; + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!("{}/repos/{owner}/{repo}/issues/{index}/subscriptions", local_var_configuration.base_path, owner=crate::apis::urlencode(owner), repo=crate::apis::urlencode(repo), index=index); + let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str()); + + if let Some(ref local_var_str) = page { + local_var_req_builder = local_var_req_builder.query(&[("page", &local_var_str.to_string())]); + } + if let Some(ref local_var_str) = limit { + local_var_req_builder = local_var_req_builder.query(&[("limit", &local_var_str.to_string())]); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.query(&[("access_token", local_var_value)]); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.query(&[("sudo", local_var_value)]); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.query(&[("token", local_var_value)]); + } + if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { + local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("Authorization", local_var_value); + }; + if let Some(ref local_var_auth_conf) = local_var_configuration.basic_auth { + local_var_req_builder = local_var_req_builder.basic_auth(local_var_auth_conf.0.to_owned(), local_var_auth_conf.1.to_owned()); + }; + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("Sudo", local_var_value); + }; + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("X-GITEA-OTP", local_var_value); + }; + + let local_var_req = local_var_req_builder.build()?; + let local_var_resp = local_var_client.execute(local_var_req).await?; + + let local_var_status = local_var_resp.status(); + let local_var_content = local_var_resp.text().await?; + + if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + serde_json::from_str(&local_var_content).map_err(Error::from) + } else { + let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); + let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; + Err(Error::ResponseError(local_var_error)) + } +} + +pub async fn issue_tracked_times(configuration: &configuration::Configuration, owner: &str, repo: &str, index: i64, user: Option<&str>, since: Option, before: Option, page: Option, limit: Option) -> Result, Error> { + let local_var_configuration = configuration; + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!("{}/repos/{owner}/{repo}/issues/{index}/times", local_var_configuration.base_path, owner=crate::apis::urlencode(owner), repo=crate::apis::urlencode(repo), index=index); + let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str()); + + if let Some(ref local_var_str) = user { + local_var_req_builder = local_var_req_builder.query(&[("user", &local_var_str.to_string())]); + } + if let Some(ref local_var_str) = since { + local_var_req_builder = local_var_req_builder.query(&[("since", &local_var_str.to_string())]); + } + if let Some(ref local_var_str) = before { + local_var_req_builder = local_var_req_builder.query(&[("before", &local_var_str.to_string())]); + } + if let Some(ref local_var_str) = page { + local_var_req_builder = local_var_req_builder.query(&[("page", &local_var_str.to_string())]); + } + if let Some(ref local_var_str) = limit { + local_var_req_builder = local_var_req_builder.query(&[("limit", &local_var_str.to_string())]); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.query(&[("access_token", local_var_value)]); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.query(&[("sudo", local_var_value)]); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.query(&[("token", local_var_value)]); + } + if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { + local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("Authorization", local_var_value); + }; + if let Some(ref local_var_auth_conf) = local_var_configuration.basic_auth { + local_var_req_builder = local_var_req_builder.basic_auth(local_var_auth_conf.0.to_owned(), local_var_auth_conf.1.to_owned()); + }; + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("Sudo", local_var_value); + }; + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("X-GITEA-OTP", local_var_value); + }; + + let local_var_req = local_var_req_builder.build()?; + let local_var_resp = local_var_client.execute(local_var_req).await?; + + let local_var_status = local_var_resp.status(); + let local_var_content = local_var_resp.text().await?; + + if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + serde_json::from_str(&local_var_content).map_err(Error::from) + } else { + let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); + let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; + Err(Error::ResponseError(local_var_error)) + } +} + diff --git a/crates/gitea_raw_client/src/apis/miscellaneous_api.rs b/crates/gitea_raw_client/src/apis/miscellaneous_api.rs new file mode 100644 index 0000000..afd93eb --- /dev/null +++ b/crates/gitea_raw_client/src/apis/miscellaneous_api.rs @@ -0,0 +1,447 @@ +/* + * Gitea API. + * + * This documentation describes the Gitea API. + * + * The version of the OpenAPI document: 1.17.3 + * + * Generated by: https://openapi-generator.tech + */ + + +use reqwest; + +use crate::apis::ResponseContent; +use super::{Error, configuration}; + + +/// struct for typed errors of method [`get_node_info`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum GetNodeInfoError { + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`get_signing_key`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum GetSigningKeyError { + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`get_version`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum GetVersionError { + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`render_markdown`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum RenderMarkdownError { + Status422(), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`render_markdown_raw`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum RenderMarkdownRawError { + Status422(), + UnknownValue(serde_json::Value), +} + + +pub async fn get_node_info(configuration: &configuration::Configuration, ) -> Result> { + let local_var_configuration = configuration; + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!("{}/nodeinfo", local_var_configuration.base_path); + let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str()); + + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.query(&[("access_token", local_var_value)]); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.query(&[("sudo", local_var_value)]); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.query(&[("token", local_var_value)]); + } + if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { + local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("Authorization", local_var_value); + }; + if let Some(ref local_var_auth_conf) = local_var_configuration.basic_auth { + local_var_req_builder = local_var_req_builder.basic_auth(local_var_auth_conf.0.to_owned(), local_var_auth_conf.1.to_owned()); + }; + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("Sudo", local_var_value); + }; + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("X-GITEA-OTP", local_var_value); + }; + + let local_var_req = local_var_req_builder.build()?; + let local_var_resp = local_var_client.execute(local_var_req).await?; + + let local_var_status = local_var_resp.status(); + let local_var_content = local_var_resp.text().await?; + + if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + serde_json::from_str(&local_var_content).map_err(Error::from) + } else { + let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); + let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; + Err(Error::ResponseError(local_var_error)) + } +} + +pub async fn get_signing_key(configuration: &configuration::Configuration, ) -> Result> { + let local_var_configuration = configuration; + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!("{}/signing-key.gpg", local_var_configuration.base_path); + let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str()); + + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.query(&[("access_token", local_var_value)]); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.query(&[("sudo", local_var_value)]); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.query(&[("token", local_var_value)]); + } + if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { + local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("Authorization", local_var_value); + }; + if let Some(ref local_var_auth_conf) = local_var_configuration.basic_auth { + local_var_req_builder = local_var_req_builder.basic_auth(local_var_auth_conf.0.to_owned(), local_var_auth_conf.1.to_owned()); + }; + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("Sudo", local_var_value); + }; + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("X-GITEA-OTP", local_var_value); + }; + + let local_var_req = local_var_req_builder.build()?; + let local_var_resp = local_var_client.execute(local_var_req).await?; + + let local_var_status = local_var_resp.status(); + let local_var_content = local_var_resp.text().await?; + + if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + serde_json::from_str(&local_var_content).map_err(Error::from) + } else { + let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); + let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; + Err(Error::ResponseError(local_var_error)) + } +} + +pub async fn get_version(configuration: &configuration::Configuration, ) -> Result> { + let local_var_configuration = configuration; + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!("{}/version", local_var_configuration.base_path); + let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str()); + + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.query(&[("access_token", local_var_value)]); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.query(&[("sudo", local_var_value)]); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.query(&[("token", local_var_value)]); + } + if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { + local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("Authorization", local_var_value); + }; + if let Some(ref local_var_auth_conf) = local_var_configuration.basic_auth { + local_var_req_builder = local_var_req_builder.basic_auth(local_var_auth_conf.0.to_owned(), local_var_auth_conf.1.to_owned()); + }; + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("Sudo", local_var_value); + }; + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("X-GITEA-OTP", local_var_value); + }; + + let local_var_req = local_var_req_builder.build()?; + let local_var_resp = local_var_client.execute(local_var_req).await?; + + let local_var_status = local_var_resp.status(); + let local_var_content = local_var_resp.text().await?; + + if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + serde_json::from_str(&local_var_content).map_err(Error::from) + } else { + let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); + let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; + Err(Error::ResponseError(local_var_error)) + } +} + +pub async fn render_markdown(configuration: &configuration::Configuration, body: Option) -> Result> { + let local_var_configuration = configuration; + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!("{}/markdown", local_var_configuration.base_path); + let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str()); + + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.query(&[("access_token", local_var_value)]); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.query(&[("sudo", local_var_value)]); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.query(&[("token", local_var_value)]); + } + if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { + local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("Authorization", local_var_value); + }; + if let Some(ref local_var_auth_conf) = local_var_configuration.basic_auth { + local_var_req_builder = local_var_req_builder.basic_auth(local_var_auth_conf.0.to_owned(), local_var_auth_conf.1.to_owned()); + }; + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("Sudo", local_var_value); + }; + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("X-GITEA-OTP", local_var_value); + }; + local_var_req_builder = local_var_req_builder.json(&body); + + let local_var_req = local_var_req_builder.build()?; + let local_var_resp = local_var_client.execute(local_var_req).await?; + + let local_var_status = local_var_resp.status(); + let local_var_content = local_var_resp.text().await?; + + if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + serde_json::from_str(&local_var_content).map_err(Error::from) + } else { + let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); + let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; + Err(Error::ResponseError(local_var_error)) + } +} + +pub async fn render_markdown_raw(configuration: &configuration::Configuration, body: &str) -> Result> { + let local_var_configuration = configuration; + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!("{}/markdown/raw", local_var_configuration.base_path); + let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str()); + + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.query(&[("access_token", local_var_value)]); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.query(&[("sudo", local_var_value)]); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.query(&[("token", local_var_value)]); + } + if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { + local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("Authorization", local_var_value); + }; + if let Some(ref local_var_auth_conf) = local_var_configuration.basic_auth { + local_var_req_builder = local_var_req_builder.basic_auth(local_var_auth_conf.0.to_owned(), local_var_auth_conf.1.to_owned()); + }; + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("Sudo", local_var_value); + }; + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("X-GITEA-OTP", local_var_value); + }; + local_var_req_builder = local_var_req_builder.json(&body); + + let local_var_req = local_var_req_builder.build()?; + let local_var_resp = local_var_client.execute(local_var_req).await?; + + let local_var_status = local_var_resp.status(); + let local_var_content = local_var_resp.text().await?; + + if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + serde_json::from_str(&local_var_content).map_err(Error::from) + } else { + let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); + let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; + Err(Error::ResponseError(local_var_error)) + } +} + diff --git a/crates/gitea_raw_client/src/apis/mod.rs b/crates/gitea_raw_client/src/apis/mod.rs new file mode 100644 index 0000000..6707af8 --- /dev/null +++ b/crates/gitea_raw_client/src/apis/mod.rs @@ -0,0 +1,74 @@ +use std::error; +use std::fmt; + +#[derive(Debug, Clone)] +pub struct ResponseContent { + pub status: reqwest::StatusCode, + pub content: String, + pub entity: Option, +} + +#[derive(Debug)] +pub enum Error { + Reqwest(reqwest::Error), + Serde(serde_json::Error), + Io(std::io::Error), + ResponseError(ResponseContent), +} + +impl fmt::Display for Error { + fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { + let (module, e) = match self { + Error::Reqwest(e) => ("reqwest", e.to_string()), + Error::Serde(e) => ("serde", e.to_string()), + Error::Io(e) => ("IO", e.to_string()), + Error::ResponseError(e) => ("response", format!("status code {}", e.status)), + }; + write!(f, "error in {}: {}", module, e) + } +} + +impl error::Error for Error { + fn source(&self) -> Option<&(dyn error::Error + 'static)> { + Some(match self { + Error::Reqwest(e) => e, + Error::Serde(e) => e, + Error::Io(e) => e, + Error::ResponseError(_) => return None, + }) + } +} + +impl From for Error { + fn from(e: reqwest::Error) -> Self { + Error::Reqwest(e) + } +} + +impl From for Error { + fn from(e: serde_json::Error) -> Self { + Error::Serde(e) + } +} + +impl From for Error { + fn from(e: std::io::Error) -> Self { + Error::Io(e) + } +} + +pub fn urlencode>(s: T) -> String { + ::url::form_urlencoded::byte_serialize(s.as_ref().as_bytes()).collect() +} + +pub mod admin_api; +pub mod issue_api; +pub mod miscellaneous_api; +pub mod notification_api; +pub mod organization_api; +pub mod package_api; +pub mod repository_api; +pub mod settings_api; +pub mod user_api; + +pub mod configuration; diff --git a/crates/gitea_raw_client/src/apis/notification_api.rs b/crates/gitea_raw_client/src/apis/notification_api.rs new file mode 100644 index 0000000..2748740 --- /dev/null +++ b/crates/gitea_raw_client/src/apis/notification_api.rs @@ -0,0 +1,704 @@ +/* + * Gitea API. + * + * This documentation describes the Gitea API. + * + * The version of the OpenAPI document: 1.17.3 + * + * Generated by: https://openapi-generator.tech + */ + + +use reqwest; + +use crate::apis::ResponseContent; +use super::{Error, configuration}; + + +/// struct for typed errors of method [`notify_get_list`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum NotifyGetListError { + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`notify_get_repo_list`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum NotifyGetRepoListError { + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`notify_get_thread`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum NotifyGetThreadError { + Status403(), + Status404(), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`notify_new_available`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum NotifyNewAvailableError { + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`notify_read_list`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum NotifyReadListError { + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`notify_read_repo_list`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum NotifyReadRepoListError { + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`notify_read_thread`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum NotifyReadThreadError { + Status403(), + Status404(), + UnknownValue(serde_json::Value), +} + + +pub async fn notify_get_list(configuration: &configuration::Configuration, all: Option, status_types: Option>, subject_type: Option>, since: Option, before: Option, page: Option, limit: Option) -> Result, Error> { + let local_var_configuration = configuration; + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!("{}/notifications", local_var_configuration.base_path); + let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str()); + + if let Some(ref local_var_str) = all { + local_var_req_builder = local_var_req_builder.query(&[("all", &local_var_str.to_string())]); + } + if let Some(ref local_var_str) = status_types { + local_var_req_builder = match "multi" { + "multi" => local_var_req_builder.query(&local_var_str.into_iter().map(|p| ("status-types".to_owned(), p.to_string())).collect::>()), + _ => local_var_req_builder.query(&[("status-types", &local_var_str.into_iter().map(|p| p.to_string()).collect::>().join(",").to_string())]), + }; + } + if let Some(ref local_var_str) = subject_type { + local_var_req_builder = match "multi" { + "multi" => local_var_req_builder.query(&local_var_str.into_iter().map(|p| ("subject-type".to_owned(), p.to_string())).collect::>()), + _ => local_var_req_builder.query(&[("subject-type", &local_var_str.into_iter().map(|p| p.to_string()).collect::>().join(",").to_string())]), + }; + } + if let Some(ref local_var_str) = since { + local_var_req_builder = local_var_req_builder.query(&[("since", &local_var_str.to_string())]); + } + if let Some(ref local_var_str) = before { + local_var_req_builder = local_var_req_builder.query(&[("before", &local_var_str.to_string())]); + } + if let Some(ref local_var_str) = page { + local_var_req_builder = local_var_req_builder.query(&[("page", &local_var_str.to_string())]); + } + if let Some(ref local_var_str) = limit { + local_var_req_builder = local_var_req_builder.query(&[("limit", &local_var_str.to_string())]); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.query(&[("access_token", local_var_value)]); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.query(&[("sudo", local_var_value)]); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.query(&[("token", local_var_value)]); + } + if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { + local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("Authorization", local_var_value); + }; + if let Some(ref local_var_auth_conf) = local_var_configuration.basic_auth { + local_var_req_builder = local_var_req_builder.basic_auth(local_var_auth_conf.0.to_owned(), local_var_auth_conf.1.to_owned()); + }; + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("Sudo", local_var_value); + }; + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("X-GITEA-OTP", local_var_value); + }; + + let local_var_req = local_var_req_builder.build()?; + let local_var_resp = local_var_client.execute(local_var_req).await?; + + let local_var_status = local_var_resp.status(); + let local_var_content = local_var_resp.text().await?; + + if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + serde_json::from_str(&local_var_content).map_err(Error::from) + } else { + let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); + let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; + Err(Error::ResponseError(local_var_error)) + } +} + +pub async fn notify_get_repo_list(configuration: &configuration::Configuration, owner: &str, repo: &str, all: Option, status_types: Option>, subject_type: Option>, since: Option, before: Option, page: Option, limit: Option) -> Result, Error> { + let local_var_configuration = configuration; + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!("{}/repos/{owner}/{repo}/notifications", local_var_configuration.base_path, owner=crate::apis::urlencode(owner), repo=crate::apis::urlencode(repo)); + let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str()); + + if let Some(ref local_var_str) = all { + local_var_req_builder = local_var_req_builder.query(&[("all", &local_var_str.to_string())]); + } + if let Some(ref local_var_str) = status_types { + local_var_req_builder = match "multi" { + "multi" => local_var_req_builder.query(&local_var_str.into_iter().map(|p| ("status-types".to_owned(), p.to_string())).collect::>()), + _ => local_var_req_builder.query(&[("status-types", &local_var_str.into_iter().map(|p| p.to_string()).collect::>().join(",").to_string())]), + }; + } + if let Some(ref local_var_str) = subject_type { + local_var_req_builder = match "multi" { + "multi" => local_var_req_builder.query(&local_var_str.into_iter().map(|p| ("subject-type".to_owned(), p.to_string())).collect::>()), + _ => local_var_req_builder.query(&[("subject-type", &local_var_str.into_iter().map(|p| p.to_string()).collect::>().join(",").to_string())]), + }; + } + if let Some(ref local_var_str) = since { + local_var_req_builder = local_var_req_builder.query(&[("since", &local_var_str.to_string())]); + } + if let Some(ref local_var_str) = before { + local_var_req_builder = local_var_req_builder.query(&[("before", &local_var_str.to_string())]); + } + if let Some(ref local_var_str) = page { + local_var_req_builder = local_var_req_builder.query(&[("page", &local_var_str.to_string())]); + } + if let Some(ref local_var_str) = limit { + local_var_req_builder = local_var_req_builder.query(&[("limit", &local_var_str.to_string())]); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.query(&[("access_token", local_var_value)]); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.query(&[("sudo", local_var_value)]); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.query(&[("token", local_var_value)]); + } + if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { + local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("Authorization", local_var_value); + }; + if let Some(ref local_var_auth_conf) = local_var_configuration.basic_auth { + local_var_req_builder = local_var_req_builder.basic_auth(local_var_auth_conf.0.to_owned(), local_var_auth_conf.1.to_owned()); + }; + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("Sudo", local_var_value); + }; + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("X-GITEA-OTP", local_var_value); + }; + + let local_var_req = local_var_req_builder.build()?; + let local_var_resp = local_var_client.execute(local_var_req).await?; + + let local_var_status = local_var_resp.status(); + let local_var_content = local_var_resp.text().await?; + + if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + serde_json::from_str(&local_var_content).map_err(Error::from) + } else { + let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); + let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; + Err(Error::ResponseError(local_var_error)) + } +} + +pub async fn notify_get_thread(configuration: &configuration::Configuration, id: &str) -> Result> { + let local_var_configuration = configuration; + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!("{}/notifications/threads/{id}", local_var_configuration.base_path, id=crate::apis::urlencode(id)); + let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str()); + + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.query(&[("access_token", local_var_value)]); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.query(&[("sudo", local_var_value)]); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.query(&[("token", local_var_value)]); + } + if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { + local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("Authorization", local_var_value); + }; + if let Some(ref local_var_auth_conf) = local_var_configuration.basic_auth { + local_var_req_builder = local_var_req_builder.basic_auth(local_var_auth_conf.0.to_owned(), local_var_auth_conf.1.to_owned()); + }; + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("Sudo", local_var_value); + }; + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("X-GITEA-OTP", local_var_value); + }; + + let local_var_req = local_var_req_builder.build()?; + let local_var_resp = local_var_client.execute(local_var_req).await?; + + let local_var_status = local_var_resp.status(); + let local_var_content = local_var_resp.text().await?; + + if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + serde_json::from_str(&local_var_content).map_err(Error::from) + } else { + let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); + let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; + Err(Error::ResponseError(local_var_error)) + } +} + +pub async fn notify_new_available(configuration: &configuration::Configuration, ) -> Result> { + let local_var_configuration = configuration; + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!("{}/notifications/new", local_var_configuration.base_path); + let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str()); + + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.query(&[("access_token", local_var_value)]); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.query(&[("sudo", local_var_value)]); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.query(&[("token", local_var_value)]); + } + if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { + local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("Authorization", local_var_value); + }; + if let Some(ref local_var_auth_conf) = local_var_configuration.basic_auth { + local_var_req_builder = local_var_req_builder.basic_auth(local_var_auth_conf.0.to_owned(), local_var_auth_conf.1.to_owned()); + }; + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("Sudo", local_var_value); + }; + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("X-GITEA-OTP", local_var_value); + }; + + let local_var_req = local_var_req_builder.build()?; + let local_var_resp = local_var_client.execute(local_var_req).await?; + + let local_var_status = local_var_resp.status(); + let local_var_content = local_var_resp.text().await?; + + if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + serde_json::from_str(&local_var_content).map_err(Error::from) + } else { + let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); + let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; + Err(Error::ResponseError(local_var_error)) + } +} + +pub async fn notify_read_list(configuration: &configuration::Configuration, last_read_at: Option, all: Option<&str>, status_types: Option>, to_status: Option<&str>) -> Result, Error> { + let local_var_configuration = configuration; + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!("{}/notifications", local_var_configuration.base_path); + let mut local_var_req_builder = local_var_client.request(reqwest::Method::PUT, local_var_uri_str.as_str()); + + if let Some(ref local_var_str) = last_read_at { + local_var_req_builder = local_var_req_builder.query(&[("last_read_at", &local_var_str.to_string())]); + } + if let Some(ref local_var_str) = all { + local_var_req_builder = local_var_req_builder.query(&[("all", &local_var_str.to_string())]); + } + if let Some(ref local_var_str) = status_types { + local_var_req_builder = match "multi" { + "multi" => local_var_req_builder.query(&local_var_str.into_iter().map(|p| ("status-types".to_owned(), p.to_string())).collect::>()), + _ => local_var_req_builder.query(&[("status-types", &local_var_str.into_iter().map(|p| p.to_string()).collect::>().join(",").to_string())]), + }; + } + if let Some(ref local_var_str) = to_status { + local_var_req_builder = local_var_req_builder.query(&[("to-status", &local_var_str.to_string())]); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.query(&[("access_token", local_var_value)]); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.query(&[("sudo", local_var_value)]); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.query(&[("token", local_var_value)]); + } + if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { + local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("Authorization", local_var_value); + }; + if let Some(ref local_var_auth_conf) = local_var_configuration.basic_auth { + local_var_req_builder = local_var_req_builder.basic_auth(local_var_auth_conf.0.to_owned(), local_var_auth_conf.1.to_owned()); + }; + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("Sudo", local_var_value); + }; + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("X-GITEA-OTP", local_var_value); + }; + + let local_var_req = local_var_req_builder.build()?; + let local_var_resp = local_var_client.execute(local_var_req).await?; + + let local_var_status = local_var_resp.status(); + let local_var_content = local_var_resp.text().await?; + + if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + serde_json::from_str(&local_var_content).map_err(Error::from) + } else { + let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); + let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; + Err(Error::ResponseError(local_var_error)) + } +} + +pub async fn notify_read_repo_list(configuration: &configuration::Configuration, owner: &str, repo: &str, all: Option<&str>, status_types: Option>, to_status: Option<&str>, last_read_at: Option) -> Result, Error> { + let local_var_configuration = configuration; + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!("{}/repos/{owner}/{repo}/notifications", local_var_configuration.base_path, owner=crate::apis::urlencode(owner), repo=crate::apis::urlencode(repo)); + let mut local_var_req_builder = local_var_client.request(reqwest::Method::PUT, local_var_uri_str.as_str()); + + if let Some(ref local_var_str) = all { + local_var_req_builder = local_var_req_builder.query(&[("all", &local_var_str.to_string())]); + } + if let Some(ref local_var_str) = status_types { + local_var_req_builder = match "multi" { + "multi" => local_var_req_builder.query(&local_var_str.into_iter().map(|p| ("status-types".to_owned(), p.to_string())).collect::>()), + _ => local_var_req_builder.query(&[("status-types", &local_var_str.into_iter().map(|p| p.to_string()).collect::>().join(",").to_string())]), + }; + } + if let Some(ref local_var_str) = to_status { + local_var_req_builder = local_var_req_builder.query(&[("to-status", &local_var_str.to_string())]); + } + if let Some(ref local_var_str) = last_read_at { + local_var_req_builder = local_var_req_builder.query(&[("last_read_at", &local_var_str.to_string())]); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.query(&[("access_token", local_var_value)]); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.query(&[("sudo", local_var_value)]); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.query(&[("token", local_var_value)]); + } + if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { + local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("Authorization", local_var_value); + }; + if let Some(ref local_var_auth_conf) = local_var_configuration.basic_auth { + local_var_req_builder = local_var_req_builder.basic_auth(local_var_auth_conf.0.to_owned(), local_var_auth_conf.1.to_owned()); + }; + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("Sudo", local_var_value); + }; + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("X-GITEA-OTP", local_var_value); + }; + + let local_var_req = local_var_req_builder.build()?; + let local_var_resp = local_var_client.execute(local_var_req).await?; + + let local_var_status = local_var_resp.status(); + let local_var_content = local_var_resp.text().await?; + + if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + serde_json::from_str(&local_var_content).map_err(Error::from) + } else { + let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); + let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; + Err(Error::ResponseError(local_var_error)) + } +} + +pub async fn notify_read_thread(configuration: &configuration::Configuration, id: &str, to_status: Option<&str>) -> Result> { + let local_var_configuration = configuration; + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!("{}/notifications/threads/{id}", local_var_configuration.base_path, id=crate::apis::urlencode(id)); + let mut local_var_req_builder = local_var_client.request(reqwest::Method::PATCH, local_var_uri_str.as_str()); + + if let Some(ref local_var_str) = to_status { + local_var_req_builder = local_var_req_builder.query(&[("to-status", &local_var_str.to_string())]); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.query(&[("access_token", local_var_value)]); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.query(&[("sudo", local_var_value)]); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.query(&[("token", local_var_value)]); + } + if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { + local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("Authorization", local_var_value); + }; + if let Some(ref local_var_auth_conf) = local_var_configuration.basic_auth { + local_var_req_builder = local_var_req_builder.basic_auth(local_var_auth_conf.0.to_owned(), local_var_auth_conf.1.to_owned()); + }; + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("Sudo", local_var_value); + }; + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("X-GITEA-OTP", local_var_value); + }; + + let local_var_req = local_var_req_builder.build()?; + let local_var_resp = local_var_client.execute(local_var_req).await?; + + let local_var_status = local_var_resp.status(); + let local_var_content = local_var_resp.text().await?; + + if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + serde_json::from_str(&local_var_content).map_err(Error::from) + } else { + let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); + let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; + Err(Error::ResponseError(local_var_error)) + } +} + diff --git a/crates/gitea_raw_client/src/apis/organization_api.rs b/crates/gitea_raw_client/src/apis/organization_api.rs new file mode 100644 index 0000000..6c3c311 --- /dev/null +++ b/crates/gitea_raw_client/src/apis/organization_api.rs @@ -0,0 +1,3698 @@ +/* + * Gitea API. + * + * This documentation describes the Gitea API. + * + * The version of the OpenAPI document: 1.17.3 + * + * Generated by: https://openapi-generator.tech + */ + + +use reqwest; + +use crate::apis::ResponseContent; +use super::{Error, configuration}; + + +/// struct for typed errors of method [`create_org_repo`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum CreateOrgRepoError { + Status403(), + Status404(), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`create_org_repo_deprecated`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum CreateOrgRepoDeprecatedError { + Status403(), + Status422(), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`org_add_team_member`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum OrgAddTeamMemberError { + Status404(), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`org_add_team_repository`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum OrgAddTeamRepositoryError { + Status403(), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`org_conceal_member`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum OrgConcealMemberError { + Status403(), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`org_create`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum OrgCreateError { + Status403(), + Status422(), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`org_create_hook`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum OrgCreateHookError { + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`org_create_label`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum OrgCreateLabelError { + Status422(), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`org_create_team`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum OrgCreateTeamError { + Status422(), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`org_delete`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum OrgDeleteError { + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`org_delete_hook`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum OrgDeleteHookError { + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`org_delete_label`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum OrgDeleteLabelError { + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`org_delete_member`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum OrgDeleteMemberError { + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`org_delete_team`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum OrgDeleteTeamError { + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`org_edit`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum OrgEditError { + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`org_edit_hook`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum OrgEditHookError { + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`org_edit_label`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum OrgEditLabelError { + Status422(), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`org_edit_team`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum OrgEditTeamError { + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`org_get`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum OrgGetError { + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`org_get_all`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum OrgGetAllError { + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`org_get_hook`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum OrgGetHookError { + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`org_get_label`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum OrgGetLabelError { + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`org_get_team`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum OrgGetTeamError { + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`org_get_user_permissions`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum OrgGetUserPermissionsError { + Status403(), + Status404(), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`org_is_member`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum OrgIsMemberError { + Status404(), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`org_is_public_member`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum OrgIsPublicMemberError { + Status404(), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`org_list_current_user_orgs`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum OrgListCurrentUserOrgsError { + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`org_list_hooks`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum OrgListHooksError { + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`org_list_labels`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum OrgListLabelsError { + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`org_list_members`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum OrgListMembersError { + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`org_list_public_members`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum OrgListPublicMembersError { + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`org_list_repos`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum OrgListReposError { + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`org_list_team_member`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum OrgListTeamMemberError { + Status404(), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`org_list_team_members`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum OrgListTeamMembersError { + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`org_list_team_repo`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum OrgListTeamRepoError { + Status404(), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`org_list_team_repos`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum OrgListTeamReposError { + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`org_list_teams`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum OrgListTeamsError { + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`org_list_user_orgs`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum OrgListUserOrgsError { + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`org_publicize_member`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum OrgPublicizeMemberError { + Status403(), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`org_remove_team_member`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum OrgRemoveTeamMemberError { + Status404(), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`org_remove_team_repository`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum OrgRemoveTeamRepositoryError { + Status403(), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`team_search`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum TeamSearchError { + UnknownValue(serde_json::Value), +} + + +pub async fn create_org_repo(configuration: &configuration::Configuration, org: &str, body: Option) -> Result> { + let local_var_configuration = configuration; + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!("{}/orgs/{org}/repos", local_var_configuration.base_path, org=crate::apis::urlencode(org)); + let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str()); + + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.query(&[("access_token", local_var_value)]); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.query(&[("sudo", local_var_value)]); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.query(&[("token", local_var_value)]); + } + if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { + local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("Authorization", local_var_value); + }; + if let Some(ref local_var_auth_conf) = local_var_configuration.basic_auth { + local_var_req_builder = local_var_req_builder.basic_auth(local_var_auth_conf.0.to_owned(), local_var_auth_conf.1.to_owned()); + }; + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("Sudo", local_var_value); + }; + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("X-GITEA-OTP", local_var_value); + }; + local_var_req_builder = local_var_req_builder.json(&body); + + let local_var_req = local_var_req_builder.build()?; + let local_var_resp = local_var_client.execute(local_var_req).await?; + + let local_var_status = local_var_resp.status(); + let local_var_content = local_var_resp.text().await?; + + if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + serde_json::from_str(&local_var_content).map_err(Error::from) + } else { + let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); + let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; + Err(Error::ResponseError(local_var_error)) + } +} + +pub async fn create_org_repo_deprecated(configuration: &configuration::Configuration, org: &str, body: Option) -> Result> { + let local_var_configuration = configuration; + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!("{}/org/{org}/repos", local_var_configuration.base_path, org=crate::apis::urlencode(org)); + let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str()); + + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.query(&[("access_token", local_var_value)]); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.query(&[("sudo", local_var_value)]); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.query(&[("token", local_var_value)]); + } + if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { + local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("Authorization", local_var_value); + }; + if let Some(ref local_var_auth_conf) = local_var_configuration.basic_auth { + local_var_req_builder = local_var_req_builder.basic_auth(local_var_auth_conf.0.to_owned(), local_var_auth_conf.1.to_owned()); + }; + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("Sudo", local_var_value); + }; + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("X-GITEA-OTP", local_var_value); + }; + local_var_req_builder = local_var_req_builder.json(&body); + + let local_var_req = local_var_req_builder.build()?; + let local_var_resp = local_var_client.execute(local_var_req).await?; + + let local_var_status = local_var_resp.status(); + let local_var_content = local_var_resp.text().await?; + + if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + serde_json::from_str(&local_var_content).map_err(Error::from) + } else { + let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); + let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; + Err(Error::ResponseError(local_var_error)) + } +} + +pub async fn org_add_team_member(configuration: &configuration::Configuration, id: i64, username: &str) -> Result<(), Error> { + let local_var_configuration = configuration; + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!("{}/teams/{id}/members/{username}", local_var_configuration.base_path, id=id, username=crate::apis::urlencode(username)); + let mut local_var_req_builder = local_var_client.request(reqwest::Method::PUT, local_var_uri_str.as_str()); + + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.query(&[("access_token", local_var_value)]); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.query(&[("sudo", local_var_value)]); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.query(&[("token", local_var_value)]); + } + if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { + local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("Authorization", local_var_value); + }; + if let Some(ref local_var_auth_conf) = local_var_configuration.basic_auth { + local_var_req_builder = local_var_req_builder.basic_auth(local_var_auth_conf.0.to_owned(), local_var_auth_conf.1.to_owned()); + }; + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("Sudo", local_var_value); + }; + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("X-GITEA-OTP", local_var_value); + }; + + let local_var_req = local_var_req_builder.build()?; + let local_var_resp = local_var_client.execute(local_var_req).await?; + + let local_var_status = local_var_resp.status(); + let local_var_content = local_var_resp.text().await?; + + if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + Ok(()) + } else { + let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); + let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; + Err(Error::ResponseError(local_var_error)) + } +} + +pub async fn org_add_team_repository(configuration: &configuration::Configuration, id: i64, org: &str, repo: &str) -> Result<(), Error> { + let local_var_configuration = configuration; + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!("{}/teams/{id}/repos/{org}/{repo}", local_var_configuration.base_path, id=id, org=crate::apis::urlencode(org), repo=crate::apis::urlencode(repo)); + let mut local_var_req_builder = local_var_client.request(reqwest::Method::PUT, local_var_uri_str.as_str()); + + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.query(&[("access_token", local_var_value)]); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.query(&[("sudo", local_var_value)]); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.query(&[("token", local_var_value)]); + } + if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { + local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("Authorization", local_var_value); + }; + if let Some(ref local_var_auth_conf) = local_var_configuration.basic_auth { + local_var_req_builder = local_var_req_builder.basic_auth(local_var_auth_conf.0.to_owned(), local_var_auth_conf.1.to_owned()); + }; + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("Sudo", local_var_value); + }; + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("X-GITEA-OTP", local_var_value); + }; + + let local_var_req = local_var_req_builder.build()?; + let local_var_resp = local_var_client.execute(local_var_req).await?; + + let local_var_status = local_var_resp.status(); + let local_var_content = local_var_resp.text().await?; + + if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + Ok(()) + } else { + let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); + let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; + Err(Error::ResponseError(local_var_error)) + } +} + +pub async fn org_conceal_member(configuration: &configuration::Configuration, org: &str, username: &str) -> Result<(), Error> { + let local_var_configuration = configuration; + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!("{}/orgs/{org}/public_members/{username}", local_var_configuration.base_path, org=crate::apis::urlencode(org), username=crate::apis::urlencode(username)); + let mut local_var_req_builder = local_var_client.request(reqwest::Method::DELETE, local_var_uri_str.as_str()); + + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.query(&[("access_token", local_var_value)]); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.query(&[("sudo", local_var_value)]); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.query(&[("token", local_var_value)]); + } + if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { + local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("Authorization", local_var_value); + }; + if let Some(ref local_var_auth_conf) = local_var_configuration.basic_auth { + local_var_req_builder = local_var_req_builder.basic_auth(local_var_auth_conf.0.to_owned(), local_var_auth_conf.1.to_owned()); + }; + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("Sudo", local_var_value); + }; + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("X-GITEA-OTP", local_var_value); + }; + + let local_var_req = local_var_req_builder.build()?; + let local_var_resp = local_var_client.execute(local_var_req).await?; + + let local_var_status = local_var_resp.status(); + let local_var_content = local_var_resp.text().await?; + + if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + Ok(()) + } else { + let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); + let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; + Err(Error::ResponseError(local_var_error)) + } +} + +pub async fn org_create(configuration: &configuration::Configuration, organization: crate::models::CreateOrgOption) -> Result> { + let local_var_configuration = configuration; + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!("{}/orgs", local_var_configuration.base_path); + let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str()); + + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.query(&[("access_token", local_var_value)]); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.query(&[("sudo", local_var_value)]); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.query(&[("token", local_var_value)]); + } + if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { + local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("Authorization", local_var_value); + }; + if let Some(ref local_var_auth_conf) = local_var_configuration.basic_auth { + local_var_req_builder = local_var_req_builder.basic_auth(local_var_auth_conf.0.to_owned(), local_var_auth_conf.1.to_owned()); + }; + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("Sudo", local_var_value); + }; + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("X-GITEA-OTP", local_var_value); + }; + local_var_req_builder = local_var_req_builder.json(&organization); + + let local_var_req = local_var_req_builder.build()?; + let local_var_resp = local_var_client.execute(local_var_req).await?; + + let local_var_status = local_var_resp.status(); + let local_var_content = local_var_resp.text().await?; + + if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + serde_json::from_str(&local_var_content).map_err(Error::from) + } else { + let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); + let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; + Err(Error::ResponseError(local_var_error)) + } +} + +pub async fn org_create_hook(configuration: &configuration::Configuration, org: &str, body: crate::models::CreateHookOption) -> Result> { + let local_var_configuration = configuration; + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!("{}/orgs/{org}/hooks/", local_var_configuration.base_path, org=crate::apis::urlencode(org)); + let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str()); + + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.query(&[("access_token", local_var_value)]); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.query(&[("sudo", local_var_value)]); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.query(&[("token", local_var_value)]); + } + if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { + local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("Authorization", local_var_value); + }; + if let Some(ref local_var_auth_conf) = local_var_configuration.basic_auth { + local_var_req_builder = local_var_req_builder.basic_auth(local_var_auth_conf.0.to_owned(), local_var_auth_conf.1.to_owned()); + }; + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("Sudo", local_var_value); + }; + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("X-GITEA-OTP", local_var_value); + }; + local_var_req_builder = local_var_req_builder.json(&body); + + let local_var_req = local_var_req_builder.build()?; + let local_var_resp = local_var_client.execute(local_var_req).await?; + + let local_var_status = local_var_resp.status(); + let local_var_content = local_var_resp.text().await?; + + if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + serde_json::from_str(&local_var_content).map_err(Error::from) + } else { + let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); + let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; + Err(Error::ResponseError(local_var_error)) + } +} + +pub async fn org_create_label(configuration: &configuration::Configuration, org: &str, body: Option) -> Result> { + let local_var_configuration = configuration; + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!("{}/orgs/{org}/labels", local_var_configuration.base_path, org=crate::apis::urlencode(org)); + let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str()); + + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.query(&[("access_token", local_var_value)]); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.query(&[("sudo", local_var_value)]); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.query(&[("token", local_var_value)]); + } + if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { + local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("Authorization", local_var_value); + }; + if let Some(ref local_var_auth_conf) = local_var_configuration.basic_auth { + local_var_req_builder = local_var_req_builder.basic_auth(local_var_auth_conf.0.to_owned(), local_var_auth_conf.1.to_owned()); + }; + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("Sudo", local_var_value); + }; + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("X-GITEA-OTP", local_var_value); + }; + local_var_req_builder = local_var_req_builder.json(&body); + + let local_var_req = local_var_req_builder.build()?; + let local_var_resp = local_var_client.execute(local_var_req).await?; + + let local_var_status = local_var_resp.status(); + let local_var_content = local_var_resp.text().await?; + + if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + serde_json::from_str(&local_var_content).map_err(Error::from) + } else { + let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); + let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; + Err(Error::ResponseError(local_var_error)) + } +} + +pub async fn org_create_team(configuration: &configuration::Configuration, org: &str, body: Option) -> Result> { + let local_var_configuration = configuration; + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!("{}/orgs/{org}/teams", local_var_configuration.base_path, org=crate::apis::urlencode(org)); + let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str()); + + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.query(&[("access_token", local_var_value)]); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.query(&[("sudo", local_var_value)]); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.query(&[("token", local_var_value)]); + } + if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { + local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("Authorization", local_var_value); + }; + if let Some(ref local_var_auth_conf) = local_var_configuration.basic_auth { + local_var_req_builder = local_var_req_builder.basic_auth(local_var_auth_conf.0.to_owned(), local_var_auth_conf.1.to_owned()); + }; + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("Sudo", local_var_value); + }; + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("X-GITEA-OTP", local_var_value); + }; + local_var_req_builder = local_var_req_builder.json(&body); + + let local_var_req = local_var_req_builder.build()?; + let local_var_resp = local_var_client.execute(local_var_req).await?; + + let local_var_status = local_var_resp.status(); + let local_var_content = local_var_resp.text().await?; + + if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + serde_json::from_str(&local_var_content).map_err(Error::from) + } else { + let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); + let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; + Err(Error::ResponseError(local_var_error)) + } +} + +pub async fn org_delete(configuration: &configuration::Configuration, org: &str) -> Result<(), Error> { + let local_var_configuration = configuration; + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!("{}/orgs/{org}", local_var_configuration.base_path, org=crate::apis::urlencode(org)); + let mut local_var_req_builder = local_var_client.request(reqwest::Method::DELETE, local_var_uri_str.as_str()); + + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.query(&[("access_token", local_var_value)]); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.query(&[("sudo", local_var_value)]); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.query(&[("token", local_var_value)]); + } + if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { + local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("Authorization", local_var_value); + }; + if let Some(ref local_var_auth_conf) = local_var_configuration.basic_auth { + local_var_req_builder = local_var_req_builder.basic_auth(local_var_auth_conf.0.to_owned(), local_var_auth_conf.1.to_owned()); + }; + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("Sudo", local_var_value); + }; + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("X-GITEA-OTP", local_var_value); + }; + + let local_var_req = local_var_req_builder.build()?; + let local_var_resp = local_var_client.execute(local_var_req).await?; + + let local_var_status = local_var_resp.status(); + let local_var_content = local_var_resp.text().await?; + + if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + Ok(()) + } else { + let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); + let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; + Err(Error::ResponseError(local_var_error)) + } +} + +pub async fn org_delete_hook(configuration: &configuration::Configuration, org: &str, id: i64) -> Result<(), Error> { + let local_var_configuration = configuration; + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!("{}/orgs/{org}/hooks/{id}", local_var_configuration.base_path, org=crate::apis::urlencode(org), id=id); + let mut local_var_req_builder = local_var_client.request(reqwest::Method::DELETE, local_var_uri_str.as_str()); + + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.query(&[("access_token", local_var_value)]); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.query(&[("sudo", local_var_value)]); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.query(&[("token", local_var_value)]); + } + if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { + local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("Authorization", local_var_value); + }; + if let Some(ref local_var_auth_conf) = local_var_configuration.basic_auth { + local_var_req_builder = local_var_req_builder.basic_auth(local_var_auth_conf.0.to_owned(), local_var_auth_conf.1.to_owned()); + }; + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("Sudo", local_var_value); + }; + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("X-GITEA-OTP", local_var_value); + }; + + let local_var_req = local_var_req_builder.build()?; + let local_var_resp = local_var_client.execute(local_var_req).await?; + + let local_var_status = local_var_resp.status(); + let local_var_content = local_var_resp.text().await?; + + if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + Ok(()) + } else { + let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); + let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; + Err(Error::ResponseError(local_var_error)) + } +} + +pub async fn org_delete_label(configuration: &configuration::Configuration, org: &str, id: i64) -> Result<(), Error> { + let local_var_configuration = configuration; + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!("{}/orgs/{org}/labels/{id}", local_var_configuration.base_path, org=crate::apis::urlencode(org), id=id); + let mut local_var_req_builder = local_var_client.request(reqwest::Method::DELETE, local_var_uri_str.as_str()); + + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.query(&[("access_token", local_var_value)]); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.query(&[("sudo", local_var_value)]); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.query(&[("token", local_var_value)]); + } + if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { + local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("Authorization", local_var_value); + }; + if let Some(ref local_var_auth_conf) = local_var_configuration.basic_auth { + local_var_req_builder = local_var_req_builder.basic_auth(local_var_auth_conf.0.to_owned(), local_var_auth_conf.1.to_owned()); + }; + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("Sudo", local_var_value); + }; + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("X-GITEA-OTP", local_var_value); + }; + + let local_var_req = local_var_req_builder.build()?; + let local_var_resp = local_var_client.execute(local_var_req).await?; + + let local_var_status = local_var_resp.status(); + let local_var_content = local_var_resp.text().await?; + + if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + Ok(()) + } else { + let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); + let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; + Err(Error::ResponseError(local_var_error)) + } +} + +pub async fn org_delete_member(configuration: &configuration::Configuration, org: &str, username: &str) -> Result<(), Error> { + let local_var_configuration = configuration; + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!("{}/orgs/{org}/members/{username}", local_var_configuration.base_path, org=crate::apis::urlencode(org), username=crate::apis::urlencode(username)); + let mut local_var_req_builder = local_var_client.request(reqwest::Method::DELETE, local_var_uri_str.as_str()); + + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.query(&[("access_token", local_var_value)]); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.query(&[("sudo", local_var_value)]); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.query(&[("token", local_var_value)]); + } + if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { + local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("Authorization", local_var_value); + }; + if let Some(ref local_var_auth_conf) = local_var_configuration.basic_auth { + local_var_req_builder = local_var_req_builder.basic_auth(local_var_auth_conf.0.to_owned(), local_var_auth_conf.1.to_owned()); + }; + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("Sudo", local_var_value); + }; + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("X-GITEA-OTP", local_var_value); + }; + + let local_var_req = local_var_req_builder.build()?; + let local_var_resp = local_var_client.execute(local_var_req).await?; + + let local_var_status = local_var_resp.status(); + let local_var_content = local_var_resp.text().await?; + + if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + Ok(()) + } else { + let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); + let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; + Err(Error::ResponseError(local_var_error)) + } +} + +pub async fn org_delete_team(configuration: &configuration::Configuration, id: i64) -> Result<(), Error> { + let local_var_configuration = configuration; + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!("{}/teams/{id}", local_var_configuration.base_path, id=id); + let mut local_var_req_builder = local_var_client.request(reqwest::Method::DELETE, local_var_uri_str.as_str()); + + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.query(&[("access_token", local_var_value)]); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.query(&[("sudo", local_var_value)]); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.query(&[("token", local_var_value)]); + } + if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { + local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("Authorization", local_var_value); + }; + if let Some(ref local_var_auth_conf) = local_var_configuration.basic_auth { + local_var_req_builder = local_var_req_builder.basic_auth(local_var_auth_conf.0.to_owned(), local_var_auth_conf.1.to_owned()); + }; + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("Sudo", local_var_value); + }; + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("X-GITEA-OTP", local_var_value); + }; + + let local_var_req = local_var_req_builder.build()?; + let local_var_resp = local_var_client.execute(local_var_req).await?; + + let local_var_status = local_var_resp.status(); + let local_var_content = local_var_resp.text().await?; + + if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + Ok(()) + } else { + let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); + let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; + Err(Error::ResponseError(local_var_error)) + } +} + +pub async fn org_edit(configuration: &configuration::Configuration, org: &str, body: crate::models::EditOrgOption) -> Result> { + let local_var_configuration = configuration; + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!("{}/orgs/{org}", local_var_configuration.base_path, org=crate::apis::urlencode(org)); + let mut local_var_req_builder = local_var_client.request(reqwest::Method::PATCH, local_var_uri_str.as_str()); + + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.query(&[("access_token", local_var_value)]); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.query(&[("sudo", local_var_value)]); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.query(&[("token", local_var_value)]); + } + if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { + local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("Authorization", local_var_value); + }; + if let Some(ref local_var_auth_conf) = local_var_configuration.basic_auth { + local_var_req_builder = local_var_req_builder.basic_auth(local_var_auth_conf.0.to_owned(), local_var_auth_conf.1.to_owned()); + }; + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("Sudo", local_var_value); + }; + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("X-GITEA-OTP", local_var_value); + }; + local_var_req_builder = local_var_req_builder.json(&body); + + let local_var_req = local_var_req_builder.build()?; + let local_var_resp = local_var_client.execute(local_var_req).await?; + + let local_var_status = local_var_resp.status(); + let local_var_content = local_var_resp.text().await?; + + if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + serde_json::from_str(&local_var_content).map_err(Error::from) + } else { + let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); + let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; + Err(Error::ResponseError(local_var_error)) + } +} + +pub async fn org_edit_hook(configuration: &configuration::Configuration, org: &str, id: i64, body: Option) -> Result> { + let local_var_configuration = configuration; + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!("{}/orgs/{org}/hooks/{id}", local_var_configuration.base_path, org=crate::apis::urlencode(org), id=id); + let mut local_var_req_builder = local_var_client.request(reqwest::Method::PATCH, local_var_uri_str.as_str()); + + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.query(&[("access_token", local_var_value)]); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.query(&[("sudo", local_var_value)]); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.query(&[("token", local_var_value)]); + } + if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { + local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("Authorization", local_var_value); + }; + if let Some(ref local_var_auth_conf) = local_var_configuration.basic_auth { + local_var_req_builder = local_var_req_builder.basic_auth(local_var_auth_conf.0.to_owned(), local_var_auth_conf.1.to_owned()); + }; + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("Sudo", local_var_value); + }; + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("X-GITEA-OTP", local_var_value); + }; + local_var_req_builder = local_var_req_builder.json(&body); + + let local_var_req = local_var_req_builder.build()?; + let local_var_resp = local_var_client.execute(local_var_req).await?; + + let local_var_status = local_var_resp.status(); + let local_var_content = local_var_resp.text().await?; + + if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + serde_json::from_str(&local_var_content).map_err(Error::from) + } else { + let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); + let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; + Err(Error::ResponseError(local_var_error)) + } +} + +pub async fn org_edit_label(configuration: &configuration::Configuration, org: &str, id: i64, body: Option) -> Result> { + let local_var_configuration = configuration; + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!("{}/orgs/{org}/labels/{id}", local_var_configuration.base_path, org=crate::apis::urlencode(org), id=id); + let mut local_var_req_builder = local_var_client.request(reqwest::Method::PATCH, local_var_uri_str.as_str()); + + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.query(&[("access_token", local_var_value)]); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.query(&[("sudo", local_var_value)]); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.query(&[("token", local_var_value)]); + } + if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { + local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("Authorization", local_var_value); + }; + if let Some(ref local_var_auth_conf) = local_var_configuration.basic_auth { + local_var_req_builder = local_var_req_builder.basic_auth(local_var_auth_conf.0.to_owned(), local_var_auth_conf.1.to_owned()); + }; + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("Sudo", local_var_value); + }; + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("X-GITEA-OTP", local_var_value); + }; + local_var_req_builder = local_var_req_builder.json(&body); + + let local_var_req = local_var_req_builder.build()?; + let local_var_resp = local_var_client.execute(local_var_req).await?; + + let local_var_status = local_var_resp.status(); + let local_var_content = local_var_resp.text().await?; + + if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + serde_json::from_str(&local_var_content).map_err(Error::from) + } else { + let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); + let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; + Err(Error::ResponseError(local_var_error)) + } +} + +pub async fn org_edit_team(configuration: &configuration::Configuration, id: i32, body: Option) -> Result> { + let local_var_configuration = configuration; + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!("{}/teams/{id}", local_var_configuration.base_path, id=id); + let mut local_var_req_builder = local_var_client.request(reqwest::Method::PATCH, local_var_uri_str.as_str()); + + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.query(&[("access_token", local_var_value)]); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.query(&[("sudo", local_var_value)]); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.query(&[("token", local_var_value)]); + } + if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { + local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("Authorization", local_var_value); + }; + if let Some(ref local_var_auth_conf) = local_var_configuration.basic_auth { + local_var_req_builder = local_var_req_builder.basic_auth(local_var_auth_conf.0.to_owned(), local_var_auth_conf.1.to_owned()); + }; + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("Sudo", local_var_value); + }; + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("X-GITEA-OTP", local_var_value); + }; + local_var_req_builder = local_var_req_builder.json(&body); + + let local_var_req = local_var_req_builder.build()?; + let local_var_resp = local_var_client.execute(local_var_req).await?; + + let local_var_status = local_var_resp.status(); + let local_var_content = local_var_resp.text().await?; + + if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + serde_json::from_str(&local_var_content).map_err(Error::from) + } else { + let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); + let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; + Err(Error::ResponseError(local_var_error)) + } +} + +pub async fn org_get(configuration: &configuration::Configuration, org: &str) -> Result> { + let local_var_configuration = configuration; + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!("{}/orgs/{org}", local_var_configuration.base_path, org=crate::apis::urlencode(org)); + let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str()); + + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.query(&[("access_token", local_var_value)]); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.query(&[("sudo", local_var_value)]); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.query(&[("token", local_var_value)]); + } + if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { + local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("Authorization", local_var_value); + }; + if let Some(ref local_var_auth_conf) = local_var_configuration.basic_auth { + local_var_req_builder = local_var_req_builder.basic_auth(local_var_auth_conf.0.to_owned(), local_var_auth_conf.1.to_owned()); + }; + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("Sudo", local_var_value); + }; + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("X-GITEA-OTP", local_var_value); + }; + + let local_var_req = local_var_req_builder.build()?; + let local_var_resp = local_var_client.execute(local_var_req).await?; + + let local_var_status = local_var_resp.status(); + let local_var_content = local_var_resp.text().await?; + + if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + serde_json::from_str(&local_var_content).map_err(Error::from) + } else { + let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); + let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; + Err(Error::ResponseError(local_var_error)) + } +} + +pub async fn org_get_all(configuration: &configuration::Configuration, page: Option, limit: Option) -> Result, Error> { + let local_var_configuration = configuration; + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!("{}/orgs", local_var_configuration.base_path); + let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str()); + + if let Some(ref local_var_str) = page { + local_var_req_builder = local_var_req_builder.query(&[("page", &local_var_str.to_string())]); + } + if let Some(ref local_var_str) = limit { + local_var_req_builder = local_var_req_builder.query(&[("limit", &local_var_str.to_string())]); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.query(&[("access_token", local_var_value)]); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.query(&[("sudo", local_var_value)]); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.query(&[("token", local_var_value)]); + } + if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { + local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("Authorization", local_var_value); + }; + if let Some(ref local_var_auth_conf) = local_var_configuration.basic_auth { + local_var_req_builder = local_var_req_builder.basic_auth(local_var_auth_conf.0.to_owned(), local_var_auth_conf.1.to_owned()); + }; + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("Sudo", local_var_value); + }; + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("X-GITEA-OTP", local_var_value); + }; + + let local_var_req = local_var_req_builder.build()?; + let local_var_resp = local_var_client.execute(local_var_req).await?; + + let local_var_status = local_var_resp.status(); + let local_var_content = local_var_resp.text().await?; + + if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + serde_json::from_str(&local_var_content).map_err(Error::from) + } else { + let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); + let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; + Err(Error::ResponseError(local_var_error)) + } +} + +pub async fn org_get_hook(configuration: &configuration::Configuration, org: &str, id: i64) -> Result> { + let local_var_configuration = configuration; + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!("{}/orgs/{org}/hooks/{id}", local_var_configuration.base_path, org=crate::apis::urlencode(org), id=id); + let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str()); + + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.query(&[("access_token", local_var_value)]); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.query(&[("sudo", local_var_value)]); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.query(&[("token", local_var_value)]); + } + if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { + local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("Authorization", local_var_value); + }; + if let Some(ref local_var_auth_conf) = local_var_configuration.basic_auth { + local_var_req_builder = local_var_req_builder.basic_auth(local_var_auth_conf.0.to_owned(), local_var_auth_conf.1.to_owned()); + }; + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("Sudo", local_var_value); + }; + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("X-GITEA-OTP", local_var_value); + }; + + let local_var_req = local_var_req_builder.build()?; + let local_var_resp = local_var_client.execute(local_var_req).await?; + + let local_var_status = local_var_resp.status(); + let local_var_content = local_var_resp.text().await?; + + if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + serde_json::from_str(&local_var_content).map_err(Error::from) + } else { + let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); + let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; + Err(Error::ResponseError(local_var_error)) + } +} + +pub async fn org_get_label(configuration: &configuration::Configuration, org: &str, id: i64) -> Result> { + let local_var_configuration = configuration; + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!("{}/orgs/{org}/labels/{id}", local_var_configuration.base_path, org=crate::apis::urlencode(org), id=id); + let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str()); + + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.query(&[("access_token", local_var_value)]); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.query(&[("sudo", local_var_value)]); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.query(&[("token", local_var_value)]); + } + if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { + local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("Authorization", local_var_value); + }; + if let Some(ref local_var_auth_conf) = local_var_configuration.basic_auth { + local_var_req_builder = local_var_req_builder.basic_auth(local_var_auth_conf.0.to_owned(), local_var_auth_conf.1.to_owned()); + }; + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("Sudo", local_var_value); + }; + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("X-GITEA-OTP", local_var_value); + }; + + let local_var_req = local_var_req_builder.build()?; + let local_var_resp = local_var_client.execute(local_var_req).await?; + + let local_var_status = local_var_resp.status(); + let local_var_content = local_var_resp.text().await?; + + if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + serde_json::from_str(&local_var_content).map_err(Error::from) + } else { + let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); + let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; + Err(Error::ResponseError(local_var_error)) + } +} + +pub async fn org_get_team(configuration: &configuration::Configuration, id: i64) -> Result> { + let local_var_configuration = configuration; + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!("{}/teams/{id}", local_var_configuration.base_path, id=id); + let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str()); + + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.query(&[("access_token", local_var_value)]); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.query(&[("sudo", local_var_value)]); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.query(&[("token", local_var_value)]); + } + if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { + local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("Authorization", local_var_value); + }; + if let Some(ref local_var_auth_conf) = local_var_configuration.basic_auth { + local_var_req_builder = local_var_req_builder.basic_auth(local_var_auth_conf.0.to_owned(), local_var_auth_conf.1.to_owned()); + }; + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("Sudo", local_var_value); + }; + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("X-GITEA-OTP", local_var_value); + }; + + let local_var_req = local_var_req_builder.build()?; + let local_var_resp = local_var_client.execute(local_var_req).await?; + + let local_var_status = local_var_resp.status(); + let local_var_content = local_var_resp.text().await?; + + if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + serde_json::from_str(&local_var_content).map_err(Error::from) + } else { + let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); + let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; + Err(Error::ResponseError(local_var_error)) + } +} + +pub async fn org_get_user_permissions(configuration: &configuration::Configuration, username: &str, org: &str) -> Result> { + let local_var_configuration = configuration; + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!("{}/users/{username}/orgs/{org}/permissions", local_var_configuration.base_path, username=crate::apis::urlencode(username), org=crate::apis::urlencode(org)); + let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str()); + + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.query(&[("access_token", local_var_value)]); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.query(&[("sudo", local_var_value)]); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.query(&[("token", local_var_value)]); + } + if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { + local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("Authorization", local_var_value); + }; + if let Some(ref local_var_auth_conf) = local_var_configuration.basic_auth { + local_var_req_builder = local_var_req_builder.basic_auth(local_var_auth_conf.0.to_owned(), local_var_auth_conf.1.to_owned()); + }; + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("Sudo", local_var_value); + }; + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("X-GITEA-OTP", local_var_value); + }; + + let local_var_req = local_var_req_builder.build()?; + let local_var_resp = local_var_client.execute(local_var_req).await?; + + let local_var_status = local_var_resp.status(); + let local_var_content = local_var_resp.text().await?; + + if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + serde_json::from_str(&local_var_content).map_err(Error::from) + } else { + let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); + let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; + Err(Error::ResponseError(local_var_error)) + } +} + +pub async fn org_is_member(configuration: &configuration::Configuration, org: &str, username: &str) -> Result<(), Error> { + let local_var_configuration = configuration; + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!("{}/orgs/{org}/members/{username}", local_var_configuration.base_path, org=crate::apis::urlencode(org), username=crate::apis::urlencode(username)); + let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str()); + + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.query(&[("access_token", local_var_value)]); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.query(&[("sudo", local_var_value)]); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.query(&[("token", local_var_value)]); + } + if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { + local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("Authorization", local_var_value); + }; + if let Some(ref local_var_auth_conf) = local_var_configuration.basic_auth { + local_var_req_builder = local_var_req_builder.basic_auth(local_var_auth_conf.0.to_owned(), local_var_auth_conf.1.to_owned()); + }; + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("Sudo", local_var_value); + }; + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("X-GITEA-OTP", local_var_value); + }; + + let local_var_req = local_var_req_builder.build()?; + let local_var_resp = local_var_client.execute(local_var_req).await?; + + let local_var_status = local_var_resp.status(); + let local_var_content = local_var_resp.text().await?; + + if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + Ok(()) + } else { + let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); + let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; + Err(Error::ResponseError(local_var_error)) + } +} + +pub async fn org_is_public_member(configuration: &configuration::Configuration, org: &str, username: &str) -> Result<(), Error> { + let local_var_configuration = configuration; + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!("{}/orgs/{org}/public_members/{username}", local_var_configuration.base_path, org=crate::apis::urlencode(org), username=crate::apis::urlencode(username)); + let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str()); + + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.query(&[("access_token", local_var_value)]); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.query(&[("sudo", local_var_value)]); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.query(&[("token", local_var_value)]); + } + if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { + local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("Authorization", local_var_value); + }; + if let Some(ref local_var_auth_conf) = local_var_configuration.basic_auth { + local_var_req_builder = local_var_req_builder.basic_auth(local_var_auth_conf.0.to_owned(), local_var_auth_conf.1.to_owned()); + }; + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("Sudo", local_var_value); + }; + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("X-GITEA-OTP", local_var_value); + }; + + let local_var_req = local_var_req_builder.build()?; + let local_var_resp = local_var_client.execute(local_var_req).await?; + + let local_var_status = local_var_resp.status(); + let local_var_content = local_var_resp.text().await?; + + if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + Ok(()) + } else { + let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); + let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; + Err(Error::ResponseError(local_var_error)) + } +} + +pub async fn org_list_current_user_orgs(configuration: &configuration::Configuration, page: Option, limit: Option) -> Result, Error> { + let local_var_configuration = configuration; + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!("{}/user/orgs", local_var_configuration.base_path); + let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str()); + + if let Some(ref local_var_str) = page { + local_var_req_builder = local_var_req_builder.query(&[("page", &local_var_str.to_string())]); + } + if let Some(ref local_var_str) = limit { + local_var_req_builder = local_var_req_builder.query(&[("limit", &local_var_str.to_string())]); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.query(&[("access_token", local_var_value)]); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.query(&[("sudo", local_var_value)]); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.query(&[("token", local_var_value)]); + } + if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { + local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("Authorization", local_var_value); + }; + if let Some(ref local_var_auth_conf) = local_var_configuration.basic_auth { + local_var_req_builder = local_var_req_builder.basic_auth(local_var_auth_conf.0.to_owned(), local_var_auth_conf.1.to_owned()); + }; + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("Sudo", local_var_value); + }; + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("X-GITEA-OTP", local_var_value); + }; + + let local_var_req = local_var_req_builder.build()?; + let local_var_resp = local_var_client.execute(local_var_req).await?; + + let local_var_status = local_var_resp.status(); + let local_var_content = local_var_resp.text().await?; + + if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + serde_json::from_str(&local_var_content).map_err(Error::from) + } else { + let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); + let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; + Err(Error::ResponseError(local_var_error)) + } +} + +pub async fn org_list_hooks(configuration: &configuration::Configuration, org: &str, page: Option, limit: Option) -> Result, Error> { + let local_var_configuration = configuration; + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!("{}/orgs/{org}/hooks", local_var_configuration.base_path, org=crate::apis::urlencode(org)); + let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str()); + + if let Some(ref local_var_str) = page { + local_var_req_builder = local_var_req_builder.query(&[("page", &local_var_str.to_string())]); + } + if let Some(ref local_var_str) = limit { + local_var_req_builder = local_var_req_builder.query(&[("limit", &local_var_str.to_string())]); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.query(&[("access_token", local_var_value)]); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.query(&[("sudo", local_var_value)]); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.query(&[("token", local_var_value)]); + } + if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { + local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("Authorization", local_var_value); + }; + if let Some(ref local_var_auth_conf) = local_var_configuration.basic_auth { + local_var_req_builder = local_var_req_builder.basic_auth(local_var_auth_conf.0.to_owned(), local_var_auth_conf.1.to_owned()); + }; + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("Sudo", local_var_value); + }; + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("X-GITEA-OTP", local_var_value); + }; + + let local_var_req = local_var_req_builder.build()?; + let local_var_resp = local_var_client.execute(local_var_req).await?; + + let local_var_status = local_var_resp.status(); + let local_var_content = local_var_resp.text().await?; + + if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + serde_json::from_str(&local_var_content).map_err(Error::from) + } else { + let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); + let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; + Err(Error::ResponseError(local_var_error)) + } +} + +pub async fn org_list_labels(configuration: &configuration::Configuration, org: &str, page: Option, limit: Option) -> Result, Error> { + let local_var_configuration = configuration; + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!("{}/orgs/{org}/labels", local_var_configuration.base_path, org=crate::apis::urlencode(org)); + let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str()); + + if let Some(ref local_var_str) = page { + local_var_req_builder = local_var_req_builder.query(&[("page", &local_var_str.to_string())]); + } + if let Some(ref local_var_str) = limit { + local_var_req_builder = local_var_req_builder.query(&[("limit", &local_var_str.to_string())]); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.query(&[("access_token", local_var_value)]); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.query(&[("sudo", local_var_value)]); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.query(&[("token", local_var_value)]); + } + if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { + local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("Authorization", local_var_value); + }; + if let Some(ref local_var_auth_conf) = local_var_configuration.basic_auth { + local_var_req_builder = local_var_req_builder.basic_auth(local_var_auth_conf.0.to_owned(), local_var_auth_conf.1.to_owned()); + }; + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("Sudo", local_var_value); + }; + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("X-GITEA-OTP", local_var_value); + }; + + let local_var_req = local_var_req_builder.build()?; + let local_var_resp = local_var_client.execute(local_var_req).await?; + + let local_var_status = local_var_resp.status(); + let local_var_content = local_var_resp.text().await?; + + if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + serde_json::from_str(&local_var_content).map_err(Error::from) + } else { + let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); + let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; + Err(Error::ResponseError(local_var_error)) + } +} + +pub async fn org_list_members(configuration: &configuration::Configuration, org: &str, page: Option, limit: Option) -> Result, Error> { + let local_var_configuration = configuration; + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!("{}/orgs/{org}/members", local_var_configuration.base_path, org=crate::apis::urlencode(org)); + let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str()); + + if let Some(ref local_var_str) = page { + local_var_req_builder = local_var_req_builder.query(&[("page", &local_var_str.to_string())]); + } + if let Some(ref local_var_str) = limit { + local_var_req_builder = local_var_req_builder.query(&[("limit", &local_var_str.to_string())]); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.query(&[("access_token", local_var_value)]); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.query(&[("sudo", local_var_value)]); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.query(&[("token", local_var_value)]); + } + if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { + local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("Authorization", local_var_value); + }; + if let Some(ref local_var_auth_conf) = local_var_configuration.basic_auth { + local_var_req_builder = local_var_req_builder.basic_auth(local_var_auth_conf.0.to_owned(), local_var_auth_conf.1.to_owned()); + }; + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("Sudo", local_var_value); + }; + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("X-GITEA-OTP", local_var_value); + }; + + let local_var_req = local_var_req_builder.build()?; + let local_var_resp = local_var_client.execute(local_var_req).await?; + + let local_var_status = local_var_resp.status(); + let local_var_content = local_var_resp.text().await?; + + if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + serde_json::from_str(&local_var_content).map_err(Error::from) + } else { + let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); + let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; + Err(Error::ResponseError(local_var_error)) + } +} + +pub async fn org_list_public_members(configuration: &configuration::Configuration, org: &str, page: Option, limit: Option) -> Result, Error> { + let local_var_configuration = configuration; + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!("{}/orgs/{org}/public_members", local_var_configuration.base_path, org=crate::apis::urlencode(org)); + let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str()); + + if let Some(ref local_var_str) = page { + local_var_req_builder = local_var_req_builder.query(&[("page", &local_var_str.to_string())]); + } + if let Some(ref local_var_str) = limit { + local_var_req_builder = local_var_req_builder.query(&[("limit", &local_var_str.to_string())]); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.query(&[("access_token", local_var_value)]); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.query(&[("sudo", local_var_value)]); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.query(&[("token", local_var_value)]); + } + if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { + local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("Authorization", local_var_value); + }; + if let Some(ref local_var_auth_conf) = local_var_configuration.basic_auth { + local_var_req_builder = local_var_req_builder.basic_auth(local_var_auth_conf.0.to_owned(), local_var_auth_conf.1.to_owned()); + }; + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("Sudo", local_var_value); + }; + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("X-GITEA-OTP", local_var_value); + }; + + let local_var_req = local_var_req_builder.build()?; + let local_var_resp = local_var_client.execute(local_var_req).await?; + + let local_var_status = local_var_resp.status(); + let local_var_content = local_var_resp.text().await?; + + if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + serde_json::from_str(&local_var_content).map_err(Error::from) + } else { + let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); + let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; + Err(Error::ResponseError(local_var_error)) + } +} + +pub async fn org_list_repos(configuration: &configuration::Configuration, org: &str, page: Option, limit: Option) -> Result, Error> { + let local_var_configuration = configuration; + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!("{}/orgs/{org}/repos", local_var_configuration.base_path, org=crate::apis::urlencode(org)); + let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str()); + + if let Some(ref local_var_str) = page { + local_var_req_builder = local_var_req_builder.query(&[("page", &local_var_str.to_string())]); + } + if let Some(ref local_var_str) = limit { + local_var_req_builder = local_var_req_builder.query(&[("limit", &local_var_str.to_string())]); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.query(&[("access_token", local_var_value)]); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.query(&[("sudo", local_var_value)]); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.query(&[("token", local_var_value)]); + } + if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { + local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("Authorization", local_var_value); + }; + if let Some(ref local_var_auth_conf) = local_var_configuration.basic_auth { + local_var_req_builder = local_var_req_builder.basic_auth(local_var_auth_conf.0.to_owned(), local_var_auth_conf.1.to_owned()); + }; + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("Sudo", local_var_value); + }; + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("X-GITEA-OTP", local_var_value); + }; + + let local_var_req = local_var_req_builder.build()?; + let local_var_resp = local_var_client.execute(local_var_req).await?; + + let local_var_status = local_var_resp.status(); + let local_var_content = local_var_resp.text().await?; + + if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + serde_json::from_str(&local_var_content).map_err(Error::from) + } else { + let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); + let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; + Err(Error::ResponseError(local_var_error)) + } +} + +pub async fn org_list_team_member(configuration: &configuration::Configuration, id: i64, username: &str) -> Result> { + let local_var_configuration = configuration; + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!("{}/teams/{id}/members/{username}", local_var_configuration.base_path, id=id, username=crate::apis::urlencode(username)); + let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str()); + + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.query(&[("access_token", local_var_value)]); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.query(&[("sudo", local_var_value)]); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.query(&[("token", local_var_value)]); + } + if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { + local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("Authorization", local_var_value); + }; + if let Some(ref local_var_auth_conf) = local_var_configuration.basic_auth { + local_var_req_builder = local_var_req_builder.basic_auth(local_var_auth_conf.0.to_owned(), local_var_auth_conf.1.to_owned()); + }; + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("Sudo", local_var_value); + }; + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("X-GITEA-OTP", local_var_value); + }; + + let local_var_req = local_var_req_builder.build()?; + let local_var_resp = local_var_client.execute(local_var_req).await?; + + let local_var_status = local_var_resp.status(); + let local_var_content = local_var_resp.text().await?; + + if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + serde_json::from_str(&local_var_content).map_err(Error::from) + } else { + let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); + let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; + Err(Error::ResponseError(local_var_error)) + } +} + +pub async fn org_list_team_members(configuration: &configuration::Configuration, id: i64, page: Option, limit: Option) -> Result, Error> { + let local_var_configuration = configuration; + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!("{}/teams/{id}/members", local_var_configuration.base_path, id=id); + let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str()); + + if let Some(ref local_var_str) = page { + local_var_req_builder = local_var_req_builder.query(&[("page", &local_var_str.to_string())]); + } + if let Some(ref local_var_str) = limit { + local_var_req_builder = local_var_req_builder.query(&[("limit", &local_var_str.to_string())]); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.query(&[("access_token", local_var_value)]); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.query(&[("sudo", local_var_value)]); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.query(&[("token", local_var_value)]); + } + if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { + local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("Authorization", local_var_value); + }; + if let Some(ref local_var_auth_conf) = local_var_configuration.basic_auth { + local_var_req_builder = local_var_req_builder.basic_auth(local_var_auth_conf.0.to_owned(), local_var_auth_conf.1.to_owned()); + }; + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("Sudo", local_var_value); + }; + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("X-GITEA-OTP", local_var_value); + }; + + let local_var_req = local_var_req_builder.build()?; + let local_var_resp = local_var_client.execute(local_var_req).await?; + + let local_var_status = local_var_resp.status(); + let local_var_content = local_var_resp.text().await?; + + if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + serde_json::from_str(&local_var_content).map_err(Error::from) + } else { + let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); + let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; + Err(Error::ResponseError(local_var_error)) + } +} + +pub async fn org_list_team_repo(configuration: &configuration::Configuration, id: i64, org: &str, repo: &str) -> Result> { + let local_var_configuration = configuration; + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!("{}/teams/{id}/repos/{org}/{repo}", local_var_configuration.base_path, id=id, org=crate::apis::urlencode(org), repo=crate::apis::urlencode(repo)); + let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str()); + + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.query(&[("access_token", local_var_value)]); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.query(&[("sudo", local_var_value)]); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.query(&[("token", local_var_value)]); + } + if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { + local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("Authorization", local_var_value); + }; + if let Some(ref local_var_auth_conf) = local_var_configuration.basic_auth { + local_var_req_builder = local_var_req_builder.basic_auth(local_var_auth_conf.0.to_owned(), local_var_auth_conf.1.to_owned()); + }; + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("Sudo", local_var_value); + }; + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("X-GITEA-OTP", local_var_value); + }; + + let local_var_req = local_var_req_builder.build()?; + let local_var_resp = local_var_client.execute(local_var_req).await?; + + let local_var_status = local_var_resp.status(); + let local_var_content = local_var_resp.text().await?; + + if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + serde_json::from_str(&local_var_content).map_err(Error::from) + } else { + let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); + let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; + Err(Error::ResponseError(local_var_error)) + } +} + +pub async fn org_list_team_repos(configuration: &configuration::Configuration, id: i64, page: Option, limit: Option) -> Result, Error> { + let local_var_configuration = configuration; + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!("{}/teams/{id}/repos", local_var_configuration.base_path, id=id); + let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str()); + + if let Some(ref local_var_str) = page { + local_var_req_builder = local_var_req_builder.query(&[("page", &local_var_str.to_string())]); + } + if let Some(ref local_var_str) = limit { + local_var_req_builder = local_var_req_builder.query(&[("limit", &local_var_str.to_string())]); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.query(&[("access_token", local_var_value)]); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.query(&[("sudo", local_var_value)]); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.query(&[("token", local_var_value)]); + } + if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { + local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("Authorization", local_var_value); + }; + if let Some(ref local_var_auth_conf) = local_var_configuration.basic_auth { + local_var_req_builder = local_var_req_builder.basic_auth(local_var_auth_conf.0.to_owned(), local_var_auth_conf.1.to_owned()); + }; + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("Sudo", local_var_value); + }; + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("X-GITEA-OTP", local_var_value); + }; + + let local_var_req = local_var_req_builder.build()?; + let local_var_resp = local_var_client.execute(local_var_req).await?; + + let local_var_status = local_var_resp.status(); + let local_var_content = local_var_resp.text().await?; + + if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + serde_json::from_str(&local_var_content).map_err(Error::from) + } else { + let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); + let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; + Err(Error::ResponseError(local_var_error)) + } +} + +pub async fn org_list_teams(configuration: &configuration::Configuration, org: &str, page: Option, limit: Option) -> Result, Error> { + let local_var_configuration = configuration; + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!("{}/orgs/{org}/teams", local_var_configuration.base_path, org=crate::apis::urlencode(org)); + let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str()); + + if let Some(ref local_var_str) = page { + local_var_req_builder = local_var_req_builder.query(&[("page", &local_var_str.to_string())]); + } + if let Some(ref local_var_str) = limit { + local_var_req_builder = local_var_req_builder.query(&[("limit", &local_var_str.to_string())]); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.query(&[("access_token", local_var_value)]); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.query(&[("sudo", local_var_value)]); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.query(&[("token", local_var_value)]); + } + if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { + local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("Authorization", local_var_value); + }; + if let Some(ref local_var_auth_conf) = local_var_configuration.basic_auth { + local_var_req_builder = local_var_req_builder.basic_auth(local_var_auth_conf.0.to_owned(), local_var_auth_conf.1.to_owned()); + }; + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("Sudo", local_var_value); + }; + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("X-GITEA-OTP", local_var_value); + }; + + let local_var_req = local_var_req_builder.build()?; + let local_var_resp = local_var_client.execute(local_var_req).await?; + + let local_var_status = local_var_resp.status(); + let local_var_content = local_var_resp.text().await?; + + if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + serde_json::from_str(&local_var_content).map_err(Error::from) + } else { + let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); + let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; + Err(Error::ResponseError(local_var_error)) + } +} + +pub async fn org_list_user_orgs(configuration: &configuration::Configuration, username: &str, page: Option, limit: Option) -> Result, Error> { + let local_var_configuration = configuration; + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!("{}/users/{username}/orgs", local_var_configuration.base_path, username=crate::apis::urlencode(username)); + let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str()); + + if let Some(ref local_var_str) = page { + local_var_req_builder = local_var_req_builder.query(&[("page", &local_var_str.to_string())]); + } + if let Some(ref local_var_str) = limit { + local_var_req_builder = local_var_req_builder.query(&[("limit", &local_var_str.to_string())]); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.query(&[("access_token", local_var_value)]); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.query(&[("sudo", local_var_value)]); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.query(&[("token", local_var_value)]); + } + if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { + local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("Authorization", local_var_value); + }; + if let Some(ref local_var_auth_conf) = local_var_configuration.basic_auth { + local_var_req_builder = local_var_req_builder.basic_auth(local_var_auth_conf.0.to_owned(), local_var_auth_conf.1.to_owned()); + }; + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("Sudo", local_var_value); + }; + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("X-GITEA-OTP", local_var_value); + }; + + let local_var_req = local_var_req_builder.build()?; + let local_var_resp = local_var_client.execute(local_var_req).await?; + + let local_var_status = local_var_resp.status(); + let local_var_content = local_var_resp.text().await?; + + if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + serde_json::from_str(&local_var_content).map_err(Error::from) + } else { + let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); + let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; + Err(Error::ResponseError(local_var_error)) + } +} + +pub async fn org_publicize_member(configuration: &configuration::Configuration, org: &str, username: &str) -> Result<(), Error> { + let local_var_configuration = configuration; + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!("{}/orgs/{org}/public_members/{username}", local_var_configuration.base_path, org=crate::apis::urlencode(org), username=crate::apis::urlencode(username)); + let mut local_var_req_builder = local_var_client.request(reqwest::Method::PUT, local_var_uri_str.as_str()); + + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.query(&[("access_token", local_var_value)]); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.query(&[("sudo", local_var_value)]); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.query(&[("token", local_var_value)]); + } + if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { + local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("Authorization", local_var_value); + }; + if let Some(ref local_var_auth_conf) = local_var_configuration.basic_auth { + local_var_req_builder = local_var_req_builder.basic_auth(local_var_auth_conf.0.to_owned(), local_var_auth_conf.1.to_owned()); + }; + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("Sudo", local_var_value); + }; + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("X-GITEA-OTP", local_var_value); + }; + + let local_var_req = local_var_req_builder.build()?; + let local_var_resp = local_var_client.execute(local_var_req).await?; + + let local_var_status = local_var_resp.status(); + let local_var_content = local_var_resp.text().await?; + + if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + Ok(()) + } else { + let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); + let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; + Err(Error::ResponseError(local_var_error)) + } +} + +pub async fn org_remove_team_member(configuration: &configuration::Configuration, id: i64, username: &str) -> Result<(), Error> { + let local_var_configuration = configuration; + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!("{}/teams/{id}/members/{username}", local_var_configuration.base_path, id=id, username=crate::apis::urlencode(username)); + let mut local_var_req_builder = local_var_client.request(reqwest::Method::DELETE, local_var_uri_str.as_str()); + + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.query(&[("access_token", local_var_value)]); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.query(&[("sudo", local_var_value)]); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.query(&[("token", local_var_value)]); + } + if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { + local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("Authorization", local_var_value); + }; + if let Some(ref local_var_auth_conf) = local_var_configuration.basic_auth { + local_var_req_builder = local_var_req_builder.basic_auth(local_var_auth_conf.0.to_owned(), local_var_auth_conf.1.to_owned()); + }; + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("Sudo", local_var_value); + }; + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("X-GITEA-OTP", local_var_value); + }; + + let local_var_req = local_var_req_builder.build()?; + let local_var_resp = local_var_client.execute(local_var_req).await?; + + let local_var_status = local_var_resp.status(); + let local_var_content = local_var_resp.text().await?; + + if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + Ok(()) + } else { + let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); + let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; + Err(Error::ResponseError(local_var_error)) + } +} + +/// This does not delete the repository, it only removes the repository from the team. +pub async fn org_remove_team_repository(configuration: &configuration::Configuration, id: i64, org: &str, repo: &str) -> Result<(), Error> { + let local_var_configuration = configuration; + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!("{}/teams/{id}/repos/{org}/{repo}", local_var_configuration.base_path, id=id, org=crate::apis::urlencode(org), repo=crate::apis::urlencode(repo)); + let mut local_var_req_builder = local_var_client.request(reqwest::Method::DELETE, local_var_uri_str.as_str()); + + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.query(&[("access_token", local_var_value)]); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.query(&[("sudo", local_var_value)]); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.query(&[("token", local_var_value)]); + } + if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { + local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("Authorization", local_var_value); + }; + if let Some(ref local_var_auth_conf) = local_var_configuration.basic_auth { + local_var_req_builder = local_var_req_builder.basic_auth(local_var_auth_conf.0.to_owned(), local_var_auth_conf.1.to_owned()); + }; + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("Sudo", local_var_value); + }; + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("X-GITEA-OTP", local_var_value); + }; + + let local_var_req = local_var_req_builder.build()?; + let local_var_resp = local_var_client.execute(local_var_req).await?; + + let local_var_status = local_var_resp.status(); + let local_var_content = local_var_resp.text().await?; + + if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + Ok(()) + } else { + let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); + let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; + Err(Error::ResponseError(local_var_error)) + } +} + +pub async fn team_search(configuration: &configuration::Configuration, org: &str, q: Option<&str>, include_desc: Option, page: Option, limit: Option) -> Result> { + let local_var_configuration = configuration; + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!("{}/orgs/{org}/teams/search", local_var_configuration.base_path, org=crate::apis::urlencode(org)); + let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str()); + + if let Some(ref local_var_str) = q { + local_var_req_builder = local_var_req_builder.query(&[("q", &local_var_str.to_string())]); + } + if let Some(ref local_var_str) = include_desc { + local_var_req_builder = local_var_req_builder.query(&[("include_desc", &local_var_str.to_string())]); + } + if let Some(ref local_var_str) = page { + local_var_req_builder = local_var_req_builder.query(&[("page", &local_var_str.to_string())]); + } + if let Some(ref local_var_str) = limit { + local_var_req_builder = local_var_req_builder.query(&[("limit", &local_var_str.to_string())]); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.query(&[("access_token", local_var_value)]); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.query(&[("sudo", local_var_value)]); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.query(&[("token", local_var_value)]); + } + if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { + local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("Authorization", local_var_value); + }; + if let Some(ref local_var_auth_conf) = local_var_configuration.basic_auth { + local_var_req_builder = local_var_req_builder.basic_auth(local_var_auth_conf.0.to_owned(), local_var_auth_conf.1.to_owned()); + }; + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("Sudo", local_var_value); + }; + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("X-GITEA-OTP", local_var_value); + }; + + let local_var_req = local_var_req_builder.build()?; + let local_var_resp = local_var_client.execute(local_var_req).await?; + + let local_var_status = local_var_resp.status(); + let local_var_content = local_var_resp.text().await?; + + if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + serde_json::from_str(&local_var_content).map_err(Error::from) + } else { + let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); + let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; + Err(Error::ResponseError(local_var_error)) + } +} + diff --git a/crates/gitea_raw_client/src/apis/package_api.rs b/crates/gitea_raw_client/src/apis/package_api.rs new file mode 100644 index 0000000..833af93 --- /dev/null +++ b/crates/gitea_raw_client/src/apis/package_api.rs @@ -0,0 +1,373 @@ +/* + * Gitea API. + * + * This documentation describes the Gitea API. + * + * The version of the OpenAPI document: 1.17.3 + * + * Generated by: https://openapi-generator.tech + */ + + +use reqwest; + +use crate::apis::ResponseContent; +use super::{Error, configuration}; + + +/// struct for typed errors of method [`delete_package`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum DeletePackageError { + Status404(), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`get_package`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum GetPackageError { + Status404(), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`list_package_files`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum ListPackageFilesError { + Status404(), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`list_packages`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum ListPackagesError { + UnknownValue(serde_json::Value), +} + + +pub async fn delete_package(configuration: &configuration::Configuration, owner: &str, r#type: &str, name: &str, version: &str) -> Result<(), Error> { + let local_var_configuration = configuration; + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!("{}/packages/{owner}/{type}/{name}/{version}", local_var_configuration.base_path, owner=crate::apis::urlencode(owner), type=crate::apis::urlencode(r#type), name=crate::apis::urlencode(name), version=crate::apis::urlencode(version)); + let mut local_var_req_builder = local_var_client.request(reqwest::Method::DELETE, local_var_uri_str.as_str()); + + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.query(&[("access_token", local_var_value)]); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.query(&[("sudo", local_var_value)]); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.query(&[("token", local_var_value)]); + } + if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { + local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("Authorization", local_var_value); + }; + if let Some(ref local_var_auth_conf) = local_var_configuration.basic_auth { + local_var_req_builder = local_var_req_builder.basic_auth(local_var_auth_conf.0.to_owned(), local_var_auth_conf.1.to_owned()); + }; + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("Sudo", local_var_value); + }; + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("X-GITEA-OTP", local_var_value); + }; + + let local_var_req = local_var_req_builder.build()?; + let local_var_resp = local_var_client.execute(local_var_req).await?; + + let local_var_status = local_var_resp.status(); + let local_var_content = local_var_resp.text().await?; + + if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + Ok(()) + } else { + let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); + let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; + Err(Error::ResponseError(local_var_error)) + } +} + +pub async fn get_package(configuration: &configuration::Configuration, owner: &str, r#type: &str, name: &str, version: &str) -> Result> { + let local_var_configuration = configuration; + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!("{}/packages/{owner}/{type}/{name}/{version}", local_var_configuration.base_path, owner=crate::apis::urlencode(owner), type=crate::apis::urlencode(r#type), name=crate::apis::urlencode(name), version=crate::apis::urlencode(version)); + let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str()); + + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.query(&[("access_token", local_var_value)]); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.query(&[("sudo", local_var_value)]); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.query(&[("token", local_var_value)]); + } + if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { + local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("Authorization", local_var_value); + }; + if let Some(ref local_var_auth_conf) = local_var_configuration.basic_auth { + local_var_req_builder = local_var_req_builder.basic_auth(local_var_auth_conf.0.to_owned(), local_var_auth_conf.1.to_owned()); + }; + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("Sudo", local_var_value); + }; + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("X-GITEA-OTP", local_var_value); + }; + + let local_var_req = local_var_req_builder.build()?; + let local_var_resp = local_var_client.execute(local_var_req).await?; + + let local_var_status = local_var_resp.status(); + let local_var_content = local_var_resp.text().await?; + + if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + serde_json::from_str(&local_var_content).map_err(Error::from) + } else { + let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); + let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; + Err(Error::ResponseError(local_var_error)) + } +} + +pub async fn list_package_files(configuration: &configuration::Configuration, owner: &str, r#type: &str, name: &str, version: &str) -> Result, Error> { + let local_var_configuration = configuration; + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!("{}/packages/{owner}/{type}/{name}/{version}/files", local_var_configuration.base_path, owner=crate::apis::urlencode(owner), type=crate::apis::urlencode(r#type), name=crate::apis::urlencode(name), version=crate::apis::urlencode(version)); + let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str()); + + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.query(&[("access_token", local_var_value)]); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.query(&[("sudo", local_var_value)]); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.query(&[("token", local_var_value)]); + } + if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { + local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("Authorization", local_var_value); + }; + if let Some(ref local_var_auth_conf) = local_var_configuration.basic_auth { + local_var_req_builder = local_var_req_builder.basic_auth(local_var_auth_conf.0.to_owned(), local_var_auth_conf.1.to_owned()); + }; + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("Sudo", local_var_value); + }; + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("X-GITEA-OTP", local_var_value); + }; + + let local_var_req = local_var_req_builder.build()?; + let local_var_resp = local_var_client.execute(local_var_req).await?; + + let local_var_status = local_var_resp.status(); + let local_var_content = local_var_resp.text().await?; + + if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + serde_json::from_str(&local_var_content).map_err(Error::from) + } else { + let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); + let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; + Err(Error::ResponseError(local_var_error)) + } +} + +pub async fn list_packages(configuration: &configuration::Configuration, owner: &str, page: Option, limit: Option, r#type: Option<&str>, q: Option<&str>) -> Result, Error> { + let local_var_configuration = configuration; + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!("{}/packages/{owner}", local_var_configuration.base_path, owner=crate::apis::urlencode(owner)); + let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str()); + + if let Some(ref local_var_str) = page { + local_var_req_builder = local_var_req_builder.query(&[("page", &local_var_str.to_string())]); + } + if let Some(ref local_var_str) = limit { + local_var_req_builder = local_var_req_builder.query(&[("limit", &local_var_str.to_string())]); + } + if let Some(ref local_var_str) = r#type { + local_var_req_builder = local_var_req_builder.query(&[("type", &local_var_str.to_string())]); + } + if let Some(ref local_var_str) = q { + local_var_req_builder = local_var_req_builder.query(&[("q", &local_var_str.to_string())]); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.query(&[("access_token", local_var_value)]); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.query(&[("sudo", local_var_value)]); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.query(&[("token", local_var_value)]); + } + if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { + local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("Authorization", local_var_value); + }; + if let Some(ref local_var_auth_conf) = local_var_configuration.basic_auth { + local_var_req_builder = local_var_req_builder.basic_auth(local_var_auth_conf.0.to_owned(), local_var_auth_conf.1.to_owned()); + }; + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("Sudo", local_var_value); + }; + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("X-GITEA-OTP", local_var_value); + }; + + let local_var_req = local_var_req_builder.build()?; + let local_var_resp = local_var_client.execute(local_var_req).await?; + + let local_var_status = local_var_resp.status(); + let local_var_content = local_var_resp.text().await?; + + if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + serde_json::from_str(&local_var_content).map_err(Error::from) + } else { + let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); + let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; + Err(Error::ResponseError(local_var_error)) + } +} + diff --git a/crates/gitea_raw_client/src/apis/repository_api.rs b/crates/gitea_raw_client/src/apis/repository_api.rs new file mode 100644 index 0000000..c195813 --- /dev/null +++ b/crates/gitea_raw_client/src/apis/repository_api.rs @@ -0,0 +1,11360 @@ +/* + * Gitea API. + * + * This documentation describes the Gitea API. + * + * The version of the OpenAPI document: 1.17.3 + * + * Generated by: https://openapi-generator.tech + */ + + +use reqwest; + +use crate::apis::ResponseContent; +use super::{Error, configuration}; + + +/// struct for typed errors of method [`accept_repo_transfer`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum AcceptRepoTransferError { + Status403(), + Status404(), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`create_current_user_repo`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum CreateCurrentUserRepoError { + Status409(), + Status422(), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`create_fork`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum CreateForkError { + Status403(), + Status409(), + Status422(), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`generate_repo`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum GenerateRepoError { + Status403(), + Status404(), + Status409(), + Status422(), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`get_annotated_tag`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum GetAnnotatedTagError { + Status400(), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`get_blob`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum GetBlobError { + Status400(), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`get_tree`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum GetTreeError { + Status400(), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`list_forks`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum ListForksError { + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`reject_repo_transfer`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum RejectRepoTransferError { + Status403(), + Status404(), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`repo_add_collaborator`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum RepoAddCollaboratorError { + Status422(), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`repo_add_team`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum RepoAddTeamError { + Status405(), + Status422(), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`repo_add_topic`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum RepoAddTopicError { + Status422(), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`repo_apply_diff_patch`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum RepoApplyDiffPatchError { + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`repo_cancel_scheduled_auto_merge`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum RepoCancelScheduledAutoMergeError { + Status403(), + Status404(), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`repo_check_collaborator`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum RepoCheckCollaboratorError { + Status404(), + Status422(), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`repo_check_team`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum RepoCheckTeamError { + Status404(), + Status405(), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`repo_create_branch`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum RepoCreateBranchError { + Status404(), + Status409(), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`repo_create_branch_protection`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum RepoCreateBranchProtectionError { + Status403(), + Status404(), + Status422(), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`repo_create_file`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum RepoCreateFileError { + Status403(), + Status404(), + Status422(), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`repo_create_hook`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum RepoCreateHookError { + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`repo_create_key`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum RepoCreateKeyError { + Status422(), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`repo_create_pull_request`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum RepoCreatePullRequestError { + Status409(), + Status422(), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`repo_create_pull_review`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum RepoCreatePullReviewError { + Status404(), + Status422(), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`repo_create_pull_review_requests`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum RepoCreatePullReviewRequestsError { + Status404(), + Status422(), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`repo_create_release`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum RepoCreateReleaseError { + Status404(), + Status409(), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`repo_create_release_attachment`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum RepoCreateReleaseAttachmentError { + Status400(), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`repo_create_status`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum RepoCreateStatusError { + Status400(), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`repo_create_tag`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum RepoCreateTagError { + Status404(), + Status405(), + Status409(), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`repo_create_wiki_page`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum RepoCreateWikiPageError { + Status400(), + Status403(), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`repo_delete`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum RepoDeleteError { + Status403(), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`repo_delete_branch`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum RepoDeleteBranchError { + Status403(), + Status404(), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`repo_delete_branch_protection`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum RepoDeleteBranchProtectionError { + Status404(), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`repo_delete_collaborator`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum RepoDeleteCollaboratorError { + Status422(), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`repo_delete_file`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum RepoDeleteFileError { + Status400(), + Status403(), + Status404(), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`repo_delete_git_hook`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum RepoDeleteGitHookError { + Status404(), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`repo_delete_hook`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum RepoDeleteHookError { + Status404(), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`repo_delete_key`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum RepoDeleteKeyError { + Status403(), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`repo_delete_pull_review`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum RepoDeletePullReviewError { + Status403(), + Status404(), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`repo_delete_pull_review_requests`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum RepoDeletePullReviewRequestsError { + Status404(), + Status422(), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`repo_delete_release`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum RepoDeleteReleaseError { + Status404(), + Status405(), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`repo_delete_release_attachment`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum RepoDeleteReleaseAttachmentError { + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`repo_delete_release_by_tag`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum RepoDeleteReleaseByTagError { + Status404(), + Status405(), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`repo_delete_tag`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum RepoDeleteTagError { + Status404(), + Status405(), + Status409(), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`repo_delete_team`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum RepoDeleteTeamError { + Status405(), + Status422(), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`repo_delete_topic`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum RepoDeleteTopicError { + Status422(), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`repo_delete_wiki_page`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum RepoDeleteWikiPageError { + Status403(), + Status404(), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`repo_dismiss_pull_review`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum RepoDismissPullReviewError { + Status403(), + Status422(), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`repo_download_commit_diff_or_patch`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum RepoDownloadCommitDiffOrPatchError { + Status404(), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`repo_download_pull_diff_or_patch`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum RepoDownloadPullDiffOrPatchError { + Status404(), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`repo_edit`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum RepoEditError { + Status403(), + Status422(), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`repo_edit_branch_protection`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum RepoEditBranchProtectionError { + Status404(), + Status422(), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`repo_edit_git_hook`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum RepoEditGitHookError { + Status404(), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`repo_edit_hook`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum RepoEditHookError { + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`repo_edit_pull_request`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum RepoEditPullRequestError { + Status403(), + Status409(), + Status412(), + Status422(), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`repo_edit_release`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum RepoEditReleaseError { + Status404(), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`repo_edit_release_attachment`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum RepoEditReleaseAttachmentError { + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`repo_edit_wiki_page`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum RepoEditWikiPageError { + Status400(), + Status403(), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`repo_get`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum RepoGetError { + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`repo_get_all_commits`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum RepoGetAllCommitsError { + Status404(), + Status409(crate::models::ApiError), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`repo_get_archive`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum RepoGetArchiveError { + Status404(), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`repo_get_assignees`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum RepoGetAssigneesError { + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`repo_get_branch`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum RepoGetBranchError { + Status404(), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`repo_get_branch_protection`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum RepoGetBranchProtectionError { + Status404(), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`repo_get_by_id`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum RepoGetByIdError { + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`repo_get_combined_status_by_ref`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum RepoGetCombinedStatusByRefError { + Status400(), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`repo_get_contents`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum RepoGetContentsError { + Status404(), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`repo_get_contents_list`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum RepoGetContentsListError { + Status404(), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`repo_get_editor_config`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum RepoGetEditorConfigError { + Status404(), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`repo_get_git_hook`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum RepoGetGitHookError { + Status404(), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`repo_get_hook`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum RepoGetHookError { + Status404(), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`repo_get_issue_templates`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum RepoGetIssueTemplatesError { + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`repo_get_key`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum RepoGetKeyError { + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`repo_get_languages`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum RepoGetLanguagesError { + Status404(), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`repo_get_note`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum RepoGetNoteError { + Status404(), + Status422(), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`repo_get_pull_request`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum RepoGetPullRequestError { + Status404(), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`repo_get_pull_request_commits`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum RepoGetPullRequestCommitsError { + Status404(), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`repo_get_pull_review`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum RepoGetPullReviewError { + Status404(), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`repo_get_pull_review_comments`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum RepoGetPullReviewCommentsError { + Status404(), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`repo_get_raw_file`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum RepoGetRawFileError { + Status404(), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`repo_get_raw_file_or_lfs`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum RepoGetRawFileOrLfsError { + Status404(), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`repo_get_release`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum RepoGetReleaseError { + Status404(), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`repo_get_release_attachment`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum RepoGetReleaseAttachmentError { + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`repo_get_release_by_tag`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum RepoGetReleaseByTagError { + Status404(), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`repo_get_repo_permissions`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum RepoGetRepoPermissionsError { + Status403(), + Status404(), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`repo_get_reviewers`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum RepoGetReviewersError { + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`repo_get_single_commit`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum RepoGetSingleCommitError { + Status404(), + Status422(), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`repo_get_tag`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum RepoGetTagError { + Status404(), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`repo_get_wiki_page`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum RepoGetWikiPageError { + Status404(), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`repo_get_wiki_page_revisions`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum RepoGetWikiPageRevisionsError { + Status404(), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`repo_get_wiki_pages`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum RepoGetWikiPagesError { + Status404(), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`repo_list_all_git_refs`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum RepoListAllGitRefsError { + Status404(), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`repo_list_branch_protection`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum RepoListBranchProtectionError { + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`repo_list_branches`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum RepoListBranchesError { + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`repo_list_collaborators`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum RepoListCollaboratorsError { + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`repo_list_git_hooks`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum RepoListGitHooksError { + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`repo_list_git_refs`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum RepoListGitRefsError { + Status404(), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`repo_list_hooks`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum RepoListHooksError { + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`repo_list_keys`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum RepoListKeysError { + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`repo_list_pull_requests`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum RepoListPullRequestsError { + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`repo_list_pull_reviews`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum RepoListPullReviewsError { + Status404(), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`repo_list_release_attachments`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum RepoListReleaseAttachmentsError { + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`repo_list_releases`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum RepoListReleasesError { + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`repo_list_stargazers`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum RepoListStargazersError { + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`repo_list_statuses`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum RepoListStatusesError { + Status400(), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`repo_list_statuses_by_ref`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum RepoListStatusesByRefError { + Status400(), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`repo_list_subscribers`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum RepoListSubscribersError { + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`repo_list_tags`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum RepoListTagsError { + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`repo_list_teams`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum RepoListTeamsError { + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`repo_list_topics`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum RepoListTopicsError { + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`repo_merge_pull_request`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum RepoMergePullRequestError { + Status405(), + Status409(), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`repo_migrate`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum RepoMigrateError { + Status403(), + Status409(), + Status422(), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`repo_mirror_sync`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum RepoMirrorSyncError { + Status403(), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`repo_pull_request_is_merged`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum RepoPullRequestIsMergedError { + Status404(), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`repo_search`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum RepoSearchError { + Status422(), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`repo_signing_key`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum RepoSigningKeyError { + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`repo_submit_pull_review`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum RepoSubmitPullReviewError { + Status404(), + Status422(), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`repo_test_hook`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum RepoTestHookError { + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`repo_tracked_times`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum RepoTrackedTimesError { + Status400(), + Status403(), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`repo_transfer`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum RepoTransferError { + Status403(), + Status404(), + Status422(), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`repo_un_dismiss_pull_review`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum RepoUnDismissPullReviewError { + Status403(), + Status422(), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`repo_update_file`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum RepoUpdateFileError { + Status403(), + Status404(), + Status422(), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`repo_update_pull_request`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum RepoUpdatePullRequestError { + Status403(), + Status404(), + Status409(), + Status422(), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`repo_update_topics`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum RepoUpdateTopicsError { + Status422(), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`topic_search`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum TopicSearchError { + Status403(), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`user_current_check_subscription`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum UserCurrentCheckSubscriptionError { + Status404(), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`user_current_delete_subscription`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum UserCurrentDeleteSubscriptionError { + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`user_current_put_subscription`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum UserCurrentPutSubscriptionError { + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`user_tracked_times`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum UserTrackedTimesError { + Status400(), + Status403(), + UnknownValue(serde_json::Value), +} + + +pub async fn accept_repo_transfer(configuration: &configuration::Configuration, owner: &str, repo: &str) -> Result> { + let local_var_configuration = configuration; + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!("{}/repos/{owner}/{repo}/transfer/accept", local_var_configuration.base_path, owner=crate::apis::urlencode(owner), repo=crate::apis::urlencode(repo)); + let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str()); + + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.query(&[("access_token", local_var_value)]); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.query(&[("sudo", local_var_value)]); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.query(&[("token", local_var_value)]); + } + if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { + local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("Authorization", local_var_value); + }; + if let Some(ref local_var_auth_conf) = local_var_configuration.basic_auth { + local_var_req_builder = local_var_req_builder.basic_auth(local_var_auth_conf.0.to_owned(), local_var_auth_conf.1.to_owned()); + }; + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("Sudo", local_var_value); + }; + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("X-GITEA-OTP", local_var_value); + }; + + let local_var_req = local_var_req_builder.build()?; + let local_var_resp = local_var_client.execute(local_var_req).await?; + + let local_var_status = local_var_resp.status(); + let local_var_content = local_var_resp.text().await?; + + if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + serde_json::from_str(&local_var_content).map_err(Error::from) + } else { + let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); + let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; + Err(Error::ResponseError(local_var_error)) + } +} + +pub async fn create_current_user_repo(configuration: &configuration::Configuration, body: Option) -> Result> { + let local_var_configuration = configuration; + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!("{}/user/repos", local_var_configuration.base_path); + let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str()); + + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.query(&[("access_token", local_var_value)]); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.query(&[("sudo", local_var_value)]); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.query(&[("token", local_var_value)]); + } + if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { + local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("Authorization", local_var_value); + }; + if let Some(ref local_var_auth_conf) = local_var_configuration.basic_auth { + local_var_req_builder = local_var_req_builder.basic_auth(local_var_auth_conf.0.to_owned(), local_var_auth_conf.1.to_owned()); + }; + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("Sudo", local_var_value); + }; + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("X-GITEA-OTP", local_var_value); + }; + local_var_req_builder = local_var_req_builder.json(&body); + + let local_var_req = local_var_req_builder.build()?; + let local_var_resp = local_var_client.execute(local_var_req).await?; + + let local_var_status = local_var_resp.status(); + let local_var_content = local_var_resp.text().await?; + + if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + serde_json::from_str(&local_var_content).map_err(Error::from) + } else { + let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); + let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; + Err(Error::ResponseError(local_var_error)) + } +} + +pub async fn create_fork(configuration: &configuration::Configuration, owner: &str, repo: &str, body: Option) -> Result> { + let local_var_configuration = configuration; + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!("{}/repos/{owner}/{repo}/forks", local_var_configuration.base_path, owner=crate::apis::urlencode(owner), repo=crate::apis::urlencode(repo)); + let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str()); + + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.query(&[("access_token", local_var_value)]); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.query(&[("sudo", local_var_value)]); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.query(&[("token", local_var_value)]); + } + if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { + local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("Authorization", local_var_value); + }; + if let Some(ref local_var_auth_conf) = local_var_configuration.basic_auth { + local_var_req_builder = local_var_req_builder.basic_auth(local_var_auth_conf.0.to_owned(), local_var_auth_conf.1.to_owned()); + }; + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("Sudo", local_var_value); + }; + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("X-GITEA-OTP", local_var_value); + }; + local_var_req_builder = local_var_req_builder.json(&body); + + let local_var_req = local_var_req_builder.build()?; + let local_var_resp = local_var_client.execute(local_var_req).await?; + + let local_var_status = local_var_resp.status(); + let local_var_content = local_var_resp.text().await?; + + if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + serde_json::from_str(&local_var_content).map_err(Error::from) + } else { + let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); + let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; + Err(Error::ResponseError(local_var_error)) + } +} + +pub async fn generate_repo(configuration: &configuration::Configuration, template_owner: &str, template_repo: &str, body: Option) -> Result> { + let local_var_configuration = configuration; + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!("{}/repos/{template_owner}/{template_repo}/generate", local_var_configuration.base_path, template_owner=crate::apis::urlencode(template_owner), template_repo=crate::apis::urlencode(template_repo)); + let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str()); + + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.query(&[("access_token", local_var_value)]); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.query(&[("sudo", local_var_value)]); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.query(&[("token", local_var_value)]); + } + if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { + local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("Authorization", local_var_value); + }; + if let Some(ref local_var_auth_conf) = local_var_configuration.basic_auth { + local_var_req_builder = local_var_req_builder.basic_auth(local_var_auth_conf.0.to_owned(), local_var_auth_conf.1.to_owned()); + }; + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("Sudo", local_var_value); + }; + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("X-GITEA-OTP", local_var_value); + }; + local_var_req_builder = local_var_req_builder.json(&body); + + let local_var_req = local_var_req_builder.build()?; + let local_var_resp = local_var_client.execute(local_var_req).await?; + + let local_var_status = local_var_resp.status(); + let local_var_content = local_var_resp.text().await?; + + if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + serde_json::from_str(&local_var_content).map_err(Error::from) + } else { + let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); + let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; + Err(Error::ResponseError(local_var_error)) + } +} + +pub async fn get_annotated_tag(configuration: &configuration::Configuration, owner: &str, repo: &str, sha: &str) -> Result> { + let local_var_configuration = configuration; + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!("{}/repos/{owner}/{repo}/git/tags/{sha}", local_var_configuration.base_path, owner=crate::apis::urlencode(owner), repo=crate::apis::urlencode(repo), sha=crate::apis::urlencode(sha)); + let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str()); + + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.query(&[("access_token", local_var_value)]); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.query(&[("sudo", local_var_value)]); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.query(&[("token", local_var_value)]); + } + if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { + local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("Authorization", local_var_value); + }; + if let Some(ref local_var_auth_conf) = local_var_configuration.basic_auth { + local_var_req_builder = local_var_req_builder.basic_auth(local_var_auth_conf.0.to_owned(), local_var_auth_conf.1.to_owned()); + }; + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("Sudo", local_var_value); + }; + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("X-GITEA-OTP", local_var_value); + }; + + let local_var_req = local_var_req_builder.build()?; + let local_var_resp = local_var_client.execute(local_var_req).await?; + + let local_var_status = local_var_resp.status(); + let local_var_content = local_var_resp.text().await?; + + if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + serde_json::from_str(&local_var_content).map_err(Error::from) + } else { + let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); + let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; + Err(Error::ResponseError(local_var_error)) + } +} + +pub async fn get_blob(configuration: &configuration::Configuration, owner: &str, repo: &str, sha: &str) -> Result> { + let local_var_configuration = configuration; + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!("{}/repos/{owner}/{repo}/git/blobs/{sha}", local_var_configuration.base_path, owner=crate::apis::urlencode(owner), repo=crate::apis::urlencode(repo), sha=crate::apis::urlencode(sha)); + let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str()); + + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.query(&[("access_token", local_var_value)]); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.query(&[("sudo", local_var_value)]); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.query(&[("token", local_var_value)]); + } + if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { + local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("Authorization", local_var_value); + }; + if let Some(ref local_var_auth_conf) = local_var_configuration.basic_auth { + local_var_req_builder = local_var_req_builder.basic_auth(local_var_auth_conf.0.to_owned(), local_var_auth_conf.1.to_owned()); + }; + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("Sudo", local_var_value); + }; + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("X-GITEA-OTP", local_var_value); + }; + + let local_var_req = local_var_req_builder.build()?; + let local_var_resp = local_var_client.execute(local_var_req).await?; + + let local_var_status = local_var_resp.status(); + let local_var_content = local_var_resp.text().await?; + + if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + serde_json::from_str(&local_var_content).map_err(Error::from) + } else { + let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); + let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; + Err(Error::ResponseError(local_var_error)) + } +} + +pub async fn get_tree(configuration: &configuration::Configuration, owner: &str, repo: &str, sha: &str, recursive: Option, page: Option, per_page: Option) -> Result> { + let local_var_configuration = configuration; + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!("{}/repos/{owner}/{repo}/git/trees/{sha}", local_var_configuration.base_path, owner=crate::apis::urlencode(owner), repo=crate::apis::urlencode(repo), sha=crate::apis::urlencode(sha)); + let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str()); + + if let Some(ref local_var_str) = recursive { + local_var_req_builder = local_var_req_builder.query(&[("recursive", &local_var_str.to_string())]); + } + if let Some(ref local_var_str) = page { + local_var_req_builder = local_var_req_builder.query(&[("page", &local_var_str.to_string())]); + } + if let Some(ref local_var_str) = per_page { + local_var_req_builder = local_var_req_builder.query(&[("per_page", &local_var_str.to_string())]); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.query(&[("access_token", local_var_value)]); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.query(&[("sudo", local_var_value)]); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.query(&[("token", local_var_value)]); + } + if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { + local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("Authorization", local_var_value); + }; + if let Some(ref local_var_auth_conf) = local_var_configuration.basic_auth { + local_var_req_builder = local_var_req_builder.basic_auth(local_var_auth_conf.0.to_owned(), local_var_auth_conf.1.to_owned()); + }; + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("Sudo", local_var_value); + }; + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("X-GITEA-OTP", local_var_value); + }; + + let local_var_req = local_var_req_builder.build()?; + let local_var_resp = local_var_client.execute(local_var_req).await?; + + let local_var_status = local_var_resp.status(); + let local_var_content = local_var_resp.text().await?; + + if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + serde_json::from_str(&local_var_content).map_err(Error::from) + } else { + let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); + let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; + Err(Error::ResponseError(local_var_error)) + } +} + +pub async fn list_forks(configuration: &configuration::Configuration, owner: &str, repo: &str, page: Option, limit: Option) -> Result, Error> { + let local_var_configuration = configuration; + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!("{}/repos/{owner}/{repo}/forks", local_var_configuration.base_path, owner=crate::apis::urlencode(owner), repo=crate::apis::urlencode(repo)); + let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str()); + + if let Some(ref local_var_str) = page { + local_var_req_builder = local_var_req_builder.query(&[("page", &local_var_str.to_string())]); + } + if let Some(ref local_var_str) = limit { + local_var_req_builder = local_var_req_builder.query(&[("limit", &local_var_str.to_string())]); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.query(&[("access_token", local_var_value)]); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.query(&[("sudo", local_var_value)]); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.query(&[("token", local_var_value)]); + } + if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { + local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("Authorization", local_var_value); + }; + if let Some(ref local_var_auth_conf) = local_var_configuration.basic_auth { + local_var_req_builder = local_var_req_builder.basic_auth(local_var_auth_conf.0.to_owned(), local_var_auth_conf.1.to_owned()); + }; + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("Sudo", local_var_value); + }; + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("X-GITEA-OTP", local_var_value); + }; + + let local_var_req = local_var_req_builder.build()?; + let local_var_resp = local_var_client.execute(local_var_req).await?; + + let local_var_status = local_var_resp.status(); + let local_var_content = local_var_resp.text().await?; + + if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + serde_json::from_str(&local_var_content).map_err(Error::from) + } else { + let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); + let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; + Err(Error::ResponseError(local_var_error)) + } +} + +pub async fn reject_repo_transfer(configuration: &configuration::Configuration, owner: &str, repo: &str) -> Result> { + let local_var_configuration = configuration; + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!("{}/repos/{owner}/{repo}/transfer/reject", local_var_configuration.base_path, owner=crate::apis::urlencode(owner), repo=crate::apis::urlencode(repo)); + let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str()); + + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.query(&[("access_token", local_var_value)]); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.query(&[("sudo", local_var_value)]); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.query(&[("token", local_var_value)]); + } + if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { + local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("Authorization", local_var_value); + }; + if let Some(ref local_var_auth_conf) = local_var_configuration.basic_auth { + local_var_req_builder = local_var_req_builder.basic_auth(local_var_auth_conf.0.to_owned(), local_var_auth_conf.1.to_owned()); + }; + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("Sudo", local_var_value); + }; + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("X-GITEA-OTP", local_var_value); + }; + + let local_var_req = local_var_req_builder.build()?; + let local_var_resp = local_var_client.execute(local_var_req).await?; + + let local_var_status = local_var_resp.status(); + let local_var_content = local_var_resp.text().await?; + + if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + serde_json::from_str(&local_var_content).map_err(Error::from) + } else { + let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); + let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; + Err(Error::ResponseError(local_var_error)) + } +} + +pub async fn repo_add_collaborator(configuration: &configuration::Configuration, owner: &str, repo: &str, collaborator: &str, body: Option) -> Result<(), Error> { + let local_var_configuration = configuration; + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!("{}/repos/{owner}/{repo}/collaborators/{collaborator}", local_var_configuration.base_path, owner=crate::apis::urlencode(owner), repo=crate::apis::urlencode(repo), collaborator=crate::apis::urlencode(collaborator)); + let mut local_var_req_builder = local_var_client.request(reqwest::Method::PUT, local_var_uri_str.as_str()); + + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.query(&[("access_token", local_var_value)]); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.query(&[("sudo", local_var_value)]); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.query(&[("token", local_var_value)]); + } + if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { + local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("Authorization", local_var_value); + }; + if let Some(ref local_var_auth_conf) = local_var_configuration.basic_auth { + local_var_req_builder = local_var_req_builder.basic_auth(local_var_auth_conf.0.to_owned(), local_var_auth_conf.1.to_owned()); + }; + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("Sudo", local_var_value); + }; + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("X-GITEA-OTP", local_var_value); + }; + local_var_req_builder = local_var_req_builder.json(&body); + + let local_var_req = local_var_req_builder.build()?; + let local_var_resp = local_var_client.execute(local_var_req).await?; + + let local_var_status = local_var_resp.status(); + let local_var_content = local_var_resp.text().await?; + + if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + Ok(()) + } else { + let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); + let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; + Err(Error::ResponseError(local_var_error)) + } +} + +pub async fn repo_add_team(configuration: &configuration::Configuration, owner: &str, repo: &str, team: &str) -> Result<(), Error> { + let local_var_configuration = configuration; + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!("{}/repos/{owner}/{repo}/teams/{team}", local_var_configuration.base_path, owner=crate::apis::urlencode(owner), repo=crate::apis::urlencode(repo), team=crate::apis::urlencode(team)); + let mut local_var_req_builder = local_var_client.request(reqwest::Method::PUT, local_var_uri_str.as_str()); + + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.query(&[("access_token", local_var_value)]); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.query(&[("sudo", local_var_value)]); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.query(&[("token", local_var_value)]); + } + if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { + local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("Authorization", local_var_value); + }; + if let Some(ref local_var_auth_conf) = local_var_configuration.basic_auth { + local_var_req_builder = local_var_req_builder.basic_auth(local_var_auth_conf.0.to_owned(), local_var_auth_conf.1.to_owned()); + }; + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("Sudo", local_var_value); + }; + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("X-GITEA-OTP", local_var_value); + }; + + let local_var_req = local_var_req_builder.build()?; + let local_var_resp = local_var_client.execute(local_var_req).await?; + + let local_var_status = local_var_resp.status(); + let local_var_content = local_var_resp.text().await?; + + if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + Ok(()) + } else { + let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); + let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; + Err(Error::ResponseError(local_var_error)) + } +} + +pub async fn repo_add_topic(configuration: &configuration::Configuration, owner: &str, repo: &str, topic: &str) -> Result<(), Error> { + let local_var_configuration = configuration; + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!("{}/repos/{owner}/{repo}/topics/{topic}", local_var_configuration.base_path, owner=crate::apis::urlencode(owner), repo=crate::apis::urlencode(repo), topic=crate::apis::urlencode(topic)); + let mut local_var_req_builder = local_var_client.request(reqwest::Method::PUT, local_var_uri_str.as_str()); + + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.query(&[("access_token", local_var_value)]); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.query(&[("sudo", local_var_value)]); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.query(&[("token", local_var_value)]); + } + if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { + local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("Authorization", local_var_value); + }; + if let Some(ref local_var_auth_conf) = local_var_configuration.basic_auth { + local_var_req_builder = local_var_req_builder.basic_auth(local_var_auth_conf.0.to_owned(), local_var_auth_conf.1.to_owned()); + }; + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("Sudo", local_var_value); + }; + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("X-GITEA-OTP", local_var_value); + }; + + let local_var_req = local_var_req_builder.build()?; + let local_var_resp = local_var_client.execute(local_var_req).await?; + + let local_var_status = local_var_resp.status(); + let local_var_content = local_var_resp.text().await?; + + if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + Ok(()) + } else { + let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); + let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; + Err(Error::ResponseError(local_var_error)) + } +} + +pub async fn repo_apply_diff_patch(configuration: &configuration::Configuration, owner: &str, repo: &str, body: crate::models::UpdateFileOptions) -> Result> { + let local_var_configuration = configuration; + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!("{}/repos/{owner}/{repo}/diffpatch", local_var_configuration.base_path, owner=crate::apis::urlencode(owner), repo=crate::apis::urlencode(repo)); + let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str()); + + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.query(&[("access_token", local_var_value)]); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.query(&[("sudo", local_var_value)]); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.query(&[("token", local_var_value)]); + } + if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { + local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("Authorization", local_var_value); + }; + if let Some(ref local_var_auth_conf) = local_var_configuration.basic_auth { + local_var_req_builder = local_var_req_builder.basic_auth(local_var_auth_conf.0.to_owned(), local_var_auth_conf.1.to_owned()); + }; + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("Sudo", local_var_value); + }; + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("X-GITEA-OTP", local_var_value); + }; + local_var_req_builder = local_var_req_builder.json(&body); + + let local_var_req = local_var_req_builder.build()?; + let local_var_resp = local_var_client.execute(local_var_req).await?; + + let local_var_status = local_var_resp.status(); + let local_var_content = local_var_resp.text().await?; + + if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + serde_json::from_str(&local_var_content).map_err(Error::from) + } else { + let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); + let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; + Err(Error::ResponseError(local_var_error)) + } +} + +pub async fn repo_cancel_scheduled_auto_merge(configuration: &configuration::Configuration, owner: &str, repo: &str, index: i64) -> Result<(), Error> { + let local_var_configuration = configuration; + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!("{}/repos/{owner}/{repo}/pulls/{index}/merge", local_var_configuration.base_path, owner=crate::apis::urlencode(owner), repo=crate::apis::urlencode(repo), index=index); + let mut local_var_req_builder = local_var_client.request(reqwest::Method::DELETE, local_var_uri_str.as_str()); + + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.query(&[("access_token", local_var_value)]); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.query(&[("sudo", local_var_value)]); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.query(&[("token", local_var_value)]); + } + if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { + local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("Authorization", local_var_value); + }; + if let Some(ref local_var_auth_conf) = local_var_configuration.basic_auth { + local_var_req_builder = local_var_req_builder.basic_auth(local_var_auth_conf.0.to_owned(), local_var_auth_conf.1.to_owned()); + }; + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("Sudo", local_var_value); + }; + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("X-GITEA-OTP", local_var_value); + }; + + let local_var_req = local_var_req_builder.build()?; + let local_var_resp = local_var_client.execute(local_var_req).await?; + + let local_var_status = local_var_resp.status(); + let local_var_content = local_var_resp.text().await?; + + if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + Ok(()) + } else { + let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); + let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; + Err(Error::ResponseError(local_var_error)) + } +} + +pub async fn repo_check_collaborator(configuration: &configuration::Configuration, owner: &str, repo: &str, collaborator: &str) -> Result<(), Error> { + let local_var_configuration = configuration; + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!("{}/repos/{owner}/{repo}/collaborators/{collaborator}", local_var_configuration.base_path, owner=crate::apis::urlencode(owner), repo=crate::apis::urlencode(repo), collaborator=crate::apis::urlencode(collaborator)); + let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str()); + + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.query(&[("access_token", local_var_value)]); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.query(&[("sudo", local_var_value)]); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.query(&[("token", local_var_value)]); + } + if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { + local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("Authorization", local_var_value); + }; + if let Some(ref local_var_auth_conf) = local_var_configuration.basic_auth { + local_var_req_builder = local_var_req_builder.basic_auth(local_var_auth_conf.0.to_owned(), local_var_auth_conf.1.to_owned()); + }; + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("Sudo", local_var_value); + }; + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("X-GITEA-OTP", local_var_value); + }; + + let local_var_req = local_var_req_builder.build()?; + let local_var_resp = local_var_client.execute(local_var_req).await?; + + let local_var_status = local_var_resp.status(); + let local_var_content = local_var_resp.text().await?; + + if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + Ok(()) + } else { + let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); + let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; + Err(Error::ResponseError(local_var_error)) + } +} + +pub async fn repo_check_team(configuration: &configuration::Configuration, owner: &str, repo: &str, team: &str) -> Result> { + let local_var_configuration = configuration; + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!("{}/repos/{owner}/{repo}/teams/{team}", local_var_configuration.base_path, owner=crate::apis::urlencode(owner), repo=crate::apis::urlencode(repo), team=crate::apis::urlencode(team)); + let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str()); + + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.query(&[("access_token", local_var_value)]); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.query(&[("sudo", local_var_value)]); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.query(&[("token", local_var_value)]); + } + if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { + local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("Authorization", local_var_value); + }; + if let Some(ref local_var_auth_conf) = local_var_configuration.basic_auth { + local_var_req_builder = local_var_req_builder.basic_auth(local_var_auth_conf.0.to_owned(), local_var_auth_conf.1.to_owned()); + }; + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("Sudo", local_var_value); + }; + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("X-GITEA-OTP", local_var_value); + }; + + let local_var_req = local_var_req_builder.build()?; + let local_var_resp = local_var_client.execute(local_var_req).await?; + + let local_var_status = local_var_resp.status(); + let local_var_content = local_var_resp.text().await?; + + if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + serde_json::from_str(&local_var_content).map_err(Error::from) + } else { + let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); + let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; + Err(Error::ResponseError(local_var_error)) + } +} + +pub async fn repo_create_branch(configuration: &configuration::Configuration, owner: &str, repo: &str, body: Option) -> Result> { + let local_var_configuration = configuration; + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!("{}/repos/{owner}/{repo}/branches", local_var_configuration.base_path, owner=crate::apis::urlencode(owner), repo=crate::apis::urlencode(repo)); + let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str()); + + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.query(&[("access_token", local_var_value)]); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.query(&[("sudo", local_var_value)]); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.query(&[("token", local_var_value)]); + } + if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { + local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("Authorization", local_var_value); + }; + if let Some(ref local_var_auth_conf) = local_var_configuration.basic_auth { + local_var_req_builder = local_var_req_builder.basic_auth(local_var_auth_conf.0.to_owned(), local_var_auth_conf.1.to_owned()); + }; + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("Sudo", local_var_value); + }; + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("X-GITEA-OTP", local_var_value); + }; + local_var_req_builder = local_var_req_builder.json(&body); + + let local_var_req = local_var_req_builder.build()?; + let local_var_resp = local_var_client.execute(local_var_req).await?; + + let local_var_status = local_var_resp.status(); + let local_var_content = local_var_resp.text().await?; + + if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + serde_json::from_str(&local_var_content).map_err(Error::from) + } else { + let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); + let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; + Err(Error::ResponseError(local_var_error)) + } +} + +pub async fn repo_create_branch_protection(configuration: &configuration::Configuration, owner: &str, repo: &str, body: Option) -> Result> { + let local_var_configuration = configuration; + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!("{}/repos/{owner}/{repo}/branch_protections", local_var_configuration.base_path, owner=crate::apis::urlencode(owner), repo=crate::apis::urlencode(repo)); + let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str()); + + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.query(&[("access_token", local_var_value)]); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.query(&[("sudo", local_var_value)]); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.query(&[("token", local_var_value)]); + } + if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { + local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("Authorization", local_var_value); + }; + if let Some(ref local_var_auth_conf) = local_var_configuration.basic_auth { + local_var_req_builder = local_var_req_builder.basic_auth(local_var_auth_conf.0.to_owned(), local_var_auth_conf.1.to_owned()); + }; + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("Sudo", local_var_value); + }; + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("X-GITEA-OTP", local_var_value); + }; + local_var_req_builder = local_var_req_builder.json(&body); + + let local_var_req = local_var_req_builder.build()?; + let local_var_resp = local_var_client.execute(local_var_req).await?; + + let local_var_status = local_var_resp.status(); + let local_var_content = local_var_resp.text().await?; + + if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + serde_json::from_str(&local_var_content).map_err(Error::from) + } else { + let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); + let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; + Err(Error::ResponseError(local_var_error)) + } +} + +pub async fn repo_create_file(configuration: &configuration::Configuration, owner: &str, repo: &str, filepath: &str, body: crate::models::CreateFileOptions) -> Result> { + let local_var_configuration = configuration; + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!("{}/repos/{owner}/{repo}/contents/{filepath}", local_var_configuration.base_path, owner=crate::apis::urlencode(owner), repo=crate::apis::urlencode(repo), filepath=crate::apis::urlencode(filepath)); + let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str()); + + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.query(&[("access_token", local_var_value)]); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.query(&[("sudo", local_var_value)]); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.query(&[("token", local_var_value)]); + } + if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { + local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("Authorization", local_var_value); + }; + if let Some(ref local_var_auth_conf) = local_var_configuration.basic_auth { + local_var_req_builder = local_var_req_builder.basic_auth(local_var_auth_conf.0.to_owned(), local_var_auth_conf.1.to_owned()); + }; + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("Sudo", local_var_value); + }; + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("X-GITEA-OTP", local_var_value); + }; + local_var_req_builder = local_var_req_builder.json(&body); + + let local_var_req = local_var_req_builder.build()?; + let local_var_resp = local_var_client.execute(local_var_req).await?; + + let local_var_status = local_var_resp.status(); + let local_var_content = local_var_resp.text().await?; + + if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + serde_json::from_str(&local_var_content).map_err(Error::from) + } else { + let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); + let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; + Err(Error::ResponseError(local_var_error)) + } +} + +pub async fn repo_create_hook(configuration: &configuration::Configuration, owner: &str, repo: &str, body: Option) -> Result> { + let local_var_configuration = configuration; + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!("{}/repos/{owner}/{repo}/hooks", local_var_configuration.base_path, owner=crate::apis::urlencode(owner), repo=crate::apis::urlencode(repo)); + let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str()); + + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.query(&[("access_token", local_var_value)]); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.query(&[("sudo", local_var_value)]); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.query(&[("token", local_var_value)]); + } + if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { + local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("Authorization", local_var_value); + }; + if let Some(ref local_var_auth_conf) = local_var_configuration.basic_auth { + local_var_req_builder = local_var_req_builder.basic_auth(local_var_auth_conf.0.to_owned(), local_var_auth_conf.1.to_owned()); + }; + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("Sudo", local_var_value); + }; + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("X-GITEA-OTP", local_var_value); + }; + local_var_req_builder = local_var_req_builder.json(&body); + + let local_var_req = local_var_req_builder.build()?; + let local_var_resp = local_var_client.execute(local_var_req).await?; + + let local_var_status = local_var_resp.status(); + let local_var_content = local_var_resp.text().await?; + + if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + serde_json::from_str(&local_var_content).map_err(Error::from) + } else { + let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); + let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; + Err(Error::ResponseError(local_var_error)) + } +} + +pub async fn repo_create_key(configuration: &configuration::Configuration, owner: &str, repo: &str, body: Option) -> Result> { + let local_var_configuration = configuration; + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!("{}/repos/{owner}/{repo}/keys", local_var_configuration.base_path, owner=crate::apis::urlencode(owner), repo=crate::apis::urlencode(repo)); + let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str()); + + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.query(&[("access_token", local_var_value)]); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.query(&[("sudo", local_var_value)]); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.query(&[("token", local_var_value)]); + } + if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { + local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("Authorization", local_var_value); + }; + if let Some(ref local_var_auth_conf) = local_var_configuration.basic_auth { + local_var_req_builder = local_var_req_builder.basic_auth(local_var_auth_conf.0.to_owned(), local_var_auth_conf.1.to_owned()); + }; + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("Sudo", local_var_value); + }; + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("X-GITEA-OTP", local_var_value); + }; + local_var_req_builder = local_var_req_builder.json(&body); + + let local_var_req = local_var_req_builder.build()?; + let local_var_resp = local_var_client.execute(local_var_req).await?; + + let local_var_status = local_var_resp.status(); + let local_var_content = local_var_resp.text().await?; + + if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + serde_json::from_str(&local_var_content).map_err(Error::from) + } else { + let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); + let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; + Err(Error::ResponseError(local_var_error)) + } +} + +pub async fn repo_create_pull_request(configuration: &configuration::Configuration, owner: &str, repo: &str, body: Option) -> Result> { + let local_var_configuration = configuration; + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!("{}/repos/{owner}/{repo}/pulls", local_var_configuration.base_path, owner=crate::apis::urlencode(owner), repo=crate::apis::urlencode(repo)); + let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str()); + + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.query(&[("access_token", local_var_value)]); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.query(&[("sudo", local_var_value)]); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.query(&[("token", local_var_value)]); + } + if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { + local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("Authorization", local_var_value); + }; + if let Some(ref local_var_auth_conf) = local_var_configuration.basic_auth { + local_var_req_builder = local_var_req_builder.basic_auth(local_var_auth_conf.0.to_owned(), local_var_auth_conf.1.to_owned()); + }; + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("Sudo", local_var_value); + }; + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("X-GITEA-OTP", local_var_value); + }; + local_var_req_builder = local_var_req_builder.json(&body); + + let local_var_req = local_var_req_builder.build()?; + let local_var_resp = local_var_client.execute(local_var_req).await?; + + let local_var_status = local_var_resp.status(); + let local_var_content = local_var_resp.text().await?; + + if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + serde_json::from_str(&local_var_content).map_err(Error::from) + } else { + let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); + let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; + Err(Error::ResponseError(local_var_error)) + } +} + +pub async fn repo_create_pull_review(configuration: &configuration::Configuration, owner: &str, repo: &str, index: i64, body: crate::models::CreatePullReviewOptions) -> Result> { + let local_var_configuration = configuration; + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!("{}/repos/{owner}/{repo}/pulls/{index}/reviews", local_var_configuration.base_path, owner=crate::apis::urlencode(owner), repo=crate::apis::urlencode(repo), index=index); + let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str()); + + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.query(&[("access_token", local_var_value)]); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.query(&[("sudo", local_var_value)]); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.query(&[("token", local_var_value)]); + } + if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { + local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("Authorization", local_var_value); + }; + if let Some(ref local_var_auth_conf) = local_var_configuration.basic_auth { + local_var_req_builder = local_var_req_builder.basic_auth(local_var_auth_conf.0.to_owned(), local_var_auth_conf.1.to_owned()); + }; + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("Sudo", local_var_value); + }; + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("X-GITEA-OTP", local_var_value); + }; + local_var_req_builder = local_var_req_builder.json(&body); + + let local_var_req = local_var_req_builder.build()?; + let local_var_resp = local_var_client.execute(local_var_req).await?; + + let local_var_status = local_var_resp.status(); + let local_var_content = local_var_resp.text().await?; + + if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + serde_json::from_str(&local_var_content).map_err(Error::from) + } else { + let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); + let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; + Err(Error::ResponseError(local_var_error)) + } +} + +pub async fn repo_create_pull_review_requests(configuration: &configuration::Configuration, owner: &str, repo: &str, index: i64, body: crate::models::PullReviewRequestOptions) -> Result, Error> { + let local_var_configuration = configuration; + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!("{}/repos/{owner}/{repo}/pulls/{index}/requested_reviewers", local_var_configuration.base_path, owner=crate::apis::urlencode(owner), repo=crate::apis::urlencode(repo), index=index); + let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str()); + + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.query(&[("access_token", local_var_value)]); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.query(&[("sudo", local_var_value)]); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.query(&[("token", local_var_value)]); + } + if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { + local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("Authorization", local_var_value); + }; + if let Some(ref local_var_auth_conf) = local_var_configuration.basic_auth { + local_var_req_builder = local_var_req_builder.basic_auth(local_var_auth_conf.0.to_owned(), local_var_auth_conf.1.to_owned()); + }; + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("Sudo", local_var_value); + }; + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("X-GITEA-OTP", local_var_value); + }; + local_var_req_builder = local_var_req_builder.json(&body); + + let local_var_req = local_var_req_builder.build()?; + let local_var_resp = local_var_client.execute(local_var_req).await?; + + let local_var_status = local_var_resp.status(); + let local_var_content = local_var_resp.text().await?; + + if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + serde_json::from_str(&local_var_content).map_err(Error::from) + } else { + let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); + let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; + Err(Error::ResponseError(local_var_error)) + } +} + +pub async fn repo_create_release(configuration: &configuration::Configuration, owner: &str, repo: &str, body: Option) -> Result> { + let local_var_configuration = configuration; + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!("{}/repos/{owner}/{repo}/releases", local_var_configuration.base_path, owner=crate::apis::urlencode(owner), repo=crate::apis::urlencode(repo)); + let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str()); + + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.query(&[("access_token", local_var_value)]); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.query(&[("sudo", local_var_value)]); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.query(&[("token", local_var_value)]); + } + if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { + local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("Authorization", local_var_value); + }; + if let Some(ref local_var_auth_conf) = local_var_configuration.basic_auth { + local_var_req_builder = local_var_req_builder.basic_auth(local_var_auth_conf.0.to_owned(), local_var_auth_conf.1.to_owned()); + }; + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("Sudo", local_var_value); + }; + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("X-GITEA-OTP", local_var_value); + }; + local_var_req_builder = local_var_req_builder.json(&body); + + let local_var_req = local_var_req_builder.build()?; + let local_var_resp = local_var_client.execute(local_var_req).await?; + + let local_var_status = local_var_resp.status(); + let local_var_content = local_var_resp.text().await?; + + if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + serde_json::from_str(&local_var_content).map_err(Error::from) + } else { + let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); + let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; + Err(Error::ResponseError(local_var_error)) + } +} + +pub async fn repo_create_release_attachment(configuration: &configuration::Configuration, owner: &str, repo: &str, id: i64, attachment: std::path::PathBuf, name: Option<&str>) -> Result> { + let local_var_configuration = configuration; + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!("{}/repos/{owner}/{repo}/releases/{id}/assets", local_var_configuration.base_path, owner=crate::apis::urlencode(owner), repo=crate::apis::urlencode(repo), id=id); + let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str()); + + if let Some(ref local_var_str) = name { + local_var_req_builder = local_var_req_builder.query(&[("name", &local_var_str.to_string())]); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.query(&[("access_token", local_var_value)]); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.query(&[("sudo", local_var_value)]); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.query(&[("token", local_var_value)]); + } + if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { + local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("Authorization", local_var_value); + }; + if let Some(ref local_var_auth_conf) = local_var_configuration.basic_auth { + local_var_req_builder = local_var_req_builder.basic_auth(local_var_auth_conf.0.to_owned(), local_var_auth_conf.1.to_owned()); + }; + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("Sudo", local_var_value); + }; + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("X-GITEA-OTP", local_var_value); + }; + let mut local_var_form = reqwest::multipart::Form::new(); + // TODO: support file upload for 'attachment' parameter + local_var_req_builder = local_var_req_builder.multipart(local_var_form); + + let local_var_req = local_var_req_builder.build()?; + let local_var_resp = local_var_client.execute(local_var_req).await?; + + let local_var_status = local_var_resp.status(); + let local_var_content = local_var_resp.text().await?; + + if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + serde_json::from_str(&local_var_content).map_err(Error::from) + } else { + let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); + let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; + Err(Error::ResponseError(local_var_error)) + } +} + +pub async fn repo_create_status(configuration: &configuration::Configuration, owner: &str, repo: &str, sha: &str, body: Option) -> Result> { + let local_var_configuration = configuration; + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!("{}/repos/{owner}/{repo}/statuses/{sha}", local_var_configuration.base_path, owner=crate::apis::urlencode(owner), repo=crate::apis::urlencode(repo), sha=crate::apis::urlencode(sha)); + let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str()); + + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.query(&[("access_token", local_var_value)]); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.query(&[("sudo", local_var_value)]); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.query(&[("token", local_var_value)]); + } + if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { + local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("Authorization", local_var_value); + }; + if let Some(ref local_var_auth_conf) = local_var_configuration.basic_auth { + local_var_req_builder = local_var_req_builder.basic_auth(local_var_auth_conf.0.to_owned(), local_var_auth_conf.1.to_owned()); + }; + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("Sudo", local_var_value); + }; + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("X-GITEA-OTP", local_var_value); + }; + local_var_req_builder = local_var_req_builder.json(&body); + + let local_var_req = local_var_req_builder.build()?; + let local_var_resp = local_var_client.execute(local_var_req).await?; + + let local_var_status = local_var_resp.status(); + let local_var_content = local_var_resp.text().await?; + + if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + serde_json::from_str(&local_var_content).map_err(Error::from) + } else { + let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); + let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; + Err(Error::ResponseError(local_var_error)) + } +} + +pub async fn repo_create_tag(configuration: &configuration::Configuration, owner: &str, repo: &str, body: Option) -> Result> { + let local_var_configuration = configuration; + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!("{}/repos/{owner}/{repo}/tags", local_var_configuration.base_path, owner=crate::apis::urlencode(owner), repo=crate::apis::urlencode(repo)); + let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str()); + + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.query(&[("access_token", local_var_value)]); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.query(&[("sudo", local_var_value)]); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.query(&[("token", local_var_value)]); + } + if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { + local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("Authorization", local_var_value); + }; + if let Some(ref local_var_auth_conf) = local_var_configuration.basic_auth { + local_var_req_builder = local_var_req_builder.basic_auth(local_var_auth_conf.0.to_owned(), local_var_auth_conf.1.to_owned()); + }; + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("Sudo", local_var_value); + }; + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("X-GITEA-OTP", local_var_value); + }; + local_var_req_builder = local_var_req_builder.json(&body); + + let local_var_req = local_var_req_builder.build()?; + let local_var_resp = local_var_client.execute(local_var_req).await?; + + let local_var_status = local_var_resp.status(); + let local_var_content = local_var_resp.text().await?; + + if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + serde_json::from_str(&local_var_content).map_err(Error::from) + } else { + let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); + let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; + Err(Error::ResponseError(local_var_error)) + } +} + +pub async fn repo_create_wiki_page(configuration: &configuration::Configuration, owner: &str, repo: &str, body: Option) -> Result> { + let local_var_configuration = configuration; + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!("{}/repos/{owner}/{repo}/wiki/new", local_var_configuration.base_path, owner=crate::apis::urlencode(owner), repo=crate::apis::urlencode(repo)); + let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str()); + + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.query(&[("access_token", local_var_value)]); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.query(&[("sudo", local_var_value)]); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.query(&[("token", local_var_value)]); + } + if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { + local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("Authorization", local_var_value); + }; + if let Some(ref local_var_auth_conf) = local_var_configuration.basic_auth { + local_var_req_builder = local_var_req_builder.basic_auth(local_var_auth_conf.0.to_owned(), local_var_auth_conf.1.to_owned()); + }; + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("Sudo", local_var_value); + }; + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("X-GITEA-OTP", local_var_value); + }; + local_var_req_builder = local_var_req_builder.json(&body); + + let local_var_req = local_var_req_builder.build()?; + let local_var_resp = local_var_client.execute(local_var_req).await?; + + let local_var_status = local_var_resp.status(); + let local_var_content = local_var_resp.text().await?; + + if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + serde_json::from_str(&local_var_content).map_err(Error::from) + } else { + let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); + let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; + Err(Error::ResponseError(local_var_error)) + } +} + +pub async fn repo_delete(configuration: &configuration::Configuration, owner: &str, repo: &str) -> Result<(), Error> { + let local_var_configuration = configuration; + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!("{}/repos/{owner}/{repo}", local_var_configuration.base_path, owner=crate::apis::urlencode(owner), repo=crate::apis::urlencode(repo)); + let mut local_var_req_builder = local_var_client.request(reqwest::Method::DELETE, local_var_uri_str.as_str()); + + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.query(&[("access_token", local_var_value)]); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.query(&[("sudo", local_var_value)]); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.query(&[("token", local_var_value)]); + } + if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { + local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("Authorization", local_var_value); + }; + if let Some(ref local_var_auth_conf) = local_var_configuration.basic_auth { + local_var_req_builder = local_var_req_builder.basic_auth(local_var_auth_conf.0.to_owned(), local_var_auth_conf.1.to_owned()); + }; + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("Sudo", local_var_value); + }; + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("X-GITEA-OTP", local_var_value); + }; + + let local_var_req = local_var_req_builder.build()?; + let local_var_resp = local_var_client.execute(local_var_req).await?; + + let local_var_status = local_var_resp.status(); + let local_var_content = local_var_resp.text().await?; + + if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + Ok(()) + } else { + let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); + let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; + Err(Error::ResponseError(local_var_error)) + } +} + +pub async fn repo_delete_branch(configuration: &configuration::Configuration, owner: &str, repo: &str, branch: &str) -> Result<(), Error> { + let local_var_configuration = configuration; + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!("{}/repos/{owner}/{repo}/branches/{branch}", local_var_configuration.base_path, owner=crate::apis::urlencode(owner), repo=crate::apis::urlencode(repo), branch=crate::apis::urlencode(branch)); + let mut local_var_req_builder = local_var_client.request(reqwest::Method::DELETE, local_var_uri_str.as_str()); + + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.query(&[("access_token", local_var_value)]); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.query(&[("sudo", local_var_value)]); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.query(&[("token", local_var_value)]); + } + if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { + local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("Authorization", local_var_value); + }; + if let Some(ref local_var_auth_conf) = local_var_configuration.basic_auth { + local_var_req_builder = local_var_req_builder.basic_auth(local_var_auth_conf.0.to_owned(), local_var_auth_conf.1.to_owned()); + }; + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("Sudo", local_var_value); + }; + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("X-GITEA-OTP", local_var_value); + }; + + let local_var_req = local_var_req_builder.build()?; + let local_var_resp = local_var_client.execute(local_var_req).await?; + + let local_var_status = local_var_resp.status(); + let local_var_content = local_var_resp.text().await?; + + if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + Ok(()) + } else { + let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); + let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; + Err(Error::ResponseError(local_var_error)) + } +} + +pub async fn repo_delete_branch_protection(configuration: &configuration::Configuration, owner: &str, repo: &str, name: &str) -> Result<(), Error> { + let local_var_configuration = configuration; + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!("{}/repos/{owner}/{repo}/branch_protections/{name}", local_var_configuration.base_path, owner=crate::apis::urlencode(owner), repo=crate::apis::urlencode(repo), name=crate::apis::urlencode(name)); + let mut local_var_req_builder = local_var_client.request(reqwest::Method::DELETE, local_var_uri_str.as_str()); + + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.query(&[("access_token", local_var_value)]); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.query(&[("sudo", local_var_value)]); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.query(&[("token", local_var_value)]); + } + if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { + local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("Authorization", local_var_value); + }; + if let Some(ref local_var_auth_conf) = local_var_configuration.basic_auth { + local_var_req_builder = local_var_req_builder.basic_auth(local_var_auth_conf.0.to_owned(), local_var_auth_conf.1.to_owned()); + }; + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("Sudo", local_var_value); + }; + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("X-GITEA-OTP", local_var_value); + }; + + let local_var_req = local_var_req_builder.build()?; + let local_var_resp = local_var_client.execute(local_var_req).await?; + + let local_var_status = local_var_resp.status(); + let local_var_content = local_var_resp.text().await?; + + if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + Ok(()) + } else { + let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); + let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; + Err(Error::ResponseError(local_var_error)) + } +} + +pub async fn repo_delete_collaborator(configuration: &configuration::Configuration, owner: &str, repo: &str, collaborator: &str) -> Result<(), Error> { + let local_var_configuration = configuration; + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!("{}/repos/{owner}/{repo}/collaborators/{collaborator}", local_var_configuration.base_path, owner=crate::apis::urlencode(owner), repo=crate::apis::urlencode(repo), collaborator=crate::apis::urlencode(collaborator)); + let mut local_var_req_builder = local_var_client.request(reqwest::Method::DELETE, local_var_uri_str.as_str()); + + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.query(&[("access_token", local_var_value)]); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.query(&[("sudo", local_var_value)]); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.query(&[("token", local_var_value)]); + } + if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { + local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("Authorization", local_var_value); + }; + if let Some(ref local_var_auth_conf) = local_var_configuration.basic_auth { + local_var_req_builder = local_var_req_builder.basic_auth(local_var_auth_conf.0.to_owned(), local_var_auth_conf.1.to_owned()); + }; + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("Sudo", local_var_value); + }; + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("X-GITEA-OTP", local_var_value); + }; + + let local_var_req = local_var_req_builder.build()?; + let local_var_resp = local_var_client.execute(local_var_req).await?; + + let local_var_status = local_var_resp.status(); + let local_var_content = local_var_resp.text().await?; + + if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + Ok(()) + } else { + let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); + let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; + Err(Error::ResponseError(local_var_error)) + } +} + +pub async fn repo_delete_file(configuration: &configuration::Configuration, owner: &str, repo: &str, filepath: &str, body: crate::models::DeleteFileOptions) -> Result> { + let local_var_configuration = configuration; + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!("{}/repos/{owner}/{repo}/contents/{filepath}", local_var_configuration.base_path, owner=crate::apis::urlencode(owner), repo=crate::apis::urlencode(repo), filepath=crate::apis::urlencode(filepath)); + let mut local_var_req_builder = local_var_client.request(reqwest::Method::DELETE, local_var_uri_str.as_str()); + + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.query(&[("access_token", local_var_value)]); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.query(&[("sudo", local_var_value)]); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.query(&[("token", local_var_value)]); + } + if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { + local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("Authorization", local_var_value); + }; + if let Some(ref local_var_auth_conf) = local_var_configuration.basic_auth { + local_var_req_builder = local_var_req_builder.basic_auth(local_var_auth_conf.0.to_owned(), local_var_auth_conf.1.to_owned()); + }; + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("Sudo", local_var_value); + }; + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("X-GITEA-OTP", local_var_value); + }; + local_var_req_builder = local_var_req_builder.json(&body); + + let local_var_req = local_var_req_builder.build()?; + let local_var_resp = local_var_client.execute(local_var_req).await?; + + let local_var_status = local_var_resp.status(); + let local_var_content = local_var_resp.text().await?; + + if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + serde_json::from_str(&local_var_content).map_err(Error::from) + } else { + let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); + let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; + Err(Error::ResponseError(local_var_error)) + } +} + +pub async fn repo_delete_git_hook(configuration: &configuration::Configuration, owner: &str, repo: &str, id: &str) -> Result<(), Error> { + let local_var_configuration = configuration; + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!("{}/repos/{owner}/{repo}/hooks/git/{id}", local_var_configuration.base_path, owner=crate::apis::urlencode(owner), repo=crate::apis::urlencode(repo), id=crate::apis::urlencode(id)); + let mut local_var_req_builder = local_var_client.request(reqwest::Method::DELETE, local_var_uri_str.as_str()); + + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.query(&[("access_token", local_var_value)]); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.query(&[("sudo", local_var_value)]); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.query(&[("token", local_var_value)]); + } + if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { + local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("Authorization", local_var_value); + }; + if let Some(ref local_var_auth_conf) = local_var_configuration.basic_auth { + local_var_req_builder = local_var_req_builder.basic_auth(local_var_auth_conf.0.to_owned(), local_var_auth_conf.1.to_owned()); + }; + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("Sudo", local_var_value); + }; + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("X-GITEA-OTP", local_var_value); + }; + + let local_var_req = local_var_req_builder.build()?; + let local_var_resp = local_var_client.execute(local_var_req).await?; + + let local_var_status = local_var_resp.status(); + let local_var_content = local_var_resp.text().await?; + + if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + Ok(()) + } else { + let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); + let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; + Err(Error::ResponseError(local_var_error)) + } +} + +pub async fn repo_delete_hook(configuration: &configuration::Configuration, owner: &str, repo: &str, id: i64) -> Result<(), Error> { + let local_var_configuration = configuration; + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!("{}/repos/{owner}/{repo}/hooks/{id}", local_var_configuration.base_path, owner=crate::apis::urlencode(owner), repo=crate::apis::urlencode(repo), id=id); + let mut local_var_req_builder = local_var_client.request(reqwest::Method::DELETE, local_var_uri_str.as_str()); + + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.query(&[("access_token", local_var_value)]); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.query(&[("sudo", local_var_value)]); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.query(&[("token", local_var_value)]); + } + if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { + local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("Authorization", local_var_value); + }; + if let Some(ref local_var_auth_conf) = local_var_configuration.basic_auth { + local_var_req_builder = local_var_req_builder.basic_auth(local_var_auth_conf.0.to_owned(), local_var_auth_conf.1.to_owned()); + }; + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("Sudo", local_var_value); + }; + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("X-GITEA-OTP", local_var_value); + }; + + let local_var_req = local_var_req_builder.build()?; + let local_var_resp = local_var_client.execute(local_var_req).await?; + + let local_var_status = local_var_resp.status(); + let local_var_content = local_var_resp.text().await?; + + if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + Ok(()) + } else { + let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); + let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; + Err(Error::ResponseError(local_var_error)) + } +} + +pub async fn repo_delete_key(configuration: &configuration::Configuration, owner: &str, repo: &str, id: i64) -> Result<(), Error> { + let local_var_configuration = configuration; + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!("{}/repos/{owner}/{repo}/keys/{id}", local_var_configuration.base_path, owner=crate::apis::urlencode(owner), repo=crate::apis::urlencode(repo), id=id); + let mut local_var_req_builder = local_var_client.request(reqwest::Method::DELETE, local_var_uri_str.as_str()); + + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.query(&[("access_token", local_var_value)]); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.query(&[("sudo", local_var_value)]); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.query(&[("token", local_var_value)]); + } + if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { + local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("Authorization", local_var_value); + }; + if let Some(ref local_var_auth_conf) = local_var_configuration.basic_auth { + local_var_req_builder = local_var_req_builder.basic_auth(local_var_auth_conf.0.to_owned(), local_var_auth_conf.1.to_owned()); + }; + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("Sudo", local_var_value); + }; + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("X-GITEA-OTP", local_var_value); + }; + + let local_var_req = local_var_req_builder.build()?; + let local_var_resp = local_var_client.execute(local_var_req).await?; + + let local_var_status = local_var_resp.status(); + let local_var_content = local_var_resp.text().await?; + + if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + Ok(()) + } else { + let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); + let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; + Err(Error::ResponseError(local_var_error)) + } +} + +pub async fn repo_delete_pull_review(configuration: &configuration::Configuration, owner: &str, repo: &str, index: i64, id: i64) -> Result<(), Error> { + let local_var_configuration = configuration; + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!("{}/repos/{owner}/{repo}/pulls/{index}/reviews/{id}", local_var_configuration.base_path, owner=crate::apis::urlencode(owner), repo=crate::apis::urlencode(repo), index=index, id=id); + let mut local_var_req_builder = local_var_client.request(reqwest::Method::DELETE, local_var_uri_str.as_str()); + + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.query(&[("access_token", local_var_value)]); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.query(&[("sudo", local_var_value)]); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.query(&[("token", local_var_value)]); + } + if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { + local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("Authorization", local_var_value); + }; + if let Some(ref local_var_auth_conf) = local_var_configuration.basic_auth { + local_var_req_builder = local_var_req_builder.basic_auth(local_var_auth_conf.0.to_owned(), local_var_auth_conf.1.to_owned()); + }; + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("Sudo", local_var_value); + }; + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("X-GITEA-OTP", local_var_value); + }; + + let local_var_req = local_var_req_builder.build()?; + let local_var_resp = local_var_client.execute(local_var_req).await?; + + let local_var_status = local_var_resp.status(); + let local_var_content = local_var_resp.text().await?; + + if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + Ok(()) + } else { + let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); + let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; + Err(Error::ResponseError(local_var_error)) + } +} + +pub async fn repo_delete_pull_review_requests(configuration: &configuration::Configuration, owner: &str, repo: &str, index: i64, body: crate::models::PullReviewRequestOptions) -> Result<(), Error> { + let local_var_configuration = configuration; + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!("{}/repos/{owner}/{repo}/pulls/{index}/requested_reviewers", local_var_configuration.base_path, owner=crate::apis::urlencode(owner), repo=crate::apis::urlencode(repo), index=index); + let mut local_var_req_builder = local_var_client.request(reqwest::Method::DELETE, local_var_uri_str.as_str()); + + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.query(&[("access_token", local_var_value)]); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.query(&[("sudo", local_var_value)]); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.query(&[("token", local_var_value)]); + } + if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { + local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("Authorization", local_var_value); + }; + if let Some(ref local_var_auth_conf) = local_var_configuration.basic_auth { + local_var_req_builder = local_var_req_builder.basic_auth(local_var_auth_conf.0.to_owned(), local_var_auth_conf.1.to_owned()); + }; + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("Sudo", local_var_value); + }; + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("X-GITEA-OTP", local_var_value); + }; + local_var_req_builder = local_var_req_builder.json(&body); + + let local_var_req = local_var_req_builder.build()?; + let local_var_resp = local_var_client.execute(local_var_req).await?; + + let local_var_status = local_var_resp.status(); + let local_var_content = local_var_resp.text().await?; + + if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + Ok(()) + } else { + let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); + let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; + Err(Error::ResponseError(local_var_error)) + } +} + +pub async fn repo_delete_release(configuration: &configuration::Configuration, owner: &str, repo: &str, id: i64) -> Result<(), Error> { + let local_var_configuration = configuration; + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!("{}/repos/{owner}/{repo}/releases/{id}", local_var_configuration.base_path, owner=crate::apis::urlencode(owner), repo=crate::apis::urlencode(repo), id=id); + let mut local_var_req_builder = local_var_client.request(reqwest::Method::DELETE, local_var_uri_str.as_str()); + + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.query(&[("access_token", local_var_value)]); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.query(&[("sudo", local_var_value)]); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.query(&[("token", local_var_value)]); + } + if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { + local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("Authorization", local_var_value); + }; + if let Some(ref local_var_auth_conf) = local_var_configuration.basic_auth { + local_var_req_builder = local_var_req_builder.basic_auth(local_var_auth_conf.0.to_owned(), local_var_auth_conf.1.to_owned()); + }; + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("Sudo", local_var_value); + }; + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("X-GITEA-OTP", local_var_value); + }; + + let local_var_req = local_var_req_builder.build()?; + let local_var_resp = local_var_client.execute(local_var_req).await?; + + let local_var_status = local_var_resp.status(); + let local_var_content = local_var_resp.text().await?; + + if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + Ok(()) + } else { + let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); + let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; + Err(Error::ResponseError(local_var_error)) + } +} + +pub async fn repo_delete_release_attachment(configuration: &configuration::Configuration, owner: &str, repo: &str, id: i64, attachment_id: i64) -> Result<(), Error> { + let local_var_configuration = configuration; + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!("{}/repos/{owner}/{repo}/releases/{id}/assets/{attachment_id}", local_var_configuration.base_path, owner=crate::apis::urlencode(owner), repo=crate::apis::urlencode(repo), id=id, attachment_id=attachment_id); + let mut local_var_req_builder = local_var_client.request(reqwest::Method::DELETE, local_var_uri_str.as_str()); + + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.query(&[("access_token", local_var_value)]); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.query(&[("sudo", local_var_value)]); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.query(&[("token", local_var_value)]); + } + if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { + local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("Authorization", local_var_value); + }; + if let Some(ref local_var_auth_conf) = local_var_configuration.basic_auth { + local_var_req_builder = local_var_req_builder.basic_auth(local_var_auth_conf.0.to_owned(), local_var_auth_conf.1.to_owned()); + }; + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("Sudo", local_var_value); + }; + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("X-GITEA-OTP", local_var_value); + }; + + let local_var_req = local_var_req_builder.build()?; + let local_var_resp = local_var_client.execute(local_var_req).await?; + + let local_var_status = local_var_resp.status(); + let local_var_content = local_var_resp.text().await?; + + if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + Ok(()) + } else { + let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); + let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; + Err(Error::ResponseError(local_var_error)) + } +} + +pub async fn repo_delete_release_by_tag(configuration: &configuration::Configuration, owner: &str, repo: &str, tag: &str) -> Result<(), Error> { + let local_var_configuration = configuration; + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!("{}/repos/{owner}/{repo}/releases/tags/{tag}", local_var_configuration.base_path, owner=crate::apis::urlencode(owner), repo=crate::apis::urlencode(repo), tag=crate::apis::urlencode(tag)); + let mut local_var_req_builder = local_var_client.request(reqwest::Method::DELETE, local_var_uri_str.as_str()); + + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.query(&[("access_token", local_var_value)]); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.query(&[("sudo", local_var_value)]); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.query(&[("token", local_var_value)]); + } + if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { + local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("Authorization", local_var_value); + }; + if let Some(ref local_var_auth_conf) = local_var_configuration.basic_auth { + local_var_req_builder = local_var_req_builder.basic_auth(local_var_auth_conf.0.to_owned(), local_var_auth_conf.1.to_owned()); + }; + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("Sudo", local_var_value); + }; + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("X-GITEA-OTP", local_var_value); + }; + + let local_var_req = local_var_req_builder.build()?; + let local_var_resp = local_var_client.execute(local_var_req).await?; + + let local_var_status = local_var_resp.status(); + let local_var_content = local_var_resp.text().await?; + + if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + Ok(()) + } else { + let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); + let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; + Err(Error::ResponseError(local_var_error)) + } +} + +pub async fn repo_delete_tag(configuration: &configuration::Configuration, owner: &str, repo: &str, tag: &str) -> Result<(), Error> { + let local_var_configuration = configuration; + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!("{}/repos/{owner}/{repo}/tags/{tag}", local_var_configuration.base_path, owner=crate::apis::urlencode(owner), repo=crate::apis::urlencode(repo), tag=crate::apis::urlencode(tag)); + let mut local_var_req_builder = local_var_client.request(reqwest::Method::DELETE, local_var_uri_str.as_str()); + + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.query(&[("access_token", local_var_value)]); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.query(&[("sudo", local_var_value)]); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.query(&[("token", local_var_value)]); + } + if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { + local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("Authorization", local_var_value); + }; + if let Some(ref local_var_auth_conf) = local_var_configuration.basic_auth { + local_var_req_builder = local_var_req_builder.basic_auth(local_var_auth_conf.0.to_owned(), local_var_auth_conf.1.to_owned()); + }; + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("Sudo", local_var_value); + }; + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("X-GITEA-OTP", local_var_value); + }; + + let local_var_req = local_var_req_builder.build()?; + let local_var_resp = local_var_client.execute(local_var_req).await?; + + let local_var_status = local_var_resp.status(); + let local_var_content = local_var_resp.text().await?; + + if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + Ok(()) + } else { + let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); + let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; + Err(Error::ResponseError(local_var_error)) + } +} + +pub async fn repo_delete_team(configuration: &configuration::Configuration, owner: &str, repo: &str, team: &str) -> Result<(), Error> { + let local_var_configuration = configuration; + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!("{}/repos/{owner}/{repo}/teams/{team}", local_var_configuration.base_path, owner=crate::apis::urlencode(owner), repo=crate::apis::urlencode(repo), team=crate::apis::urlencode(team)); + let mut local_var_req_builder = local_var_client.request(reqwest::Method::DELETE, local_var_uri_str.as_str()); + + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.query(&[("access_token", local_var_value)]); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.query(&[("sudo", local_var_value)]); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.query(&[("token", local_var_value)]); + } + if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { + local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("Authorization", local_var_value); + }; + if let Some(ref local_var_auth_conf) = local_var_configuration.basic_auth { + local_var_req_builder = local_var_req_builder.basic_auth(local_var_auth_conf.0.to_owned(), local_var_auth_conf.1.to_owned()); + }; + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("Sudo", local_var_value); + }; + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("X-GITEA-OTP", local_var_value); + }; + + let local_var_req = local_var_req_builder.build()?; + let local_var_resp = local_var_client.execute(local_var_req).await?; + + let local_var_status = local_var_resp.status(); + let local_var_content = local_var_resp.text().await?; + + if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + Ok(()) + } else { + let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); + let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; + Err(Error::ResponseError(local_var_error)) + } +} + +pub async fn repo_delete_topic(configuration: &configuration::Configuration, owner: &str, repo: &str, topic: &str) -> Result<(), Error> { + let local_var_configuration = configuration; + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!("{}/repos/{owner}/{repo}/topics/{topic}", local_var_configuration.base_path, owner=crate::apis::urlencode(owner), repo=crate::apis::urlencode(repo), topic=crate::apis::urlencode(topic)); + let mut local_var_req_builder = local_var_client.request(reqwest::Method::DELETE, local_var_uri_str.as_str()); + + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.query(&[("access_token", local_var_value)]); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.query(&[("sudo", local_var_value)]); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.query(&[("token", local_var_value)]); + } + if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { + local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("Authorization", local_var_value); + }; + if let Some(ref local_var_auth_conf) = local_var_configuration.basic_auth { + local_var_req_builder = local_var_req_builder.basic_auth(local_var_auth_conf.0.to_owned(), local_var_auth_conf.1.to_owned()); + }; + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("Sudo", local_var_value); + }; + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("X-GITEA-OTP", local_var_value); + }; + + let local_var_req = local_var_req_builder.build()?; + let local_var_resp = local_var_client.execute(local_var_req).await?; + + let local_var_status = local_var_resp.status(); + let local_var_content = local_var_resp.text().await?; + + if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + Ok(()) + } else { + let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); + let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; + Err(Error::ResponseError(local_var_error)) + } +} + +pub async fn repo_delete_wiki_page(configuration: &configuration::Configuration, owner: &str, repo: &str, page_name: &str) -> Result<(), Error> { + let local_var_configuration = configuration; + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!("{}/repos/{owner}/{repo}/wiki/page/{pageName}", local_var_configuration.base_path, owner=crate::apis::urlencode(owner), repo=crate::apis::urlencode(repo), pageName=crate::apis::urlencode(page_name)); + let mut local_var_req_builder = local_var_client.request(reqwest::Method::DELETE, local_var_uri_str.as_str()); + + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.query(&[("access_token", local_var_value)]); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.query(&[("sudo", local_var_value)]); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.query(&[("token", local_var_value)]); + } + if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { + local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("Authorization", local_var_value); + }; + if let Some(ref local_var_auth_conf) = local_var_configuration.basic_auth { + local_var_req_builder = local_var_req_builder.basic_auth(local_var_auth_conf.0.to_owned(), local_var_auth_conf.1.to_owned()); + }; + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("Sudo", local_var_value); + }; + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("X-GITEA-OTP", local_var_value); + }; + + let local_var_req = local_var_req_builder.build()?; + let local_var_resp = local_var_client.execute(local_var_req).await?; + + let local_var_status = local_var_resp.status(); + let local_var_content = local_var_resp.text().await?; + + if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + Ok(()) + } else { + let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); + let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; + Err(Error::ResponseError(local_var_error)) + } +} + +pub async fn repo_dismiss_pull_review(configuration: &configuration::Configuration, owner: &str, repo: &str, index: i64, id: i64, body: crate::models::DismissPullReviewOptions) -> Result> { + let local_var_configuration = configuration; + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!("{}/repos/{owner}/{repo}/pulls/{index}/reviews/{id}/dismissals", local_var_configuration.base_path, owner=crate::apis::urlencode(owner), repo=crate::apis::urlencode(repo), index=index, id=id); + let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str()); + + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.query(&[("access_token", local_var_value)]); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.query(&[("sudo", local_var_value)]); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.query(&[("token", local_var_value)]); + } + if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { + local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("Authorization", local_var_value); + }; + if let Some(ref local_var_auth_conf) = local_var_configuration.basic_auth { + local_var_req_builder = local_var_req_builder.basic_auth(local_var_auth_conf.0.to_owned(), local_var_auth_conf.1.to_owned()); + }; + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("Sudo", local_var_value); + }; + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("X-GITEA-OTP", local_var_value); + }; + local_var_req_builder = local_var_req_builder.json(&body); + + let local_var_req = local_var_req_builder.build()?; + let local_var_resp = local_var_client.execute(local_var_req).await?; + + let local_var_status = local_var_resp.status(); + let local_var_content = local_var_resp.text().await?; + + if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + serde_json::from_str(&local_var_content).map_err(Error::from) + } else { + let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); + let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; + Err(Error::ResponseError(local_var_error)) + } +} + +pub async fn repo_download_commit_diff_or_patch(configuration: &configuration::Configuration, owner: &str, repo: &str, sha: &str, diff_type: &str) -> Result> { + let local_var_configuration = configuration; + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!("{}/repos/{owner}/{repo}/git/commits/{sha}.{diffType}", local_var_configuration.base_path, owner=crate::apis::urlencode(owner), repo=crate::apis::urlencode(repo), sha=crate::apis::urlencode(sha), diffType=crate::apis::urlencode(diff_type)); + let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str()); + + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.query(&[("access_token", local_var_value)]); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.query(&[("sudo", local_var_value)]); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.query(&[("token", local_var_value)]); + } + if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { + local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("Authorization", local_var_value); + }; + if let Some(ref local_var_auth_conf) = local_var_configuration.basic_auth { + local_var_req_builder = local_var_req_builder.basic_auth(local_var_auth_conf.0.to_owned(), local_var_auth_conf.1.to_owned()); + }; + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("Sudo", local_var_value); + }; + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("X-GITEA-OTP", local_var_value); + }; + + let local_var_req = local_var_req_builder.build()?; + let local_var_resp = local_var_client.execute(local_var_req).await?; + + let local_var_status = local_var_resp.status(); + let local_var_content = local_var_resp.text().await?; + + if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + serde_json::from_str(&local_var_content).map_err(Error::from) + } else { + let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); + let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; + Err(Error::ResponseError(local_var_error)) + } +} + +pub async fn repo_download_pull_diff_or_patch(configuration: &configuration::Configuration, owner: &str, repo: &str, index: i64, diff_type: &str, binary: Option) -> Result> { + let local_var_configuration = configuration; + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!("{}/repos/{owner}/{repo}/pulls/{index}.{diffType}", local_var_configuration.base_path, owner=crate::apis::urlencode(owner), repo=crate::apis::urlencode(repo), index=index, diffType=crate::apis::urlencode(diff_type)); + let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str()); + + if let Some(ref local_var_str) = binary { + local_var_req_builder = local_var_req_builder.query(&[("binary", &local_var_str.to_string())]); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.query(&[("access_token", local_var_value)]); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.query(&[("sudo", local_var_value)]); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.query(&[("token", local_var_value)]); + } + if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { + local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("Authorization", local_var_value); + }; + if let Some(ref local_var_auth_conf) = local_var_configuration.basic_auth { + local_var_req_builder = local_var_req_builder.basic_auth(local_var_auth_conf.0.to_owned(), local_var_auth_conf.1.to_owned()); + }; + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("Sudo", local_var_value); + }; + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("X-GITEA-OTP", local_var_value); + }; + + let local_var_req = local_var_req_builder.build()?; + let local_var_resp = local_var_client.execute(local_var_req).await?; + + let local_var_status = local_var_resp.status(); + let local_var_content = local_var_resp.text().await?; + + if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + serde_json::from_str(&local_var_content).map_err(Error::from) + } else { + let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); + let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; + Err(Error::ResponseError(local_var_error)) + } +} + +pub async fn repo_edit(configuration: &configuration::Configuration, owner: &str, repo: &str, body: Option) -> Result> { + let local_var_configuration = configuration; + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!("{}/repos/{owner}/{repo}", local_var_configuration.base_path, owner=crate::apis::urlencode(owner), repo=crate::apis::urlencode(repo)); + let mut local_var_req_builder = local_var_client.request(reqwest::Method::PATCH, local_var_uri_str.as_str()); + + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.query(&[("access_token", local_var_value)]); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.query(&[("sudo", local_var_value)]); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.query(&[("token", local_var_value)]); + } + if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { + local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("Authorization", local_var_value); + }; + if let Some(ref local_var_auth_conf) = local_var_configuration.basic_auth { + local_var_req_builder = local_var_req_builder.basic_auth(local_var_auth_conf.0.to_owned(), local_var_auth_conf.1.to_owned()); + }; + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("Sudo", local_var_value); + }; + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("X-GITEA-OTP", local_var_value); + }; + local_var_req_builder = local_var_req_builder.json(&body); + + let local_var_req = local_var_req_builder.build()?; + let local_var_resp = local_var_client.execute(local_var_req).await?; + + let local_var_status = local_var_resp.status(); + let local_var_content = local_var_resp.text().await?; + + if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + serde_json::from_str(&local_var_content).map_err(Error::from) + } else { + let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); + let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; + Err(Error::ResponseError(local_var_error)) + } +} + +pub async fn repo_edit_branch_protection(configuration: &configuration::Configuration, owner: &str, repo: &str, name: &str, body: Option) -> Result> { + let local_var_configuration = configuration; + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!("{}/repos/{owner}/{repo}/branch_protections/{name}", local_var_configuration.base_path, owner=crate::apis::urlencode(owner), repo=crate::apis::urlencode(repo), name=crate::apis::urlencode(name)); + let mut local_var_req_builder = local_var_client.request(reqwest::Method::PATCH, local_var_uri_str.as_str()); + + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.query(&[("access_token", local_var_value)]); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.query(&[("sudo", local_var_value)]); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.query(&[("token", local_var_value)]); + } + if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { + local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("Authorization", local_var_value); + }; + if let Some(ref local_var_auth_conf) = local_var_configuration.basic_auth { + local_var_req_builder = local_var_req_builder.basic_auth(local_var_auth_conf.0.to_owned(), local_var_auth_conf.1.to_owned()); + }; + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("Sudo", local_var_value); + }; + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("X-GITEA-OTP", local_var_value); + }; + local_var_req_builder = local_var_req_builder.json(&body); + + let local_var_req = local_var_req_builder.build()?; + let local_var_resp = local_var_client.execute(local_var_req).await?; + + let local_var_status = local_var_resp.status(); + let local_var_content = local_var_resp.text().await?; + + if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + serde_json::from_str(&local_var_content).map_err(Error::from) + } else { + let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); + let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; + Err(Error::ResponseError(local_var_error)) + } +} + +pub async fn repo_edit_git_hook(configuration: &configuration::Configuration, owner: &str, repo: &str, id: &str, body: Option) -> Result> { + let local_var_configuration = configuration; + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!("{}/repos/{owner}/{repo}/hooks/git/{id}", local_var_configuration.base_path, owner=crate::apis::urlencode(owner), repo=crate::apis::urlencode(repo), id=crate::apis::urlencode(id)); + let mut local_var_req_builder = local_var_client.request(reqwest::Method::PATCH, local_var_uri_str.as_str()); + + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.query(&[("access_token", local_var_value)]); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.query(&[("sudo", local_var_value)]); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.query(&[("token", local_var_value)]); + } + if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { + local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("Authorization", local_var_value); + }; + if let Some(ref local_var_auth_conf) = local_var_configuration.basic_auth { + local_var_req_builder = local_var_req_builder.basic_auth(local_var_auth_conf.0.to_owned(), local_var_auth_conf.1.to_owned()); + }; + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("Sudo", local_var_value); + }; + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("X-GITEA-OTP", local_var_value); + }; + local_var_req_builder = local_var_req_builder.json(&body); + + let local_var_req = local_var_req_builder.build()?; + let local_var_resp = local_var_client.execute(local_var_req).await?; + + let local_var_status = local_var_resp.status(); + let local_var_content = local_var_resp.text().await?; + + if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + serde_json::from_str(&local_var_content).map_err(Error::from) + } else { + let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); + let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; + Err(Error::ResponseError(local_var_error)) + } +} + +pub async fn repo_edit_hook(configuration: &configuration::Configuration, owner: &str, repo: &str, id: i64, body: Option) -> Result> { + let local_var_configuration = configuration; + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!("{}/repos/{owner}/{repo}/hooks/{id}", local_var_configuration.base_path, owner=crate::apis::urlencode(owner), repo=crate::apis::urlencode(repo), id=id); + let mut local_var_req_builder = local_var_client.request(reqwest::Method::PATCH, local_var_uri_str.as_str()); + + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.query(&[("access_token", local_var_value)]); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.query(&[("sudo", local_var_value)]); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.query(&[("token", local_var_value)]); + } + if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { + local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("Authorization", local_var_value); + }; + if let Some(ref local_var_auth_conf) = local_var_configuration.basic_auth { + local_var_req_builder = local_var_req_builder.basic_auth(local_var_auth_conf.0.to_owned(), local_var_auth_conf.1.to_owned()); + }; + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("Sudo", local_var_value); + }; + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("X-GITEA-OTP", local_var_value); + }; + local_var_req_builder = local_var_req_builder.json(&body); + + let local_var_req = local_var_req_builder.build()?; + let local_var_resp = local_var_client.execute(local_var_req).await?; + + let local_var_status = local_var_resp.status(); + let local_var_content = local_var_resp.text().await?; + + if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + serde_json::from_str(&local_var_content).map_err(Error::from) + } else { + let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); + let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; + Err(Error::ResponseError(local_var_error)) + } +} + +pub async fn repo_edit_pull_request(configuration: &configuration::Configuration, owner: &str, repo: &str, index: i64, body: Option) -> Result> { + let local_var_configuration = configuration; + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!("{}/repos/{owner}/{repo}/pulls/{index}", local_var_configuration.base_path, owner=crate::apis::urlencode(owner), repo=crate::apis::urlencode(repo), index=index); + let mut local_var_req_builder = local_var_client.request(reqwest::Method::PATCH, local_var_uri_str.as_str()); + + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.query(&[("access_token", local_var_value)]); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.query(&[("sudo", local_var_value)]); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.query(&[("token", local_var_value)]); + } + if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { + local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("Authorization", local_var_value); + }; + if let Some(ref local_var_auth_conf) = local_var_configuration.basic_auth { + local_var_req_builder = local_var_req_builder.basic_auth(local_var_auth_conf.0.to_owned(), local_var_auth_conf.1.to_owned()); + }; + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("Sudo", local_var_value); + }; + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("X-GITEA-OTP", local_var_value); + }; + local_var_req_builder = local_var_req_builder.json(&body); + + let local_var_req = local_var_req_builder.build()?; + let local_var_resp = local_var_client.execute(local_var_req).await?; + + let local_var_status = local_var_resp.status(); + let local_var_content = local_var_resp.text().await?; + + if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + serde_json::from_str(&local_var_content).map_err(Error::from) + } else { + let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); + let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; + Err(Error::ResponseError(local_var_error)) + } +} + +pub async fn repo_edit_release(configuration: &configuration::Configuration, owner: &str, repo: &str, id: i64, body: Option) -> Result> { + let local_var_configuration = configuration; + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!("{}/repos/{owner}/{repo}/releases/{id}", local_var_configuration.base_path, owner=crate::apis::urlencode(owner), repo=crate::apis::urlencode(repo), id=id); + let mut local_var_req_builder = local_var_client.request(reqwest::Method::PATCH, local_var_uri_str.as_str()); + + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.query(&[("access_token", local_var_value)]); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.query(&[("sudo", local_var_value)]); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.query(&[("token", local_var_value)]); + } + if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { + local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("Authorization", local_var_value); + }; + if let Some(ref local_var_auth_conf) = local_var_configuration.basic_auth { + local_var_req_builder = local_var_req_builder.basic_auth(local_var_auth_conf.0.to_owned(), local_var_auth_conf.1.to_owned()); + }; + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("Sudo", local_var_value); + }; + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("X-GITEA-OTP", local_var_value); + }; + local_var_req_builder = local_var_req_builder.json(&body); + + let local_var_req = local_var_req_builder.build()?; + let local_var_resp = local_var_client.execute(local_var_req).await?; + + let local_var_status = local_var_resp.status(); + let local_var_content = local_var_resp.text().await?; + + if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + serde_json::from_str(&local_var_content).map_err(Error::from) + } else { + let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); + let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; + Err(Error::ResponseError(local_var_error)) + } +} + +pub async fn repo_edit_release_attachment(configuration: &configuration::Configuration, owner: &str, repo: &str, id: i64, attachment_id: i64, body: Option) -> Result> { + let local_var_configuration = configuration; + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!("{}/repos/{owner}/{repo}/releases/{id}/assets/{attachment_id}", local_var_configuration.base_path, owner=crate::apis::urlencode(owner), repo=crate::apis::urlencode(repo), id=id, attachment_id=attachment_id); + let mut local_var_req_builder = local_var_client.request(reqwest::Method::PATCH, local_var_uri_str.as_str()); + + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.query(&[("access_token", local_var_value)]); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.query(&[("sudo", local_var_value)]); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.query(&[("token", local_var_value)]); + } + if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { + local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("Authorization", local_var_value); + }; + if let Some(ref local_var_auth_conf) = local_var_configuration.basic_auth { + local_var_req_builder = local_var_req_builder.basic_auth(local_var_auth_conf.0.to_owned(), local_var_auth_conf.1.to_owned()); + }; + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("Sudo", local_var_value); + }; + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("X-GITEA-OTP", local_var_value); + }; + local_var_req_builder = local_var_req_builder.json(&body); + + let local_var_req = local_var_req_builder.build()?; + let local_var_resp = local_var_client.execute(local_var_req).await?; + + let local_var_status = local_var_resp.status(); + let local_var_content = local_var_resp.text().await?; + + if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + serde_json::from_str(&local_var_content).map_err(Error::from) + } else { + let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); + let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; + Err(Error::ResponseError(local_var_error)) + } +} + +pub async fn repo_edit_wiki_page(configuration: &configuration::Configuration, owner: &str, repo: &str, page_name: &str, body: Option) -> Result> { + let local_var_configuration = configuration; + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!("{}/repos/{owner}/{repo}/wiki/page/{pageName}", local_var_configuration.base_path, owner=crate::apis::urlencode(owner), repo=crate::apis::urlencode(repo), pageName=crate::apis::urlencode(page_name)); + let mut local_var_req_builder = local_var_client.request(reqwest::Method::PATCH, local_var_uri_str.as_str()); + + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.query(&[("access_token", local_var_value)]); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.query(&[("sudo", local_var_value)]); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.query(&[("token", local_var_value)]); + } + if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { + local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("Authorization", local_var_value); + }; + if let Some(ref local_var_auth_conf) = local_var_configuration.basic_auth { + local_var_req_builder = local_var_req_builder.basic_auth(local_var_auth_conf.0.to_owned(), local_var_auth_conf.1.to_owned()); + }; + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("Sudo", local_var_value); + }; + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("X-GITEA-OTP", local_var_value); + }; + local_var_req_builder = local_var_req_builder.json(&body); + + let local_var_req = local_var_req_builder.build()?; + let local_var_resp = local_var_client.execute(local_var_req).await?; + + let local_var_status = local_var_resp.status(); + let local_var_content = local_var_resp.text().await?; + + if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + serde_json::from_str(&local_var_content).map_err(Error::from) + } else { + let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); + let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; + Err(Error::ResponseError(local_var_error)) + } +} + +pub async fn repo_get(configuration: &configuration::Configuration, owner: &str, repo: &str) -> Result> { + let local_var_configuration = configuration; + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!("{}/repos/{owner}/{repo}", local_var_configuration.base_path, owner=crate::apis::urlencode(owner), repo=crate::apis::urlencode(repo)); + let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str()); + + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.query(&[("access_token", local_var_value)]); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.query(&[("sudo", local_var_value)]); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.query(&[("token", local_var_value)]); + } + if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { + local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("Authorization", local_var_value); + }; + if let Some(ref local_var_auth_conf) = local_var_configuration.basic_auth { + local_var_req_builder = local_var_req_builder.basic_auth(local_var_auth_conf.0.to_owned(), local_var_auth_conf.1.to_owned()); + }; + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("Sudo", local_var_value); + }; + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("X-GITEA-OTP", local_var_value); + }; + + let local_var_req = local_var_req_builder.build()?; + let local_var_resp = local_var_client.execute(local_var_req).await?; + + let local_var_status = local_var_resp.status(); + let local_var_content = local_var_resp.text().await?; + + if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + serde_json::from_str(&local_var_content).map_err(Error::from) + } else { + let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); + let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; + Err(Error::ResponseError(local_var_error)) + } +} + +pub async fn repo_get_all_commits(configuration: &configuration::Configuration, owner: &str, repo: &str, sha: Option<&str>, path: Option<&str>, page: Option, limit: Option) -> Result, Error> { + let local_var_configuration = configuration; + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!("{}/repos/{owner}/{repo}/commits", local_var_configuration.base_path, owner=crate::apis::urlencode(owner), repo=crate::apis::urlencode(repo)); + let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str()); + + if let Some(ref local_var_str) = sha { + local_var_req_builder = local_var_req_builder.query(&[("sha", &local_var_str.to_string())]); + } + if let Some(ref local_var_str) = path { + local_var_req_builder = local_var_req_builder.query(&[("path", &local_var_str.to_string())]); + } + if let Some(ref local_var_str) = page { + local_var_req_builder = local_var_req_builder.query(&[("page", &local_var_str.to_string())]); + } + if let Some(ref local_var_str) = limit { + local_var_req_builder = local_var_req_builder.query(&[("limit", &local_var_str.to_string())]); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.query(&[("access_token", local_var_value)]); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.query(&[("sudo", local_var_value)]); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.query(&[("token", local_var_value)]); + } + if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { + local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("Authorization", local_var_value); + }; + if let Some(ref local_var_auth_conf) = local_var_configuration.basic_auth { + local_var_req_builder = local_var_req_builder.basic_auth(local_var_auth_conf.0.to_owned(), local_var_auth_conf.1.to_owned()); + }; + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("Sudo", local_var_value); + }; + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("X-GITEA-OTP", local_var_value); + }; + + let local_var_req = local_var_req_builder.build()?; + let local_var_resp = local_var_client.execute(local_var_req).await?; + + let local_var_status = local_var_resp.status(); + let local_var_content = local_var_resp.text().await?; + + if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + serde_json::from_str(&local_var_content).map_err(Error::from) + } else { + let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); + let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; + Err(Error::ResponseError(local_var_error)) + } +} + +pub async fn repo_get_archive(configuration: &configuration::Configuration, owner: &str, repo: &str, archive: &str) -> Result<(), Error> { + let local_var_configuration = configuration; + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!("{}/repos/{owner}/{repo}/archive/{archive}", local_var_configuration.base_path, owner=crate::apis::urlencode(owner), repo=crate::apis::urlencode(repo), archive=crate::apis::urlencode(archive)); + let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str()); + + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.query(&[("access_token", local_var_value)]); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.query(&[("sudo", local_var_value)]); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.query(&[("token", local_var_value)]); + } + if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { + local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("Authorization", local_var_value); + }; + if let Some(ref local_var_auth_conf) = local_var_configuration.basic_auth { + local_var_req_builder = local_var_req_builder.basic_auth(local_var_auth_conf.0.to_owned(), local_var_auth_conf.1.to_owned()); + }; + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("Sudo", local_var_value); + }; + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("X-GITEA-OTP", local_var_value); + }; + + let local_var_req = local_var_req_builder.build()?; + let local_var_resp = local_var_client.execute(local_var_req).await?; + + let local_var_status = local_var_resp.status(); + let local_var_content = local_var_resp.text().await?; + + if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + Ok(()) + } else { + let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); + let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; + Err(Error::ResponseError(local_var_error)) + } +} + +pub async fn repo_get_assignees(configuration: &configuration::Configuration, owner: &str, repo: &str) -> Result, Error> { + let local_var_configuration = configuration; + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!("{}/repos/{owner}/{repo}/assignees", local_var_configuration.base_path, owner=crate::apis::urlencode(owner), repo=crate::apis::urlencode(repo)); + let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str()); + + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.query(&[("access_token", local_var_value)]); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.query(&[("sudo", local_var_value)]); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.query(&[("token", local_var_value)]); + } + if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { + local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("Authorization", local_var_value); + }; + if let Some(ref local_var_auth_conf) = local_var_configuration.basic_auth { + local_var_req_builder = local_var_req_builder.basic_auth(local_var_auth_conf.0.to_owned(), local_var_auth_conf.1.to_owned()); + }; + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("Sudo", local_var_value); + }; + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("X-GITEA-OTP", local_var_value); + }; + + let local_var_req = local_var_req_builder.build()?; + let local_var_resp = local_var_client.execute(local_var_req).await?; + + let local_var_status = local_var_resp.status(); + let local_var_content = local_var_resp.text().await?; + + if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + serde_json::from_str(&local_var_content).map_err(Error::from) + } else { + let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); + let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; + Err(Error::ResponseError(local_var_error)) + } +} + +pub async fn repo_get_branch(configuration: &configuration::Configuration, owner: &str, repo: &str, branch: &str) -> Result> { + let local_var_configuration = configuration; + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!("{}/repos/{owner}/{repo}/branches/{branch}", local_var_configuration.base_path, owner=crate::apis::urlencode(owner), repo=crate::apis::urlencode(repo), branch=crate::apis::urlencode(branch)); + let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str()); + + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.query(&[("access_token", local_var_value)]); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.query(&[("sudo", local_var_value)]); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.query(&[("token", local_var_value)]); + } + if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { + local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("Authorization", local_var_value); + }; + if let Some(ref local_var_auth_conf) = local_var_configuration.basic_auth { + local_var_req_builder = local_var_req_builder.basic_auth(local_var_auth_conf.0.to_owned(), local_var_auth_conf.1.to_owned()); + }; + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("Sudo", local_var_value); + }; + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("X-GITEA-OTP", local_var_value); + }; + + let local_var_req = local_var_req_builder.build()?; + let local_var_resp = local_var_client.execute(local_var_req).await?; + + let local_var_status = local_var_resp.status(); + let local_var_content = local_var_resp.text().await?; + + if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + serde_json::from_str(&local_var_content).map_err(Error::from) + } else { + let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); + let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; + Err(Error::ResponseError(local_var_error)) + } +} + +pub async fn repo_get_branch_protection(configuration: &configuration::Configuration, owner: &str, repo: &str, name: &str) -> Result> { + let local_var_configuration = configuration; + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!("{}/repos/{owner}/{repo}/branch_protections/{name}", local_var_configuration.base_path, owner=crate::apis::urlencode(owner), repo=crate::apis::urlencode(repo), name=crate::apis::urlencode(name)); + let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str()); + + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.query(&[("access_token", local_var_value)]); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.query(&[("sudo", local_var_value)]); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.query(&[("token", local_var_value)]); + } + if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { + local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("Authorization", local_var_value); + }; + if let Some(ref local_var_auth_conf) = local_var_configuration.basic_auth { + local_var_req_builder = local_var_req_builder.basic_auth(local_var_auth_conf.0.to_owned(), local_var_auth_conf.1.to_owned()); + }; + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("Sudo", local_var_value); + }; + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("X-GITEA-OTP", local_var_value); + }; + + let local_var_req = local_var_req_builder.build()?; + let local_var_resp = local_var_client.execute(local_var_req).await?; + + let local_var_status = local_var_resp.status(); + let local_var_content = local_var_resp.text().await?; + + if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + serde_json::from_str(&local_var_content).map_err(Error::from) + } else { + let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); + let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; + Err(Error::ResponseError(local_var_error)) + } +} + +pub async fn repo_get_by_id(configuration: &configuration::Configuration, id: i64) -> Result> { + let local_var_configuration = configuration; + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!("{}/repositories/{id}", local_var_configuration.base_path, id=id); + let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str()); + + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.query(&[("access_token", local_var_value)]); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.query(&[("sudo", local_var_value)]); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.query(&[("token", local_var_value)]); + } + if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { + local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("Authorization", local_var_value); + }; + if let Some(ref local_var_auth_conf) = local_var_configuration.basic_auth { + local_var_req_builder = local_var_req_builder.basic_auth(local_var_auth_conf.0.to_owned(), local_var_auth_conf.1.to_owned()); + }; + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("Sudo", local_var_value); + }; + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("X-GITEA-OTP", local_var_value); + }; + + let local_var_req = local_var_req_builder.build()?; + let local_var_resp = local_var_client.execute(local_var_req).await?; + + let local_var_status = local_var_resp.status(); + let local_var_content = local_var_resp.text().await?; + + if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + serde_json::from_str(&local_var_content).map_err(Error::from) + } else { + let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); + let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; + Err(Error::ResponseError(local_var_error)) + } +} + +pub async fn repo_get_combined_status_by_ref(configuration: &configuration::Configuration, owner: &str, repo: &str, r#ref: &str, page: Option, limit: Option) -> Result> { + let local_var_configuration = configuration; + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!("{}/repos/{owner}/{repo}/commits/{ref}/status", local_var_configuration.base_path, owner=crate::apis::urlencode(owner), repo=crate::apis::urlencode(repo), ref=crate::apis::urlencode(r#ref)); + let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str()); + + if let Some(ref local_var_str) = page { + local_var_req_builder = local_var_req_builder.query(&[("page", &local_var_str.to_string())]); + } + if let Some(ref local_var_str) = limit { + local_var_req_builder = local_var_req_builder.query(&[("limit", &local_var_str.to_string())]); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.query(&[("access_token", local_var_value)]); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.query(&[("sudo", local_var_value)]); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.query(&[("token", local_var_value)]); + } + if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { + local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("Authorization", local_var_value); + }; + if let Some(ref local_var_auth_conf) = local_var_configuration.basic_auth { + local_var_req_builder = local_var_req_builder.basic_auth(local_var_auth_conf.0.to_owned(), local_var_auth_conf.1.to_owned()); + }; + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("Sudo", local_var_value); + }; + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("X-GITEA-OTP", local_var_value); + }; + + let local_var_req = local_var_req_builder.build()?; + let local_var_resp = local_var_client.execute(local_var_req).await?; + + let local_var_status = local_var_resp.status(); + let local_var_content = local_var_resp.text().await?; + + if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + serde_json::from_str(&local_var_content).map_err(Error::from) + } else { + let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); + let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; + Err(Error::ResponseError(local_var_error)) + } +} + +pub async fn repo_get_contents(configuration: &configuration::Configuration, owner: &str, repo: &str, filepath: &str, r#ref: Option<&str>) -> Result> { + let local_var_configuration = configuration; + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!("{}/repos/{owner}/{repo}/contents/{filepath}", local_var_configuration.base_path, owner=crate::apis::urlencode(owner), repo=crate::apis::urlencode(repo), filepath=crate::apis::urlencode(filepath)); + let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str()); + + if let Some(ref local_var_str) = r#ref { + local_var_req_builder = local_var_req_builder.query(&[("ref", &local_var_str.to_string())]); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.query(&[("access_token", local_var_value)]); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.query(&[("sudo", local_var_value)]); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.query(&[("token", local_var_value)]); + } + if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { + local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("Authorization", local_var_value); + }; + if let Some(ref local_var_auth_conf) = local_var_configuration.basic_auth { + local_var_req_builder = local_var_req_builder.basic_auth(local_var_auth_conf.0.to_owned(), local_var_auth_conf.1.to_owned()); + }; + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("Sudo", local_var_value); + }; + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("X-GITEA-OTP", local_var_value); + }; + + let local_var_req = local_var_req_builder.build()?; + let local_var_resp = local_var_client.execute(local_var_req).await?; + + let local_var_status = local_var_resp.status(); + let local_var_content = local_var_resp.text().await?; + + if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + serde_json::from_str(&local_var_content).map_err(Error::from) + } else { + let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); + let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; + Err(Error::ResponseError(local_var_error)) + } +} + +pub async fn repo_get_contents_list(configuration: &configuration::Configuration, owner: &str, repo: &str, r#ref: Option<&str>) -> Result, Error> { + let local_var_configuration = configuration; + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!("{}/repos/{owner}/{repo}/contents", local_var_configuration.base_path, owner=crate::apis::urlencode(owner), repo=crate::apis::urlencode(repo)); + let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str()); + + if let Some(ref local_var_str) = r#ref { + local_var_req_builder = local_var_req_builder.query(&[("ref", &local_var_str.to_string())]); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.query(&[("access_token", local_var_value)]); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.query(&[("sudo", local_var_value)]); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.query(&[("token", local_var_value)]); + } + if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { + local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("Authorization", local_var_value); + }; + if let Some(ref local_var_auth_conf) = local_var_configuration.basic_auth { + local_var_req_builder = local_var_req_builder.basic_auth(local_var_auth_conf.0.to_owned(), local_var_auth_conf.1.to_owned()); + }; + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("Sudo", local_var_value); + }; + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("X-GITEA-OTP", local_var_value); + }; + + let local_var_req = local_var_req_builder.build()?; + let local_var_resp = local_var_client.execute(local_var_req).await?; + + let local_var_status = local_var_resp.status(); + let local_var_content = local_var_resp.text().await?; + + if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + serde_json::from_str(&local_var_content).map_err(Error::from) + } else { + let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); + let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; + Err(Error::ResponseError(local_var_error)) + } +} + +pub async fn repo_get_editor_config(configuration: &configuration::Configuration, owner: &str, repo: &str, filepath: &str, r#ref: Option<&str>) -> Result<(), Error> { + let local_var_configuration = configuration; + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!("{}/repos/{owner}/{repo}/editorconfig/{filepath}", local_var_configuration.base_path, owner=crate::apis::urlencode(owner), repo=crate::apis::urlencode(repo), filepath=crate::apis::urlencode(filepath)); + let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str()); + + if let Some(ref local_var_str) = r#ref { + local_var_req_builder = local_var_req_builder.query(&[("ref", &local_var_str.to_string())]); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.query(&[("access_token", local_var_value)]); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.query(&[("sudo", local_var_value)]); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.query(&[("token", local_var_value)]); + } + if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { + local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("Authorization", local_var_value); + }; + if let Some(ref local_var_auth_conf) = local_var_configuration.basic_auth { + local_var_req_builder = local_var_req_builder.basic_auth(local_var_auth_conf.0.to_owned(), local_var_auth_conf.1.to_owned()); + }; + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("Sudo", local_var_value); + }; + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("X-GITEA-OTP", local_var_value); + }; + + let local_var_req = local_var_req_builder.build()?; + let local_var_resp = local_var_client.execute(local_var_req).await?; + + let local_var_status = local_var_resp.status(); + let local_var_content = local_var_resp.text().await?; + + if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + Ok(()) + } else { + let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); + let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; + Err(Error::ResponseError(local_var_error)) + } +} + +pub async fn repo_get_git_hook(configuration: &configuration::Configuration, owner: &str, repo: &str, id: &str) -> Result> { + let local_var_configuration = configuration; + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!("{}/repos/{owner}/{repo}/hooks/git/{id}", local_var_configuration.base_path, owner=crate::apis::urlencode(owner), repo=crate::apis::urlencode(repo), id=crate::apis::urlencode(id)); + let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str()); + + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.query(&[("access_token", local_var_value)]); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.query(&[("sudo", local_var_value)]); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.query(&[("token", local_var_value)]); + } + if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { + local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("Authorization", local_var_value); + }; + if let Some(ref local_var_auth_conf) = local_var_configuration.basic_auth { + local_var_req_builder = local_var_req_builder.basic_auth(local_var_auth_conf.0.to_owned(), local_var_auth_conf.1.to_owned()); + }; + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("Sudo", local_var_value); + }; + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("X-GITEA-OTP", local_var_value); + }; + + let local_var_req = local_var_req_builder.build()?; + let local_var_resp = local_var_client.execute(local_var_req).await?; + + let local_var_status = local_var_resp.status(); + let local_var_content = local_var_resp.text().await?; + + if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + serde_json::from_str(&local_var_content).map_err(Error::from) + } else { + let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); + let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; + Err(Error::ResponseError(local_var_error)) + } +} + +pub async fn repo_get_hook(configuration: &configuration::Configuration, owner: &str, repo: &str, id: i64) -> Result> { + let local_var_configuration = configuration; + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!("{}/repos/{owner}/{repo}/hooks/{id}", local_var_configuration.base_path, owner=crate::apis::urlencode(owner), repo=crate::apis::urlencode(repo), id=id); + let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str()); + + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.query(&[("access_token", local_var_value)]); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.query(&[("sudo", local_var_value)]); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.query(&[("token", local_var_value)]); + } + if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { + local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("Authorization", local_var_value); + }; + if let Some(ref local_var_auth_conf) = local_var_configuration.basic_auth { + local_var_req_builder = local_var_req_builder.basic_auth(local_var_auth_conf.0.to_owned(), local_var_auth_conf.1.to_owned()); + }; + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("Sudo", local_var_value); + }; + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("X-GITEA-OTP", local_var_value); + }; + + let local_var_req = local_var_req_builder.build()?; + let local_var_resp = local_var_client.execute(local_var_req).await?; + + let local_var_status = local_var_resp.status(); + let local_var_content = local_var_resp.text().await?; + + if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + serde_json::from_str(&local_var_content).map_err(Error::from) + } else { + let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); + let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; + Err(Error::ResponseError(local_var_error)) + } +} + +pub async fn repo_get_issue_templates(configuration: &configuration::Configuration, owner: &str, repo: &str) -> Result, Error> { + let local_var_configuration = configuration; + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!("{}/repos/{owner}/{repo}/issue_templates", local_var_configuration.base_path, owner=crate::apis::urlencode(owner), repo=crate::apis::urlencode(repo)); + let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str()); + + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.query(&[("access_token", local_var_value)]); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.query(&[("sudo", local_var_value)]); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.query(&[("token", local_var_value)]); + } + if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { + local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("Authorization", local_var_value); + }; + if let Some(ref local_var_auth_conf) = local_var_configuration.basic_auth { + local_var_req_builder = local_var_req_builder.basic_auth(local_var_auth_conf.0.to_owned(), local_var_auth_conf.1.to_owned()); + }; + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("Sudo", local_var_value); + }; + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("X-GITEA-OTP", local_var_value); + }; + + let local_var_req = local_var_req_builder.build()?; + let local_var_resp = local_var_client.execute(local_var_req).await?; + + let local_var_status = local_var_resp.status(); + let local_var_content = local_var_resp.text().await?; + + if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + serde_json::from_str(&local_var_content).map_err(Error::from) + } else { + let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); + let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; + Err(Error::ResponseError(local_var_error)) + } +} + +pub async fn repo_get_key(configuration: &configuration::Configuration, owner: &str, repo: &str, id: i64) -> Result> { + let local_var_configuration = configuration; + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!("{}/repos/{owner}/{repo}/keys/{id}", local_var_configuration.base_path, owner=crate::apis::urlencode(owner), repo=crate::apis::urlencode(repo), id=id); + let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str()); + + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.query(&[("access_token", local_var_value)]); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.query(&[("sudo", local_var_value)]); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.query(&[("token", local_var_value)]); + } + if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { + local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("Authorization", local_var_value); + }; + if let Some(ref local_var_auth_conf) = local_var_configuration.basic_auth { + local_var_req_builder = local_var_req_builder.basic_auth(local_var_auth_conf.0.to_owned(), local_var_auth_conf.1.to_owned()); + }; + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("Sudo", local_var_value); + }; + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("X-GITEA-OTP", local_var_value); + }; + + let local_var_req = local_var_req_builder.build()?; + let local_var_resp = local_var_client.execute(local_var_req).await?; + + let local_var_status = local_var_resp.status(); + let local_var_content = local_var_resp.text().await?; + + if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + serde_json::from_str(&local_var_content).map_err(Error::from) + } else { + let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); + let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; + Err(Error::ResponseError(local_var_error)) + } +} + +pub async fn repo_get_languages(configuration: &configuration::Configuration, owner: &str, repo: &str) -> Result<::std::collections::HashMap, Error> { + let local_var_configuration = configuration; + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!("{}/repos/{owner}/{repo}/languages", local_var_configuration.base_path, owner=crate::apis::urlencode(owner), repo=crate::apis::urlencode(repo)); + let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str()); + + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.query(&[("access_token", local_var_value)]); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.query(&[("sudo", local_var_value)]); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.query(&[("token", local_var_value)]); + } + if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { + local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("Authorization", local_var_value); + }; + if let Some(ref local_var_auth_conf) = local_var_configuration.basic_auth { + local_var_req_builder = local_var_req_builder.basic_auth(local_var_auth_conf.0.to_owned(), local_var_auth_conf.1.to_owned()); + }; + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("Sudo", local_var_value); + }; + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("X-GITEA-OTP", local_var_value); + }; + + let local_var_req = local_var_req_builder.build()?; + let local_var_resp = local_var_client.execute(local_var_req).await?; + + let local_var_status = local_var_resp.status(); + let local_var_content = local_var_resp.text().await?; + + if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + serde_json::from_str(&local_var_content).map_err(Error::from) + } else { + let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); + let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; + Err(Error::ResponseError(local_var_error)) + } +} + +pub async fn repo_get_note(configuration: &configuration::Configuration, owner: &str, repo: &str, sha: &str) -> Result> { + let local_var_configuration = configuration; + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!("{}/repos/{owner}/{repo}/git/notes/{sha}", local_var_configuration.base_path, owner=crate::apis::urlencode(owner), repo=crate::apis::urlencode(repo), sha=crate::apis::urlencode(sha)); + let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str()); + + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.query(&[("access_token", local_var_value)]); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.query(&[("sudo", local_var_value)]); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.query(&[("token", local_var_value)]); + } + if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { + local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("Authorization", local_var_value); + }; + if let Some(ref local_var_auth_conf) = local_var_configuration.basic_auth { + local_var_req_builder = local_var_req_builder.basic_auth(local_var_auth_conf.0.to_owned(), local_var_auth_conf.1.to_owned()); + }; + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("Sudo", local_var_value); + }; + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("X-GITEA-OTP", local_var_value); + }; + + let local_var_req = local_var_req_builder.build()?; + let local_var_resp = local_var_client.execute(local_var_req).await?; + + let local_var_status = local_var_resp.status(); + let local_var_content = local_var_resp.text().await?; + + if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + serde_json::from_str(&local_var_content).map_err(Error::from) + } else { + let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); + let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; + Err(Error::ResponseError(local_var_error)) + } +} + +pub async fn repo_get_pull_request(configuration: &configuration::Configuration, owner: &str, repo: &str, index: i64) -> Result> { + let local_var_configuration = configuration; + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!("{}/repos/{owner}/{repo}/pulls/{index}", local_var_configuration.base_path, owner=crate::apis::urlencode(owner), repo=crate::apis::urlencode(repo), index=index); + let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str()); + + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.query(&[("access_token", local_var_value)]); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.query(&[("sudo", local_var_value)]); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.query(&[("token", local_var_value)]); + } + if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { + local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("Authorization", local_var_value); + }; + if let Some(ref local_var_auth_conf) = local_var_configuration.basic_auth { + local_var_req_builder = local_var_req_builder.basic_auth(local_var_auth_conf.0.to_owned(), local_var_auth_conf.1.to_owned()); + }; + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("Sudo", local_var_value); + }; + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("X-GITEA-OTP", local_var_value); + }; + + let local_var_req = local_var_req_builder.build()?; + let local_var_resp = local_var_client.execute(local_var_req).await?; + + let local_var_status = local_var_resp.status(); + let local_var_content = local_var_resp.text().await?; + + if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + serde_json::from_str(&local_var_content).map_err(Error::from) + } else { + let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); + let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; + Err(Error::ResponseError(local_var_error)) + } +} + +pub async fn repo_get_pull_request_commits(configuration: &configuration::Configuration, owner: &str, repo: &str, index: i64, page: Option, limit: Option) -> Result, Error> { + let local_var_configuration = configuration; + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!("{}/repos/{owner}/{repo}/pulls/{index}/commits", local_var_configuration.base_path, owner=crate::apis::urlencode(owner), repo=crate::apis::urlencode(repo), index=index); + let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str()); + + if let Some(ref local_var_str) = page { + local_var_req_builder = local_var_req_builder.query(&[("page", &local_var_str.to_string())]); + } + if let Some(ref local_var_str) = limit { + local_var_req_builder = local_var_req_builder.query(&[("limit", &local_var_str.to_string())]); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.query(&[("access_token", local_var_value)]); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.query(&[("sudo", local_var_value)]); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.query(&[("token", local_var_value)]); + } + if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { + local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("Authorization", local_var_value); + }; + if let Some(ref local_var_auth_conf) = local_var_configuration.basic_auth { + local_var_req_builder = local_var_req_builder.basic_auth(local_var_auth_conf.0.to_owned(), local_var_auth_conf.1.to_owned()); + }; + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("Sudo", local_var_value); + }; + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("X-GITEA-OTP", local_var_value); + }; + + let local_var_req = local_var_req_builder.build()?; + let local_var_resp = local_var_client.execute(local_var_req).await?; + + let local_var_status = local_var_resp.status(); + let local_var_content = local_var_resp.text().await?; + + if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + serde_json::from_str(&local_var_content).map_err(Error::from) + } else { + let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); + let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; + Err(Error::ResponseError(local_var_error)) + } +} + +pub async fn repo_get_pull_review(configuration: &configuration::Configuration, owner: &str, repo: &str, index: i64, id: i64) -> Result> { + let local_var_configuration = configuration; + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!("{}/repos/{owner}/{repo}/pulls/{index}/reviews/{id}", local_var_configuration.base_path, owner=crate::apis::urlencode(owner), repo=crate::apis::urlencode(repo), index=index, id=id); + let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str()); + + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.query(&[("access_token", local_var_value)]); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.query(&[("sudo", local_var_value)]); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.query(&[("token", local_var_value)]); + } + if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { + local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("Authorization", local_var_value); + }; + if let Some(ref local_var_auth_conf) = local_var_configuration.basic_auth { + local_var_req_builder = local_var_req_builder.basic_auth(local_var_auth_conf.0.to_owned(), local_var_auth_conf.1.to_owned()); + }; + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("Sudo", local_var_value); + }; + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("X-GITEA-OTP", local_var_value); + }; + + let local_var_req = local_var_req_builder.build()?; + let local_var_resp = local_var_client.execute(local_var_req).await?; + + let local_var_status = local_var_resp.status(); + let local_var_content = local_var_resp.text().await?; + + if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + serde_json::from_str(&local_var_content).map_err(Error::from) + } else { + let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); + let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; + Err(Error::ResponseError(local_var_error)) + } +} + +pub async fn repo_get_pull_review_comments(configuration: &configuration::Configuration, owner: &str, repo: &str, index: i64, id: i64) -> Result, Error> { + let local_var_configuration = configuration; + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!("{}/repos/{owner}/{repo}/pulls/{index}/reviews/{id}/comments", local_var_configuration.base_path, owner=crate::apis::urlencode(owner), repo=crate::apis::urlencode(repo), index=index, id=id); + let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str()); + + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.query(&[("access_token", local_var_value)]); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.query(&[("sudo", local_var_value)]); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.query(&[("token", local_var_value)]); + } + if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { + local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("Authorization", local_var_value); + }; + if let Some(ref local_var_auth_conf) = local_var_configuration.basic_auth { + local_var_req_builder = local_var_req_builder.basic_auth(local_var_auth_conf.0.to_owned(), local_var_auth_conf.1.to_owned()); + }; + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("Sudo", local_var_value); + }; + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("X-GITEA-OTP", local_var_value); + }; + + let local_var_req = local_var_req_builder.build()?; + let local_var_resp = local_var_client.execute(local_var_req).await?; + + let local_var_status = local_var_resp.status(); + let local_var_content = local_var_resp.text().await?; + + if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + serde_json::from_str(&local_var_content).map_err(Error::from) + } else { + let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); + let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; + Err(Error::ResponseError(local_var_error)) + } +} + +pub async fn repo_get_raw_file(configuration: &configuration::Configuration, owner: &str, repo: &str, filepath: &str, r#ref: Option<&str>) -> Result<(), Error> { + let local_var_configuration = configuration; + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!("{}/repos/{owner}/{repo}/raw/{filepath}", local_var_configuration.base_path, owner=crate::apis::urlencode(owner), repo=crate::apis::urlencode(repo), filepath=crate::apis::urlencode(filepath)); + let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str()); + + if let Some(ref local_var_str) = r#ref { + local_var_req_builder = local_var_req_builder.query(&[("ref", &local_var_str.to_string())]); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.query(&[("access_token", local_var_value)]); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.query(&[("sudo", local_var_value)]); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.query(&[("token", local_var_value)]); + } + if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { + local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("Authorization", local_var_value); + }; + if let Some(ref local_var_auth_conf) = local_var_configuration.basic_auth { + local_var_req_builder = local_var_req_builder.basic_auth(local_var_auth_conf.0.to_owned(), local_var_auth_conf.1.to_owned()); + }; + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("Sudo", local_var_value); + }; + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("X-GITEA-OTP", local_var_value); + }; + + let local_var_req = local_var_req_builder.build()?; + let local_var_resp = local_var_client.execute(local_var_req).await?; + + let local_var_status = local_var_resp.status(); + let local_var_content = local_var_resp.text().await?; + + if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + Ok(()) + } else { + let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); + let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; + Err(Error::ResponseError(local_var_error)) + } +} + +pub async fn repo_get_raw_file_or_lfs(configuration: &configuration::Configuration, owner: &str, repo: &str, filepath: &str, r#ref: Option<&str>) -> Result<(), Error> { + let local_var_configuration = configuration; + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!("{}/repos/{owner}/{repo}/media/{filepath}", local_var_configuration.base_path, owner=crate::apis::urlencode(owner), repo=crate::apis::urlencode(repo), filepath=crate::apis::urlencode(filepath)); + let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str()); + + if let Some(ref local_var_str) = r#ref { + local_var_req_builder = local_var_req_builder.query(&[("ref", &local_var_str.to_string())]); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.query(&[("access_token", local_var_value)]); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.query(&[("sudo", local_var_value)]); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.query(&[("token", local_var_value)]); + } + if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { + local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("Authorization", local_var_value); + }; + if let Some(ref local_var_auth_conf) = local_var_configuration.basic_auth { + local_var_req_builder = local_var_req_builder.basic_auth(local_var_auth_conf.0.to_owned(), local_var_auth_conf.1.to_owned()); + }; + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("Sudo", local_var_value); + }; + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("X-GITEA-OTP", local_var_value); + }; + + let local_var_req = local_var_req_builder.build()?; + let local_var_resp = local_var_client.execute(local_var_req).await?; + + let local_var_status = local_var_resp.status(); + let local_var_content = local_var_resp.text().await?; + + if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + Ok(()) + } else { + let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); + let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; + Err(Error::ResponseError(local_var_error)) + } +} + +pub async fn repo_get_release(configuration: &configuration::Configuration, owner: &str, repo: &str, id: i64) -> Result> { + let local_var_configuration = configuration; + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!("{}/repos/{owner}/{repo}/releases/{id}", local_var_configuration.base_path, owner=crate::apis::urlencode(owner), repo=crate::apis::urlencode(repo), id=id); + let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str()); + + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.query(&[("access_token", local_var_value)]); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.query(&[("sudo", local_var_value)]); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.query(&[("token", local_var_value)]); + } + if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { + local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("Authorization", local_var_value); + }; + if let Some(ref local_var_auth_conf) = local_var_configuration.basic_auth { + local_var_req_builder = local_var_req_builder.basic_auth(local_var_auth_conf.0.to_owned(), local_var_auth_conf.1.to_owned()); + }; + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("Sudo", local_var_value); + }; + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("X-GITEA-OTP", local_var_value); + }; + + let local_var_req = local_var_req_builder.build()?; + let local_var_resp = local_var_client.execute(local_var_req).await?; + + let local_var_status = local_var_resp.status(); + let local_var_content = local_var_resp.text().await?; + + if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + serde_json::from_str(&local_var_content).map_err(Error::from) + } else { + let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); + let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; + Err(Error::ResponseError(local_var_error)) + } +} + +pub async fn repo_get_release_attachment(configuration: &configuration::Configuration, owner: &str, repo: &str, id: i64, attachment_id: i64) -> Result> { + let local_var_configuration = configuration; + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!("{}/repos/{owner}/{repo}/releases/{id}/assets/{attachment_id}", local_var_configuration.base_path, owner=crate::apis::urlencode(owner), repo=crate::apis::urlencode(repo), id=id, attachment_id=attachment_id); + let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str()); + + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.query(&[("access_token", local_var_value)]); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.query(&[("sudo", local_var_value)]); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.query(&[("token", local_var_value)]); + } + if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { + local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("Authorization", local_var_value); + }; + if let Some(ref local_var_auth_conf) = local_var_configuration.basic_auth { + local_var_req_builder = local_var_req_builder.basic_auth(local_var_auth_conf.0.to_owned(), local_var_auth_conf.1.to_owned()); + }; + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("Sudo", local_var_value); + }; + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("X-GITEA-OTP", local_var_value); + }; + + let local_var_req = local_var_req_builder.build()?; + let local_var_resp = local_var_client.execute(local_var_req).await?; + + let local_var_status = local_var_resp.status(); + let local_var_content = local_var_resp.text().await?; + + if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + serde_json::from_str(&local_var_content).map_err(Error::from) + } else { + let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); + let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; + Err(Error::ResponseError(local_var_error)) + } +} + +pub async fn repo_get_release_by_tag(configuration: &configuration::Configuration, owner: &str, repo: &str, tag: &str) -> Result> { + let local_var_configuration = configuration; + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!("{}/repos/{owner}/{repo}/releases/tags/{tag}", local_var_configuration.base_path, owner=crate::apis::urlencode(owner), repo=crate::apis::urlencode(repo), tag=crate::apis::urlencode(tag)); + let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str()); + + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.query(&[("access_token", local_var_value)]); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.query(&[("sudo", local_var_value)]); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.query(&[("token", local_var_value)]); + } + if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { + local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("Authorization", local_var_value); + }; + if let Some(ref local_var_auth_conf) = local_var_configuration.basic_auth { + local_var_req_builder = local_var_req_builder.basic_auth(local_var_auth_conf.0.to_owned(), local_var_auth_conf.1.to_owned()); + }; + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("Sudo", local_var_value); + }; + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("X-GITEA-OTP", local_var_value); + }; + + let local_var_req = local_var_req_builder.build()?; + let local_var_resp = local_var_client.execute(local_var_req).await?; + + let local_var_status = local_var_resp.status(); + let local_var_content = local_var_resp.text().await?; + + if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + serde_json::from_str(&local_var_content).map_err(Error::from) + } else { + let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); + let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; + Err(Error::ResponseError(local_var_error)) + } +} + +pub async fn repo_get_repo_permissions(configuration: &configuration::Configuration, owner: &str, repo: &str, collaborator: &str) -> Result> { + let local_var_configuration = configuration; + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!("{}/repos/{owner}/{repo}/collaborators/{collaborator}/permission", local_var_configuration.base_path, owner=crate::apis::urlencode(owner), repo=crate::apis::urlencode(repo), collaborator=crate::apis::urlencode(collaborator)); + let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str()); + + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.query(&[("access_token", local_var_value)]); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.query(&[("sudo", local_var_value)]); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.query(&[("token", local_var_value)]); + } + if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { + local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("Authorization", local_var_value); + }; + if let Some(ref local_var_auth_conf) = local_var_configuration.basic_auth { + local_var_req_builder = local_var_req_builder.basic_auth(local_var_auth_conf.0.to_owned(), local_var_auth_conf.1.to_owned()); + }; + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("Sudo", local_var_value); + }; + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("X-GITEA-OTP", local_var_value); + }; + + let local_var_req = local_var_req_builder.build()?; + let local_var_resp = local_var_client.execute(local_var_req).await?; + + let local_var_status = local_var_resp.status(); + let local_var_content = local_var_resp.text().await?; + + if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + serde_json::from_str(&local_var_content).map_err(Error::from) + } else { + let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); + let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; + Err(Error::ResponseError(local_var_error)) + } +} + +pub async fn repo_get_reviewers(configuration: &configuration::Configuration, owner: &str, repo: &str) -> Result, Error> { + let local_var_configuration = configuration; + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!("{}/repos/{owner}/{repo}/reviewers", local_var_configuration.base_path, owner=crate::apis::urlencode(owner), repo=crate::apis::urlencode(repo)); + let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str()); + + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.query(&[("access_token", local_var_value)]); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.query(&[("sudo", local_var_value)]); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.query(&[("token", local_var_value)]); + } + if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { + local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("Authorization", local_var_value); + }; + if let Some(ref local_var_auth_conf) = local_var_configuration.basic_auth { + local_var_req_builder = local_var_req_builder.basic_auth(local_var_auth_conf.0.to_owned(), local_var_auth_conf.1.to_owned()); + }; + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("Sudo", local_var_value); + }; + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("X-GITEA-OTP", local_var_value); + }; + + let local_var_req = local_var_req_builder.build()?; + let local_var_resp = local_var_client.execute(local_var_req).await?; + + let local_var_status = local_var_resp.status(); + let local_var_content = local_var_resp.text().await?; + + if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + serde_json::from_str(&local_var_content).map_err(Error::from) + } else { + let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); + let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; + Err(Error::ResponseError(local_var_error)) + } +} + +pub async fn repo_get_single_commit(configuration: &configuration::Configuration, owner: &str, repo: &str, sha: &str) -> Result> { + let local_var_configuration = configuration; + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!("{}/repos/{owner}/{repo}/git/commits/{sha}", local_var_configuration.base_path, owner=crate::apis::urlencode(owner), repo=crate::apis::urlencode(repo), sha=crate::apis::urlencode(sha)); + let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str()); + + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.query(&[("access_token", local_var_value)]); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.query(&[("sudo", local_var_value)]); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.query(&[("token", local_var_value)]); + } + if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { + local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("Authorization", local_var_value); + }; + if let Some(ref local_var_auth_conf) = local_var_configuration.basic_auth { + local_var_req_builder = local_var_req_builder.basic_auth(local_var_auth_conf.0.to_owned(), local_var_auth_conf.1.to_owned()); + }; + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("Sudo", local_var_value); + }; + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("X-GITEA-OTP", local_var_value); + }; + + let local_var_req = local_var_req_builder.build()?; + let local_var_resp = local_var_client.execute(local_var_req).await?; + + let local_var_status = local_var_resp.status(); + let local_var_content = local_var_resp.text().await?; + + if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + serde_json::from_str(&local_var_content).map_err(Error::from) + } else { + let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); + let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; + Err(Error::ResponseError(local_var_error)) + } +} + +pub async fn repo_get_tag(configuration: &configuration::Configuration, owner: &str, repo: &str, tag: &str) -> Result> { + let local_var_configuration = configuration; + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!("{}/repos/{owner}/{repo}/tags/{tag}", local_var_configuration.base_path, owner=crate::apis::urlencode(owner), repo=crate::apis::urlencode(repo), tag=crate::apis::urlencode(tag)); + let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str()); + + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.query(&[("access_token", local_var_value)]); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.query(&[("sudo", local_var_value)]); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.query(&[("token", local_var_value)]); + } + if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { + local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("Authorization", local_var_value); + }; + if let Some(ref local_var_auth_conf) = local_var_configuration.basic_auth { + local_var_req_builder = local_var_req_builder.basic_auth(local_var_auth_conf.0.to_owned(), local_var_auth_conf.1.to_owned()); + }; + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("Sudo", local_var_value); + }; + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("X-GITEA-OTP", local_var_value); + }; + + let local_var_req = local_var_req_builder.build()?; + let local_var_resp = local_var_client.execute(local_var_req).await?; + + let local_var_status = local_var_resp.status(); + let local_var_content = local_var_resp.text().await?; + + if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + serde_json::from_str(&local_var_content).map_err(Error::from) + } else { + let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); + let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; + Err(Error::ResponseError(local_var_error)) + } +} + +pub async fn repo_get_wiki_page(configuration: &configuration::Configuration, owner: &str, repo: &str, page_name: &str) -> Result> { + let local_var_configuration = configuration; + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!("{}/repos/{owner}/{repo}/wiki/page/{pageName}", local_var_configuration.base_path, owner=crate::apis::urlencode(owner), repo=crate::apis::urlencode(repo), pageName=crate::apis::urlencode(page_name)); + let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str()); + + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.query(&[("access_token", local_var_value)]); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.query(&[("sudo", local_var_value)]); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.query(&[("token", local_var_value)]); + } + if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { + local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("Authorization", local_var_value); + }; + if let Some(ref local_var_auth_conf) = local_var_configuration.basic_auth { + local_var_req_builder = local_var_req_builder.basic_auth(local_var_auth_conf.0.to_owned(), local_var_auth_conf.1.to_owned()); + }; + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("Sudo", local_var_value); + }; + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("X-GITEA-OTP", local_var_value); + }; + + let local_var_req = local_var_req_builder.build()?; + let local_var_resp = local_var_client.execute(local_var_req).await?; + + let local_var_status = local_var_resp.status(); + let local_var_content = local_var_resp.text().await?; + + if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + serde_json::from_str(&local_var_content).map_err(Error::from) + } else { + let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); + let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; + Err(Error::ResponseError(local_var_error)) + } +} + +pub async fn repo_get_wiki_page_revisions(configuration: &configuration::Configuration, owner: &str, repo: &str, page_name: &str, page: Option) -> Result> { + let local_var_configuration = configuration; + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!("{}/repos/{owner}/{repo}/wiki/revisions/{pageName}", local_var_configuration.base_path, owner=crate::apis::urlencode(owner), repo=crate::apis::urlencode(repo), pageName=crate::apis::urlencode(page_name)); + let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str()); + + if let Some(ref local_var_str) = page { + local_var_req_builder = local_var_req_builder.query(&[("page", &local_var_str.to_string())]); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.query(&[("access_token", local_var_value)]); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.query(&[("sudo", local_var_value)]); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.query(&[("token", local_var_value)]); + } + if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { + local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("Authorization", local_var_value); + }; + if let Some(ref local_var_auth_conf) = local_var_configuration.basic_auth { + local_var_req_builder = local_var_req_builder.basic_auth(local_var_auth_conf.0.to_owned(), local_var_auth_conf.1.to_owned()); + }; + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("Sudo", local_var_value); + }; + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("X-GITEA-OTP", local_var_value); + }; + + let local_var_req = local_var_req_builder.build()?; + let local_var_resp = local_var_client.execute(local_var_req).await?; + + let local_var_status = local_var_resp.status(); + let local_var_content = local_var_resp.text().await?; + + if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + serde_json::from_str(&local_var_content).map_err(Error::from) + } else { + let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); + let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; + Err(Error::ResponseError(local_var_error)) + } +} + +pub async fn repo_get_wiki_pages(configuration: &configuration::Configuration, owner: &str, repo: &str, page: Option, limit: Option) -> Result, Error> { + let local_var_configuration = configuration; + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!("{}/repos/{owner}/{repo}/wiki/pages", local_var_configuration.base_path, owner=crate::apis::urlencode(owner), repo=crate::apis::urlencode(repo)); + let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str()); + + if let Some(ref local_var_str) = page { + local_var_req_builder = local_var_req_builder.query(&[("page", &local_var_str.to_string())]); + } + if let Some(ref local_var_str) = limit { + local_var_req_builder = local_var_req_builder.query(&[("limit", &local_var_str.to_string())]); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.query(&[("access_token", local_var_value)]); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.query(&[("sudo", local_var_value)]); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.query(&[("token", local_var_value)]); + } + if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { + local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("Authorization", local_var_value); + }; + if let Some(ref local_var_auth_conf) = local_var_configuration.basic_auth { + local_var_req_builder = local_var_req_builder.basic_auth(local_var_auth_conf.0.to_owned(), local_var_auth_conf.1.to_owned()); + }; + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("Sudo", local_var_value); + }; + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("X-GITEA-OTP", local_var_value); + }; + + let local_var_req = local_var_req_builder.build()?; + let local_var_resp = local_var_client.execute(local_var_req).await?; + + let local_var_status = local_var_resp.status(); + let local_var_content = local_var_resp.text().await?; + + if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + serde_json::from_str(&local_var_content).map_err(Error::from) + } else { + let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); + let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; + Err(Error::ResponseError(local_var_error)) + } +} + +pub async fn repo_list_all_git_refs(configuration: &configuration::Configuration, owner: &str, repo: &str) -> Result, Error> { + let local_var_configuration = configuration; + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!("{}/repos/{owner}/{repo}/git/refs", local_var_configuration.base_path, owner=crate::apis::urlencode(owner), repo=crate::apis::urlencode(repo)); + let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str()); + + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.query(&[("access_token", local_var_value)]); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.query(&[("sudo", local_var_value)]); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.query(&[("token", local_var_value)]); + } + if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { + local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("Authorization", local_var_value); + }; + if let Some(ref local_var_auth_conf) = local_var_configuration.basic_auth { + local_var_req_builder = local_var_req_builder.basic_auth(local_var_auth_conf.0.to_owned(), local_var_auth_conf.1.to_owned()); + }; + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("Sudo", local_var_value); + }; + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("X-GITEA-OTP", local_var_value); + }; + + let local_var_req = local_var_req_builder.build()?; + let local_var_resp = local_var_client.execute(local_var_req).await?; + + let local_var_status = local_var_resp.status(); + let local_var_content = local_var_resp.text().await?; + + if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + serde_json::from_str(&local_var_content).map_err(Error::from) + } else { + let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); + let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; + Err(Error::ResponseError(local_var_error)) + } +} + +pub async fn repo_list_branch_protection(configuration: &configuration::Configuration, owner: &str, repo: &str) -> Result, Error> { + let local_var_configuration = configuration; + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!("{}/repos/{owner}/{repo}/branch_protections", local_var_configuration.base_path, owner=crate::apis::urlencode(owner), repo=crate::apis::urlencode(repo)); + let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str()); + + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.query(&[("access_token", local_var_value)]); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.query(&[("sudo", local_var_value)]); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.query(&[("token", local_var_value)]); + } + if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { + local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("Authorization", local_var_value); + }; + if let Some(ref local_var_auth_conf) = local_var_configuration.basic_auth { + local_var_req_builder = local_var_req_builder.basic_auth(local_var_auth_conf.0.to_owned(), local_var_auth_conf.1.to_owned()); + }; + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("Sudo", local_var_value); + }; + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("X-GITEA-OTP", local_var_value); + }; + + let local_var_req = local_var_req_builder.build()?; + let local_var_resp = local_var_client.execute(local_var_req).await?; + + let local_var_status = local_var_resp.status(); + let local_var_content = local_var_resp.text().await?; + + if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + serde_json::from_str(&local_var_content).map_err(Error::from) + } else { + let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); + let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; + Err(Error::ResponseError(local_var_error)) + } +} + +pub async fn repo_list_branches(configuration: &configuration::Configuration, owner: &str, repo: &str, page: Option, limit: Option) -> Result, Error> { + let local_var_configuration = configuration; + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!("{}/repos/{owner}/{repo}/branches", local_var_configuration.base_path, owner=crate::apis::urlencode(owner), repo=crate::apis::urlencode(repo)); + let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str()); + + if let Some(ref local_var_str) = page { + local_var_req_builder = local_var_req_builder.query(&[("page", &local_var_str.to_string())]); + } + if let Some(ref local_var_str) = limit { + local_var_req_builder = local_var_req_builder.query(&[("limit", &local_var_str.to_string())]); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.query(&[("access_token", local_var_value)]); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.query(&[("sudo", local_var_value)]); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.query(&[("token", local_var_value)]); + } + if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { + local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("Authorization", local_var_value); + }; + if let Some(ref local_var_auth_conf) = local_var_configuration.basic_auth { + local_var_req_builder = local_var_req_builder.basic_auth(local_var_auth_conf.0.to_owned(), local_var_auth_conf.1.to_owned()); + }; + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("Sudo", local_var_value); + }; + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("X-GITEA-OTP", local_var_value); + }; + + let local_var_req = local_var_req_builder.build()?; + let local_var_resp = local_var_client.execute(local_var_req).await?; + + let local_var_status = local_var_resp.status(); + let local_var_content = local_var_resp.text().await?; + + if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + serde_json::from_str(&local_var_content).map_err(Error::from) + } else { + let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); + let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; + Err(Error::ResponseError(local_var_error)) + } +} + +pub async fn repo_list_collaborators(configuration: &configuration::Configuration, owner: &str, repo: &str, page: Option, limit: Option) -> Result, Error> { + let local_var_configuration = configuration; + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!("{}/repos/{owner}/{repo}/collaborators", local_var_configuration.base_path, owner=crate::apis::urlencode(owner), repo=crate::apis::urlencode(repo)); + let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str()); + + if let Some(ref local_var_str) = page { + local_var_req_builder = local_var_req_builder.query(&[("page", &local_var_str.to_string())]); + } + if let Some(ref local_var_str) = limit { + local_var_req_builder = local_var_req_builder.query(&[("limit", &local_var_str.to_string())]); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.query(&[("access_token", local_var_value)]); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.query(&[("sudo", local_var_value)]); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.query(&[("token", local_var_value)]); + } + if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { + local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("Authorization", local_var_value); + }; + if let Some(ref local_var_auth_conf) = local_var_configuration.basic_auth { + local_var_req_builder = local_var_req_builder.basic_auth(local_var_auth_conf.0.to_owned(), local_var_auth_conf.1.to_owned()); + }; + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("Sudo", local_var_value); + }; + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("X-GITEA-OTP", local_var_value); + }; + + let local_var_req = local_var_req_builder.build()?; + let local_var_resp = local_var_client.execute(local_var_req).await?; + + let local_var_status = local_var_resp.status(); + let local_var_content = local_var_resp.text().await?; + + if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + serde_json::from_str(&local_var_content).map_err(Error::from) + } else { + let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); + let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; + Err(Error::ResponseError(local_var_error)) + } +} + +pub async fn repo_list_git_hooks(configuration: &configuration::Configuration, owner: &str, repo: &str) -> Result, Error> { + let local_var_configuration = configuration; + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!("{}/repos/{owner}/{repo}/hooks/git", local_var_configuration.base_path, owner=crate::apis::urlencode(owner), repo=crate::apis::urlencode(repo)); + let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str()); + + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.query(&[("access_token", local_var_value)]); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.query(&[("sudo", local_var_value)]); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.query(&[("token", local_var_value)]); + } + if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { + local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("Authorization", local_var_value); + }; + if let Some(ref local_var_auth_conf) = local_var_configuration.basic_auth { + local_var_req_builder = local_var_req_builder.basic_auth(local_var_auth_conf.0.to_owned(), local_var_auth_conf.1.to_owned()); + }; + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("Sudo", local_var_value); + }; + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("X-GITEA-OTP", local_var_value); + }; + + let local_var_req = local_var_req_builder.build()?; + let local_var_resp = local_var_client.execute(local_var_req).await?; + + let local_var_status = local_var_resp.status(); + let local_var_content = local_var_resp.text().await?; + + if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + serde_json::from_str(&local_var_content).map_err(Error::from) + } else { + let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); + let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; + Err(Error::ResponseError(local_var_error)) + } +} + +pub async fn repo_list_git_refs(configuration: &configuration::Configuration, owner: &str, repo: &str, r#ref: &str) -> Result, Error> { + let local_var_configuration = configuration; + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!("{}/repos/{owner}/{repo}/git/refs/{ref}", local_var_configuration.base_path, owner=crate::apis::urlencode(owner), repo=crate::apis::urlencode(repo), ref=crate::apis::urlencode(r#ref)); + let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str()); + + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.query(&[("access_token", local_var_value)]); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.query(&[("sudo", local_var_value)]); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.query(&[("token", local_var_value)]); + } + if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { + local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("Authorization", local_var_value); + }; + if let Some(ref local_var_auth_conf) = local_var_configuration.basic_auth { + local_var_req_builder = local_var_req_builder.basic_auth(local_var_auth_conf.0.to_owned(), local_var_auth_conf.1.to_owned()); + }; + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("Sudo", local_var_value); + }; + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("X-GITEA-OTP", local_var_value); + }; + + let local_var_req = local_var_req_builder.build()?; + let local_var_resp = local_var_client.execute(local_var_req).await?; + + let local_var_status = local_var_resp.status(); + let local_var_content = local_var_resp.text().await?; + + if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + serde_json::from_str(&local_var_content).map_err(Error::from) + } else { + let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); + let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; + Err(Error::ResponseError(local_var_error)) + } +} + +pub async fn repo_list_hooks(configuration: &configuration::Configuration, owner: &str, repo: &str, page: Option, limit: Option) -> Result, Error> { + let local_var_configuration = configuration; + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!("{}/repos/{owner}/{repo}/hooks", local_var_configuration.base_path, owner=crate::apis::urlencode(owner), repo=crate::apis::urlencode(repo)); + let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str()); + + if let Some(ref local_var_str) = page { + local_var_req_builder = local_var_req_builder.query(&[("page", &local_var_str.to_string())]); + } + if let Some(ref local_var_str) = limit { + local_var_req_builder = local_var_req_builder.query(&[("limit", &local_var_str.to_string())]); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.query(&[("access_token", local_var_value)]); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.query(&[("sudo", local_var_value)]); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.query(&[("token", local_var_value)]); + } + if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { + local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("Authorization", local_var_value); + }; + if let Some(ref local_var_auth_conf) = local_var_configuration.basic_auth { + local_var_req_builder = local_var_req_builder.basic_auth(local_var_auth_conf.0.to_owned(), local_var_auth_conf.1.to_owned()); + }; + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("Sudo", local_var_value); + }; + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("X-GITEA-OTP", local_var_value); + }; + + let local_var_req = local_var_req_builder.build()?; + let local_var_resp = local_var_client.execute(local_var_req).await?; + + let local_var_status = local_var_resp.status(); + let local_var_content = local_var_resp.text().await?; + + if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + serde_json::from_str(&local_var_content).map_err(Error::from) + } else { + let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); + let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; + Err(Error::ResponseError(local_var_error)) + } +} + +pub async fn repo_list_keys(configuration: &configuration::Configuration, owner: &str, repo: &str, key_id: Option, fingerprint: Option<&str>, page: Option, limit: Option) -> Result, Error> { + let local_var_configuration = configuration; + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!("{}/repos/{owner}/{repo}/keys", local_var_configuration.base_path, owner=crate::apis::urlencode(owner), repo=crate::apis::urlencode(repo)); + let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str()); + + if let Some(ref local_var_str) = key_id { + local_var_req_builder = local_var_req_builder.query(&[("key_id", &local_var_str.to_string())]); + } + if let Some(ref local_var_str) = fingerprint { + local_var_req_builder = local_var_req_builder.query(&[("fingerprint", &local_var_str.to_string())]); + } + if let Some(ref local_var_str) = page { + local_var_req_builder = local_var_req_builder.query(&[("page", &local_var_str.to_string())]); + } + if let Some(ref local_var_str) = limit { + local_var_req_builder = local_var_req_builder.query(&[("limit", &local_var_str.to_string())]); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.query(&[("access_token", local_var_value)]); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.query(&[("sudo", local_var_value)]); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.query(&[("token", local_var_value)]); + } + if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { + local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("Authorization", local_var_value); + }; + if let Some(ref local_var_auth_conf) = local_var_configuration.basic_auth { + local_var_req_builder = local_var_req_builder.basic_auth(local_var_auth_conf.0.to_owned(), local_var_auth_conf.1.to_owned()); + }; + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("Sudo", local_var_value); + }; + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("X-GITEA-OTP", local_var_value); + }; + + let local_var_req = local_var_req_builder.build()?; + let local_var_resp = local_var_client.execute(local_var_req).await?; + + let local_var_status = local_var_resp.status(); + let local_var_content = local_var_resp.text().await?; + + if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + serde_json::from_str(&local_var_content).map_err(Error::from) + } else { + let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); + let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; + Err(Error::ResponseError(local_var_error)) + } +} + +pub async fn repo_list_pull_requests(configuration: &configuration::Configuration, owner: &str, repo: &str, state: Option<&str>, sort: Option<&str>, milestone: Option, labels: Option>, page: Option, limit: Option) -> Result, Error> { + let local_var_configuration = configuration; + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!("{}/repos/{owner}/{repo}/pulls", local_var_configuration.base_path, owner=crate::apis::urlencode(owner), repo=crate::apis::urlencode(repo)); + let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str()); + + if let Some(ref local_var_str) = state { + local_var_req_builder = local_var_req_builder.query(&[("state", &local_var_str.to_string())]); + } + if let Some(ref local_var_str) = sort { + local_var_req_builder = local_var_req_builder.query(&[("sort", &local_var_str.to_string())]); + } + if let Some(ref local_var_str) = milestone { + local_var_req_builder = local_var_req_builder.query(&[("milestone", &local_var_str.to_string())]); + } + if let Some(ref local_var_str) = labels { + local_var_req_builder = match "multi" { + "multi" => local_var_req_builder.query(&local_var_str.into_iter().map(|p| ("labels".to_owned(), p.to_string())).collect::>()), + _ => local_var_req_builder.query(&[("labels", &local_var_str.into_iter().map(|p| p.to_string()).collect::>().join(",").to_string())]), + }; + } + if let Some(ref local_var_str) = page { + local_var_req_builder = local_var_req_builder.query(&[("page", &local_var_str.to_string())]); + } + if let Some(ref local_var_str) = limit { + local_var_req_builder = local_var_req_builder.query(&[("limit", &local_var_str.to_string())]); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.query(&[("access_token", local_var_value)]); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.query(&[("sudo", local_var_value)]); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.query(&[("token", local_var_value)]); + } + if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { + local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("Authorization", local_var_value); + }; + if let Some(ref local_var_auth_conf) = local_var_configuration.basic_auth { + local_var_req_builder = local_var_req_builder.basic_auth(local_var_auth_conf.0.to_owned(), local_var_auth_conf.1.to_owned()); + }; + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("Sudo", local_var_value); + }; + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("X-GITEA-OTP", local_var_value); + }; + + let local_var_req = local_var_req_builder.build()?; + let local_var_resp = local_var_client.execute(local_var_req).await?; + + let local_var_status = local_var_resp.status(); + let local_var_content = local_var_resp.text().await?; + + if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + serde_json::from_str(&local_var_content).map_err(Error::from) + } else { + let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); + let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; + Err(Error::ResponseError(local_var_error)) + } +} + +pub async fn repo_list_pull_reviews(configuration: &configuration::Configuration, owner: &str, repo: &str, index: i64, page: Option, limit: Option) -> Result, Error> { + let local_var_configuration = configuration; + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!("{}/repos/{owner}/{repo}/pulls/{index}/reviews", local_var_configuration.base_path, owner=crate::apis::urlencode(owner), repo=crate::apis::urlencode(repo), index=index); + let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str()); + + if let Some(ref local_var_str) = page { + local_var_req_builder = local_var_req_builder.query(&[("page", &local_var_str.to_string())]); + } + if let Some(ref local_var_str) = limit { + local_var_req_builder = local_var_req_builder.query(&[("limit", &local_var_str.to_string())]); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.query(&[("access_token", local_var_value)]); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.query(&[("sudo", local_var_value)]); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.query(&[("token", local_var_value)]); + } + if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { + local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("Authorization", local_var_value); + }; + if let Some(ref local_var_auth_conf) = local_var_configuration.basic_auth { + local_var_req_builder = local_var_req_builder.basic_auth(local_var_auth_conf.0.to_owned(), local_var_auth_conf.1.to_owned()); + }; + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("Sudo", local_var_value); + }; + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("X-GITEA-OTP", local_var_value); + }; + + let local_var_req = local_var_req_builder.build()?; + let local_var_resp = local_var_client.execute(local_var_req).await?; + + let local_var_status = local_var_resp.status(); + let local_var_content = local_var_resp.text().await?; + + if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + serde_json::from_str(&local_var_content).map_err(Error::from) + } else { + let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); + let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; + Err(Error::ResponseError(local_var_error)) + } +} + +pub async fn repo_list_release_attachments(configuration: &configuration::Configuration, owner: &str, repo: &str, id: i64) -> Result, Error> { + let local_var_configuration = configuration; + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!("{}/repos/{owner}/{repo}/releases/{id}/assets", local_var_configuration.base_path, owner=crate::apis::urlencode(owner), repo=crate::apis::urlencode(repo), id=id); + let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str()); + + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.query(&[("access_token", local_var_value)]); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.query(&[("sudo", local_var_value)]); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.query(&[("token", local_var_value)]); + } + if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { + local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("Authorization", local_var_value); + }; + if let Some(ref local_var_auth_conf) = local_var_configuration.basic_auth { + local_var_req_builder = local_var_req_builder.basic_auth(local_var_auth_conf.0.to_owned(), local_var_auth_conf.1.to_owned()); + }; + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("Sudo", local_var_value); + }; + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("X-GITEA-OTP", local_var_value); + }; + + let local_var_req = local_var_req_builder.build()?; + let local_var_resp = local_var_client.execute(local_var_req).await?; + + let local_var_status = local_var_resp.status(); + let local_var_content = local_var_resp.text().await?; + + if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + serde_json::from_str(&local_var_content).map_err(Error::from) + } else { + let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); + let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; + Err(Error::ResponseError(local_var_error)) + } +} + +pub async fn repo_list_releases(configuration: &configuration::Configuration, owner: &str, repo: &str, draft: Option, pre_release: Option, per_page: Option, page: Option, limit: Option) -> Result, Error> { + let local_var_configuration = configuration; + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!("{}/repos/{owner}/{repo}/releases", local_var_configuration.base_path, owner=crate::apis::urlencode(owner), repo=crate::apis::urlencode(repo)); + let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str()); + + if let Some(ref local_var_str) = draft { + local_var_req_builder = local_var_req_builder.query(&[("draft", &local_var_str.to_string())]); + } + if let Some(ref local_var_str) = pre_release { + local_var_req_builder = local_var_req_builder.query(&[("pre-release", &local_var_str.to_string())]); + } + if let Some(ref local_var_str) = per_page { + local_var_req_builder = local_var_req_builder.query(&[("per_page", &local_var_str.to_string())]); + } + if let Some(ref local_var_str) = page { + local_var_req_builder = local_var_req_builder.query(&[("page", &local_var_str.to_string())]); + } + if let Some(ref local_var_str) = limit { + local_var_req_builder = local_var_req_builder.query(&[("limit", &local_var_str.to_string())]); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.query(&[("access_token", local_var_value)]); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.query(&[("sudo", local_var_value)]); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.query(&[("token", local_var_value)]); + } + if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { + local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("Authorization", local_var_value); + }; + if let Some(ref local_var_auth_conf) = local_var_configuration.basic_auth { + local_var_req_builder = local_var_req_builder.basic_auth(local_var_auth_conf.0.to_owned(), local_var_auth_conf.1.to_owned()); + }; + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("Sudo", local_var_value); + }; + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("X-GITEA-OTP", local_var_value); + }; + + let local_var_req = local_var_req_builder.build()?; + let local_var_resp = local_var_client.execute(local_var_req).await?; + + let local_var_status = local_var_resp.status(); + let local_var_content = local_var_resp.text().await?; + + if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + serde_json::from_str(&local_var_content).map_err(Error::from) + } else { + let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); + let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; + Err(Error::ResponseError(local_var_error)) + } +} + +pub async fn repo_list_stargazers(configuration: &configuration::Configuration, owner: &str, repo: &str, page: Option, limit: Option) -> Result, Error> { + let local_var_configuration = configuration; + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!("{}/repos/{owner}/{repo}/stargazers", local_var_configuration.base_path, owner=crate::apis::urlencode(owner), repo=crate::apis::urlencode(repo)); + let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str()); + + if let Some(ref local_var_str) = page { + local_var_req_builder = local_var_req_builder.query(&[("page", &local_var_str.to_string())]); + } + if let Some(ref local_var_str) = limit { + local_var_req_builder = local_var_req_builder.query(&[("limit", &local_var_str.to_string())]); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.query(&[("access_token", local_var_value)]); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.query(&[("sudo", local_var_value)]); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.query(&[("token", local_var_value)]); + } + if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { + local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("Authorization", local_var_value); + }; + if let Some(ref local_var_auth_conf) = local_var_configuration.basic_auth { + local_var_req_builder = local_var_req_builder.basic_auth(local_var_auth_conf.0.to_owned(), local_var_auth_conf.1.to_owned()); + }; + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("Sudo", local_var_value); + }; + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("X-GITEA-OTP", local_var_value); + }; + + let local_var_req = local_var_req_builder.build()?; + let local_var_resp = local_var_client.execute(local_var_req).await?; + + let local_var_status = local_var_resp.status(); + let local_var_content = local_var_resp.text().await?; + + if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + serde_json::from_str(&local_var_content).map_err(Error::from) + } else { + let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); + let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; + Err(Error::ResponseError(local_var_error)) + } +} + +pub async fn repo_list_statuses(configuration: &configuration::Configuration, owner: &str, repo: &str, sha: &str, sort: Option<&str>, state: Option<&str>, page: Option, limit: Option) -> Result, Error> { + let local_var_configuration = configuration; + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!("{}/repos/{owner}/{repo}/statuses/{sha}", local_var_configuration.base_path, owner=crate::apis::urlencode(owner), repo=crate::apis::urlencode(repo), sha=crate::apis::urlencode(sha)); + let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str()); + + if let Some(ref local_var_str) = sort { + local_var_req_builder = local_var_req_builder.query(&[("sort", &local_var_str.to_string())]); + } + if let Some(ref local_var_str) = state { + local_var_req_builder = local_var_req_builder.query(&[("state", &local_var_str.to_string())]); + } + if let Some(ref local_var_str) = page { + local_var_req_builder = local_var_req_builder.query(&[("page", &local_var_str.to_string())]); + } + if let Some(ref local_var_str) = limit { + local_var_req_builder = local_var_req_builder.query(&[("limit", &local_var_str.to_string())]); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.query(&[("access_token", local_var_value)]); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.query(&[("sudo", local_var_value)]); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.query(&[("token", local_var_value)]); + } + if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { + local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("Authorization", local_var_value); + }; + if let Some(ref local_var_auth_conf) = local_var_configuration.basic_auth { + local_var_req_builder = local_var_req_builder.basic_auth(local_var_auth_conf.0.to_owned(), local_var_auth_conf.1.to_owned()); + }; + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("Sudo", local_var_value); + }; + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("X-GITEA-OTP", local_var_value); + }; + + let local_var_req = local_var_req_builder.build()?; + let local_var_resp = local_var_client.execute(local_var_req).await?; + + let local_var_status = local_var_resp.status(); + let local_var_content = local_var_resp.text().await?; + + if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + serde_json::from_str(&local_var_content).map_err(Error::from) + } else { + let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); + let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; + Err(Error::ResponseError(local_var_error)) + } +} + +pub async fn repo_list_statuses_by_ref(configuration: &configuration::Configuration, owner: &str, repo: &str, r#ref: &str, sort: Option<&str>, state: Option<&str>, page: Option, limit: Option) -> Result, Error> { + let local_var_configuration = configuration; + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!("{}/repos/{owner}/{repo}/commits/{ref}/statuses", local_var_configuration.base_path, owner=crate::apis::urlencode(owner), repo=crate::apis::urlencode(repo), ref=crate::apis::urlencode(r#ref)); + let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str()); + + if let Some(ref local_var_str) = sort { + local_var_req_builder = local_var_req_builder.query(&[("sort", &local_var_str.to_string())]); + } + if let Some(ref local_var_str) = state { + local_var_req_builder = local_var_req_builder.query(&[("state", &local_var_str.to_string())]); + } + if let Some(ref local_var_str) = page { + local_var_req_builder = local_var_req_builder.query(&[("page", &local_var_str.to_string())]); + } + if let Some(ref local_var_str) = limit { + local_var_req_builder = local_var_req_builder.query(&[("limit", &local_var_str.to_string())]); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.query(&[("access_token", local_var_value)]); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.query(&[("sudo", local_var_value)]); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.query(&[("token", local_var_value)]); + } + if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { + local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("Authorization", local_var_value); + }; + if let Some(ref local_var_auth_conf) = local_var_configuration.basic_auth { + local_var_req_builder = local_var_req_builder.basic_auth(local_var_auth_conf.0.to_owned(), local_var_auth_conf.1.to_owned()); + }; + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("Sudo", local_var_value); + }; + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("X-GITEA-OTP", local_var_value); + }; + + let local_var_req = local_var_req_builder.build()?; + let local_var_resp = local_var_client.execute(local_var_req).await?; + + let local_var_status = local_var_resp.status(); + let local_var_content = local_var_resp.text().await?; + + if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + serde_json::from_str(&local_var_content).map_err(Error::from) + } else { + let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); + let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; + Err(Error::ResponseError(local_var_error)) + } +} + +pub async fn repo_list_subscribers(configuration: &configuration::Configuration, owner: &str, repo: &str, page: Option, limit: Option) -> Result, Error> { + let local_var_configuration = configuration; + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!("{}/repos/{owner}/{repo}/subscribers", local_var_configuration.base_path, owner=crate::apis::urlencode(owner), repo=crate::apis::urlencode(repo)); + let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str()); + + if let Some(ref local_var_str) = page { + local_var_req_builder = local_var_req_builder.query(&[("page", &local_var_str.to_string())]); + } + if let Some(ref local_var_str) = limit { + local_var_req_builder = local_var_req_builder.query(&[("limit", &local_var_str.to_string())]); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.query(&[("access_token", local_var_value)]); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.query(&[("sudo", local_var_value)]); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.query(&[("token", local_var_value)]); + } + if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { + local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("Authorization", local_var_value); + }; + if let Some(ref local_var_auth_conf) = local_var_configuration.basic_auth { + local_var_req_builder = local_var_req_builder.basic_auth(local_var_auth_conf.0.to_owned(), local_var_auth_conf.1.to_owned()); + }; + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("Sudo", local_var_value); + }; + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("X-GITEA-OTP", local_var_value); + }; + + let local_var_req = local_var_req_builder.build()?; + let local_var_resp = local_var_client.execute(local_var_req).await?; + + let local_var_status = local_var_resp.status(); + let local_var_content = local_var_resp.text().await?; + + if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + serde_json::from_str(&local_var_content).map_err(Error::from) + } else { + let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); + let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; + Err(Error::ResponseError(local_var_error)) + } +} + +pub async fn repo_list_tags(configuration: &configuration::Configuration, owner: &str, repo: &str, page: Option, limit: Option) -> Result, Error> { + let local_var_configuration = configuration; + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!("{}/repos/{owner}/{repo}/tags", local_var_configuration.base_path, owner=crate::apis::urlencode(owner), repo=crate::apis::urlencode(repo)); + let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str()); + + if let Some(ref local_var_str) = page { + local_var_req_builder = local_var_req_builder.query(&[("page", &local_var_str.to_string())]); + } + if let Some(ref local_var_str) = limit { + local_var_req_builder = local_var_req_builder.query(&[("limit", &local_var_str.to_string())]); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.query(&[("access_token", local_var_value)]); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.query(&[("sudo", local_var_value)]); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.query(&[("token", local_var_value)]); + } + if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { + local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("Authorization", local_var_value); + }; + if let Some(ref local_var_auth_conf) = local_var_configuration.basic_auth { + local_var_req_builder = local_var_req_builder.basic_auth(local_var_auth_conf.0.to_owned(), local_var_auth_conf.1.to_owned()); + }; + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("Sudo", local_var_value); + }; + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("X-GITEA-OTP", local_var_value); + }; + + let local_var_req = local_var_req_builder.build()?; + let local_var_resp = local_var_client.execute(local_var_req).await?; + + let local_var_status = local_var_resp.status(); + let local_var_content = local_var_resp.text().await?; + + if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + serde_json::from_str(&local_var_content).map_err(Error::from) + } else { + let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); + let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; + Err(Error::ResponseError(local_var_error)) + } +} + +pub async fn repo_list_teams(configuration: &configuration::Configuration, owner: &str, repo: &str) -> Result, Error> { + let local_var_configuration = configuration; + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!("{}/repos/{owner}/{repo}/teams", local_var_configuration.base_path, owner=crate::apis::urlencode(owner), repo=crate::apis::urlencode(repo)); + let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str()); + + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.query(&[("access_token", local_var_value)]); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.query(&[("sudo", local_var_value)]); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.query(&[("token", local_var_value)]); + } + if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { + local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("Authorization", local_var_value); + }; + if let Some(ref local_var_auth_conf) = local_var_configuration.basic_auth { + local_var_req_builder = local_var_req_builder.basic_auth(local_var_auth_conf.0.to_owned(), local_var_auth_conf.1.to_owned()); + }; + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("Sudo", local_var_value); + }; + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("X-GITEA-OTP", local_var_value); + }; + + let local_var_req = local_var_req_builder.build()?; + let local_var_resp = local_var_client.execute(local_var_req).await?; + + let local_var_status = local_var_resp.status(); + let local_var_content = local_var_resp.text().await?; + + if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + serde_json::from_str(&local_var_content).map_err(Error::from) + } else { + let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); + let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; + Err(Error::ResponseError(local_var_error)) + } +} + +pub async fn repo_list_topics(configuration: &configuration::Configuration, owner: &str, repo: &str, page: Option, limit: Option) -> Result> { + let local_var_configuration = configuration; + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!("{}/repos/{owner}/{repo}/topics", local_var_configuration.base_path, owner=crate::apis::urlencode(owner), repo=crate::apis::urlencode(repo)); + let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str()); + + if let Some(ref local_var_str) = page { + local_var_req_builder = local_var_req_builder.query(&[("page", &local_var_str.to_string())]); + } + if let Some(ref local_var_str) = limit { + local_var_req_builder = local_var_req_builder.query(&[("limit", &local_var_str.to_string())]); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.query(&[("access_token", local_var_value)]); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.query(&[("sudo", local_var_value)]); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.query(&[("token", local_var_value)]); + } + if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { + local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("Authorization", local_var_value); + }; + if let Some(ref local_var_auth_conf) = local_var_configuration.basic_auth { + local_var_req_builder = local_var_req_builder.basic_auth(local_var_auth_conf.0.to_owned(), local_var_auth_conf.1.to_owned()); + }; + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("Sudo", local_var_value); + }; + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("X-GITEA-OTP", local_var_value); + }; + + let local_var_req = local_var_req_builder.build()?; + let local_var_resp = local_var_client.execute(local_var_req).await?; + + let local_var_status = local_var_resp.status(); + let local_var_content = local_var_resp.text().await?; + + if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + serde_json::from_str(&local_var_content).map_err(Error::from) + } else { + let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); + let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; + Err(Error::ResponseError(local_var_error)) + } +} + +pub async fn repo_merge_pull_request(configuration: &configuration::Configuration, owner: &str, repo: &str, index: i64, body: Option) -> Result<(), Error> { + let local_var_configuration = configuration; + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!("{}/repos/{owner}/{repo}/pulls/{index}/merge", local_var_configuration.base_path, owner=crate::apis::urlencode(owner), repo=crate::apis::urlencode(repo), index=index); + let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str()); + + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.query(&[("access_token", local_var_value)]); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.query(&[("sudo", local_var_value)]); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.query(&[("token", local_var_value)]); + } + if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { + local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("Authorization", local_var_value); + }; + if let Some(ref local_var_auth_conf) = local_var_configuration.basic_auth { + local_var_req_builder = local_var_req_builder.basic_auth(local_var_auth_conf.0.to_owned(), local_var_auth_conf.1.to_owned()); + }; + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("Sudo", local_var_value); + }; + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("X-GITEA-OTP", local_var_value); + }; + local_var_req_builder = local_var_req_builder.json(&body); + + let local_var_req = local_var_req_builder.build()?; + let local_var_resp = local_var_client.execute(local_var_req).await?; + + let local_var_status = local_var_resp.status(); + let local_var_content = local_var_resp.text().await?; + + if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + Ok(()) + } else { + let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); + let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; + Err(Error::ResponseError(local_var_error)) + } +} + +pub async fn repo_migrate(configuration: &configuration::Configuration, body: Option) -> Result> { + let local_var_configuration = configuration; + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!("{}/repos/migrate", local_var_configuration.base_path); + let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str()); + + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.query(&[("access_token", local_var_value)]); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.query(&[("sudo", local_var_value)]); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.query(&[("token", local_var_value)]); + } + if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { + local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("Authorization", local_var_value); + }; + if let Some(ref local_var_auth_conf) = local_var_configuration.basic_auth { + local_var_req_builder = local_var_req_builder.basic_auth(local_var_auth_conf.0.to_owned(), local_var_auth_conf.1.to_owned()); + }; + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("Sudo", local_var_value); + }; + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("X-GITEA-OTP", local_var_value); + }; + local_var_req_builder = local_var_req_builder.json(&body); + + let local_var_req = local_var_req_builder.build()?; + let local_var_resp = local_var_client.execute(local_var_req).await?; + + let local_var_status = local_var_resp.status(); + let local_var_content = local_var_resp.text().await?; + + if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + serde_json::from_str(&local_var_content).map_err(Error::from) + } else { + let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); + let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; + Err(Error::ResponseError(local_var_error)) + } +} + +pub async fn repo_mirror_sync(configuration: &configuration::Configuration, owner: &str, repo: &str) -> Result<(), Error> { + let local_var_configuration = configuration; + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!("{}/repos/{owner}/{repo}/mirror-sync", local_var_configuration.base_path, owner=crate::apis::urlencode(owner), repo=crate::apis::urlencode(repo)); + let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str()); + + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.query(&[("access_token", local_var_value)]); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.query(&[("sudo", local_var_value)]); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.query(&[("token", local_var_value)]); + } + if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { + local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("Authorization", local_var_value); + }; + if let Some(ref local_var_auth_conf) = local_var_configuration.basic_auth { + local_var_req_builder = local_var_req_builder.basic_auth(local_var_auth_conf.0.to_owned(), local_var_auth_conf.1.to_owned()); + }; + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("Sudo", local_var_value); + }; + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("X-GITEA-OTP", local_var_value); + }; + + let local_var_req = local_var_req_builder.build()?; + let local_var_resp = local_var_client.execute(local_var_req).await?; + + let local_var_status = local_var_resp.status(); + let local_var_content = local_var_resp.text().await?; + + if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + Ok(()) + } else { + let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); + let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; + Err(Error::ResponseError(local_var_error)) + } +} + +pub async fn repo_pull_request_is_merged(configuration: &configuration::Configuration, owner: &str, repo: &str, index: i64) -> Result<(), Error> { + let local_var_configuration = configuration; + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!("{}/repos/{owner}/{repo}/pulls/{index}/merge", local_var_configuration.base_path, owner=crate::apis::urlencode(owner), repo=crate::apis::urlencode(repo), index=index); + let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str()); + + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.query(&[("access_token", local_var_value)]); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.query(&[("sudo", local_var_value)]); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.query(&[("token", local_var_value)]); + } + if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { + local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("Authorization", local_var_value); + }; + if let Some(ref local_var_auth_conf) = local_var_configuration.basic_auth { + local_var_req_builder = local_var_req_builder.basic_auth(local_var_auth_conf.0.to_owned(), local_var_auth_conf.1.to_owned()); + }; + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("Sudo", local_var_value); + }; + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("X-GITEA-OTP", local_var_value); + }; + + let local_var_req = local_var_req_builder.build()?; + let local_var_resp = local_var_client.execute(local_var_req).await?; + + let local_var_status = local_var_resp.status(); + let local_var_content = local_var_resp.text().await?; + + if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + Ok(()) + } else { + let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); + let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; + Err(Error::ResponseError(local_var_error)) + } +} + +pub async fn repo_search(configuration: &configuration::Configuration, q: Option<&str>, topic: Option, include_desc: Option, uid: Option, priority_owner_id: Option, team_id: Option, starred_by: Option, private: Option, is_private: Option, template: Option, archived: Option, mode: Option<&str>, exclusive: Option, sort: Option<&str>, order: Option<&str>, page: Option, limit: Option) -> Result> { + let local_var_configuration = configuration; + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!("{}/repos/search", local_var_configuration.base_path); + let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str()); + + if let Some(ref local_var_str) = q { + local_var_req_builder = local_var_req_builder.query(&[("q", &local_var_str.to_string())]); + } + if let Some(ref local_var_str) = topic { + local_var_req_builder = local_var_req_builder.query(&[("topic", &local_var_str.to_string())]); + } + if let Some(ref local_var_str) = include_desc { + local_var_req_builder = local_var_req_builder.query(&[("includeDesc", &local_var_str.to_string())]); + } + if let Some(ref local_var_str) = uid { + local_var_req_builder = local_var_req_builder.query(&[("uid", &local_var_str.to_string())]); + } + if let Some(ref local_var_str) = priority_owner_id { + local_var_req_builder = local_var_req_builder.query(&[("priority_owner_id", &local_var_str.to_string())]); + } + if let Some(ref local_var_str) = team_id { + local_var_req_builder = local_var_req_builder.query(&[("team_id", &local_var_str.to_string())]); + } + if let Some(ref local_var_str) = starred_by { + local_var_req_builder = local_var_req_builder.query(&[("starredBy", &local_var_str.to_string())]); + } + if let Some(ref local_var_str) = private { + local_var_req_builder = local_var_req_builder.query(&[("private", &local_var_str.to_string())]); + } + if let Some(ref local_var_str) = is_private { + local_var_req_builder = local_var_req_builder.query(&[("is_private", &local_var_str.to_string())]); + } + if let Some(ref local_var_str) = template { + local_var_req_builder = local_var_req_builder.query(&[("template", &local_var_str.to_string())]); + } + if let Some(ref local_var_str) = archived { + local_var_req_builder = local_var_req_builder.query(&[("archived", &local_var_str.to_string())]); + } + if let Some(ref local_var_str) = mode { + local_var_req_builder = local_var_req_builder.query(&[("mode", &local_var_str.to_string())]); + } + if let Some(ref local_var_str) = exclusive { + local_var_req_builder = local_var_req_builder.query(&[("exclusive", &local_var_str.to_string())]); + } + if let Some(ref local_var_str) = sort { + local_var_req_builder = local_var_req_builder.query(&[("sort", &local_var_str.to_string())]); + } + if let Some(ref local_var_str) = order { + local_var_req_builder = local_var_req_builder.query(&[("order", &local_var_str.to_string())]); + } + if let Some(ref local_var_str) = page { + local_var_req_builder = local_var_req_builder.query(&[("page", &local_var_str.to_string())]); + } + if let Some(ref local_var_str) = limit { + local_var_req_builder = local_var_req_builder.query(&[("limit", &local_var_str.to_string())]); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.query(&[("access_token", local_var_value)]); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.query(&[("sudo", local_var_value)]); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.query(&[("token", local_var_value)]); + } + if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { + local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("Authorization", local_var_value); + }; + if let Some(ref local_var_auth_conf) = local_var_configuration.basic_auth { + local_var_req_builder = local_var_req_builder.basic_auth(local_var_auth_conf.0.to_owned(), local_var_auth_conf.1.to_owned()); + }; + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("Sudo", local_var_value); + }; + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("X-GITEA-OTP", local_var_value); + }; + + let local_var_req = local_var_req_builder.build()?; + let local_var_resp = local_var_client.execute(local_var_req).await?; + + let local_var_status = local_var_resp.status(); + let local_var_content = local_var_resp.text().await?; + + if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + serde_json::from_str(&local_var_content).map_err(Error::from) + } else { + let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); + let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; + Err(Error::ResponseError(local_var_error)) + } +} + +pub async fn repo_signing_key(configuration: &configuration::Configuration, owner: &str, repo: &str) -> Result> { + let local_var_configuration = configuration; + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!("{}/repos/{owner}/{repo}/signing-key.gpg", local_var_configuration.base_path, owner=crate::apis::urlencode(owner), repo=crate::apis::urlencode(repo)); + let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str()); + + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.query(&[("access_token", local_var_value)]); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.query(&[("sudo", local_var_value)]); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.query(&[("token", local_var_value)]); + } + if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { + local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("Authorization", local_var_value); + }; + if let Some(ref local_var_auth_conf) = local_var_configuration.basic_auth { + local_var_req_builder = local_var_req_builder.basic_auth(local_var_auth_conf.0.to_owned(), local_var_auth_conf.1.to_owned()); + }; + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("Sudo", local_var_value); + }; + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("X-GITEA-OTP", local_var_value); + }; + + let local_var_req = local_var_req_builder.build()?; + let local_var_resp = local_var_client.execute(local_var_req).await?; + + let local_var_status = local_var_resp.status(); + let local_var_content = local_var_resp.text().await?; + + if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + serde_json::from_str(&local_var_content).map_err(Error::from) + } else { + let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); + let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; + Err(Error::ResponseError(local_var_error)) + } +} + +pub async fn repo_submit_pull_review(configuration: &configuration::Configuration, owner: &str, repo: &str, index: i64, id: i64, body: crate::models::SubmitPullReviewOptions) -> Result> { + let local_var_configuration = configuration; + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!("{}/repos/{owner}/{repo}/pulls/{index}/reviews/{id}", local_var_configuration.base_path, owner=crate::apis::urlencode(owner), repo=crate::apis::urlencode(repo), index=index, id=id); + let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str()); + + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.query(&[("access_token", local_var_value)]); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.query(&[("sudo", local_var_value)]); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.query(&[("token", local_var_value)]); + } + if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { + local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("Authorization", local_var_value); + }; + if let Some(ref local_var_auth_conf) = local_var_configuration.basic_auth { + local_var_req_builder = local_var_req_builder.basic_auth(local_var_auth_conf.0.to_owned(), local_var_auth_conf.1.to_owned()); + }; + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("Sudo", local_var_value); + }; + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("X-GITEA-OTP", local_var_value); + }; + local_var_req_builder = local_var_req_builder.json(&body); + + let local_var_req = local_var_req_builder.build()?; + let local_var_resp = local_var_client.execute(local_var_req).await?; + + let local_var_status = local_var_resp.status(); + let local_var_content = local_var_resp.text().await?; + + if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + serde_json::from_str(&local_var_content).map_err(Error::from) + } else { + let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); + let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; + Err(Error::ResponseError(local_var_error)) + } +} + +pub async fn repo_test_hook(configuration: &configuration::Configuration, owner: &str, repo: &str, id: i64, r#ref: Option<&str>) -> Result<(), Error> { + let local_var_configuration = configuration; + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!("{}/repos/{owner}/{repo}/hooks/{id}/tests", local_var_configuration.base_path, owner=crate::apis::urlencode(owner), repo=crate::apis::urlencode(repo), id=id); + let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str()); + + if let Some(ref local_var_str) = r#ref { + local_var_req_builder = local_var_req_builder.query(&[("ref", &local_var_str.to_string())]); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.query(&[("access_token", local_var_value)]); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.query(&[("sudo", local_var_value)]); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.query(&[("token", local_var_value)]); + } + if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { + local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("Authorization", local_var_value); + }; + if let Some(ref local_var_auth_conf) = local_var_configuration.basic_auth { + local_var_req_builder = local_var_req_builder.basic_auth(local_var_auth_conf.0.to_owned(), local_var_auth_conf.1.to_owned()); + }; + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("Sudo", local_var_value); + }; + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("X-GITEA-OTP", local_var_value); + }; + + let local_var_req = local_var_req_builder.build()?; + let local_var_resp = local_var_client.execute(local_var_req).await?; + + let local_var_status = local_var_resp.status(); + let local_var_content = local_var_resp.text().await?; + + if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + Ok(()) + } else { + let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); + let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; + Err(Error::ResponseError(local_var_error)) + } +} + +pub async fn repo_tracked_times(configuration: &configuration::Configuration, owner: &str, repo: &str, user: Option<&str>, since: Option, before: Option, page: Option, limit: Option) -> Result, Error> { + let local_var_configuration = configuration; + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!("{}/repos/{owner}/{repo}/times", local_var_configuration.base_path, owner=crate::apis::urlencode(owner), repo=crate::apis::urlencode(repo)); + let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str()); + + if let Some(ref local_var_str) = user { + local_var_req_builder = local_var_req_builder.query(&[("user", &local_var_str.to_string())]); + } + if let Some(ref local_var_str) = since { + local_var_req_builder = local_var_req_builder.query(&[("since", &local_var_str.to_string())]); + } + if let Some(ref local_var_str) = before { + local_var_req_builder = local_var_req_builder.query(&[("before", &local_var_str.to_string())]); + } + if let Some(ref local_var_str) = page { + local_var_req_builder = local_var_req_builder.query(&[("page", &local_var_str.to_string())]); + } + if let Some(ref local_var_str) = limit { + local_var_req_builder = local_var_req_builder.query(&[("limit", &local_var_str.to_string())]); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.query(&[("access_token", local_var_value)]); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.query(&[("sudo", local_var_value)]); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.query(&[("token", local_var_value)]); + } + if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { + local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("Authorization", local_var_value); + }; + if let Some(ref local_var_auth_conf) = local_var_configuration.basic_auth { + local_var_req_builder = local_var_req_builder.basic_auth(local_var_auth_conf.0.to_owned(), local_var_auth_conf.1.to_owned()); + }; + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("Sudo", local_var_value); + }; + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("X-GITEA-OTP", local_var_value); + }; + + let local_var_req = local_var_req_builder.build()?; + let local_var_resp = local_var_client.execute(local_var_req).await?; + + let local_var_status = local_var_resp.status(); + let local_var_content = local_var_resp.text().await?; + + if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + serde_json::from_str(&local_var_content).map_err(Error::from) + } else { + let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); + let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; + Err(Error::ResponseError(local_var_error)) + } +} + +pub async fn repo_transfer(configuration: &configuration::Configuration, owner: &str, repo: &str, body: crate::models::TransferRepoOption) -> Result> { + let local_var_configuration = configuration; + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!("{}/repos/{owner}/{repo}/transfer", local_var_configuration.base_path, owner=crate::apis::urlencode(owner), repo=crate::apis::urlencode(repo)); + let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str()); + + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.query(&[("access_token", local_var_value)]); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.query(&[("sudo", local_var_value)]); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.query(&[("token", local_var_value)]); + } + if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { + local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("Authorization", local_var_value); + }; + if let Some(ref local_var_auth_conf) = local_var_configuration.basic_auth { + local_var_req_builder = local_var_req_builder.basic_auth(local_var_auth_conf.0.to_owned(), local_var_auth_conf.1.to_owned()); + }; + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("Sudo", local_var_value); + }; + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("X-GITEA-OTP", local_var_value); + }; + local_var_req_builder = local_var_req_builder.json(&body); + + let local_var_req = local_var_req_builder.build()?; + let local_var_resp = local_var_client.execute(local_var_req).await?; + + let local_var_status = local_var_resp.status(); + let local_var_content = local_var_resp.text().await?; + + if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + serde_json::from_str(&local_var_content).map_err(Error::from) + } else { + let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); + let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; + Err(Error::ResponseError(local_var_error)) + } +} + +pub async fn repo_un_dismiss_pull_review(configuration: &configuration::Configuration, owner: &str, repo: &str, index: i64, id: i64) -> Result> { + let local_var_configuration = configuration; + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!("{}/repos/{owner}/{repo}/pulls/{index}/reviews/{id}/undismissals", local_var_configuration.base_path, owner=crate::apis::urlencode(owner), repo=crate::apis::urlencode(repo), index=index, id=id); + let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str()); + + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.query(&[("access_token", local_var_value)]); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.query(&[("sudo", local_var_value)]); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.query(&[("token", local_var_value)]); + } + if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { + local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("Authorization", local_var_value); + }; + if let Some(ref local_var_auth_conf) = local_var_configuration.basic_auth { + local_var_req_builder = local_var_req_builder.basic_auth(local_var_auth_conf.0.to_owned(), local_var_auth_conf.1.to_owned()); + }; + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("Sudo", local_var_value); + }; + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("X-GITEA-OTP", local_var_value); + }; + + let local_var_req = local_var_req_builder.build()?; + let local_var_resp = local_var_client.execute(local_var_req).await?; + + let local_var_status = local_var_resp.status(); + let local_var_content = local_var_resp.text().await?; + + if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + serde_json::from_str(&local_var_content).map_err(Error::from) + } else { + let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); + let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; + Err(Error::ResponseError(local_var_error)) + } +} + +pub async fn repo_update_file(configuration: &configuration::Configuration, owner: &str, repo: &str, filepath: &str, body: crate::models::UpdateFileOptions) -> Result> { + let local_var_configuration = configuration; + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!("{}/repos/{owner}/{repo}/contents/{filepath}", local_var_configuration.base_path, owner=crate::apis::urlencode(owner), repo=crate::apis::urlencode(repo), filepath=crate::apis::urlencode(filepath)); + let mut local_var_req_builder = local_var_client.request(reqwest::Method::PUT, local_var_uri_str.as_str()); + + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.query(&[("access_token", local_var_value)]); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.query(&[("sudo", local_var_value)]); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.query(&[("token", local_var_value)]); + } + if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { + local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("Authorization", local_var_value); + }; + if let Some(ref local_var_auth_conf) = local_var_configuration.basic_auth { + local_var_req_builder = local_var_req_builder.basic_auth(local_var_auth_conf.0.to_owned(), local_var_auth_conf.1.to_owned()); + }; + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("Sudo", local_var_value); + }; + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("X-GITEA-OTP", local_var_value); + }; + local_var_req_builder = local_var_req_builder.json(&body); + + let local_var_req = local_var_req_builder.build()?; + let local_var_resp = local_var_client.execute(local_var_req).await?; + + let local_var_status = local_var_resp.status(); + let local_var_content = local_var_resp.text().await?; + + if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + serde_json::from_str(&local_var_content).map_err(Error::from) + } else { + let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); + let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; + Err(Error::ResponseError(local_var_error)) + } +} + +pub async fn repo_update_pull_request(configuration: &configuration::Configuration, owner: &str, repo: &str, index: i64, style: Option<&str>) -> Result<(), Error> { + let local_var_configuration = configuration; + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!("{}/repos/{owner}/{repo}/pulls/{index}/update", local_var_configuration.base_path, owner=crate::apis::urlencode(owner), repo=crate::apis::urlencode(repo), index=index); + let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str()); + + if let Some(ref local_var_str) = style { + local_var_req_builder = local_var_req_builder.query(&[("style", &local_var_str.to_string())]); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.query(&[("access_token", local_var_value)]); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.query(&[("sudo", local_var_value)]); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.query(&[("token", local_var_value)]); + } + if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { + local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("Authorization", local_var_value); + }; + if let Some(ref local_var_auth_conf) = local_var_configuration.basic_auth { + local_var_req_builder = local_var_req_builder.basic_auth(local_var_auth_conf.0.to_owned(), local_var_auth_conf.1.to_owned()); + }; + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("Sudo", local_var_value); + }; + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("X-GITEA-OTP", local_var_value); + }; + + let local_var_req = local_var_req_builder.build()?; + let local_var_resp = local_var_client.execute(local_var_req).await?; + + let local_var_status = local_var_resp.status(); + let local_var_content = local_var_resp.text().await?; + + if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + Ok(()) + } else { + let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); + let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; + Err(Error::ResponseError(local_var_error)) + } +} + +pub async fn repo_update_topics(configuration: &configuration::Configuration, owner: &str, repo: &str, body: Option) -> Result<(), Error> { + let local_var_configuration = configuration; + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!("{}/repos/{owner}/{repo}/topics", local_var_configuration.base_path, owner=crate::apis::urlencode(owner), repo=crate::apis::urlencode(repo)); + let mut local_var_req_builder = local_var_client.request(reqwest::Method::PUT, local_var_uri_str.as_str()); + + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.query(&[("access_token", local_var_value)]); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.query(&[("sudo", local_var_value)]); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.query(&[("token", local_var_value)]); + } + if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { + local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("Authorization", local_var_value); + }; + if let Some(ref local_var_auth_conf) = local_var_configuration.basic_auth { + local_var_req_builder = local_var_req_builder.basic_auth(local_var_auth_conf.0.to_owned(), local_var_auth_conf.1.to_owned()); + }; + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("Sudo", local_var_value); + }; + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("X-GITEA-OTP", local_var_value); + }; + local_var_req_builder = local_var_req_builder.json(&body); + + let local_var_req = local_var_req_builder.build()?; + let local_var_resp = local_var_client.execute(local_var_req).await?; + + let local_var_status = local_var_resp.status(); + let local_var_content = local_var_resp.text().await?; + + if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + Ok(()) + } else { + let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); + let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; + Err(Error::ResponseError(local_var_error)) + } +} + +pub async fn topic_search(configuration: &configuration::Configuration, q: &str, page: Option, limit: Option) -> Result, Error> { + let local_var_configuration = configuration; + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!("{}/topics/search", local_var_configuration.base_path); + let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str()); + + local_var_req_builder = local_var_req_builder.query(&[("q", &q.to_string())]); + if let Some(ref local_var_str) = page { + local_var_req_builder = local_var_req_builder.query(&[("page", &local_var_str.to_string())]); + } + if let Some(ref local_var_str) = limit { + local_var_req_builder = local_var_req_builder.query(&[("limit", &local_var_str.to_string())]); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.query(&[("access_token", local_var_value)]); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.query(&[("sudo", local_var_value)]); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.query(&[("token", local_var_value)]); + } + if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { + local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("Authorization", local_var_value); + }; + if let Some(ref local_var_auth_conf) = local_var_configuration.basic_auth { + local_var_req_builder = local_var_req_builder.basic_auth(local_var_auth_conf.0.to_owned(), local_var_auth_conf.1.to_owned()); + }; + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("Sudo", local_var_value); + }; + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("X-GITEA-OTP", local_var_value); + }; + + let local_var_req = local_var_req_builder.build()?; + let local_var_resp = local_var_client.execute(local_var_req).await?; + + let local_var_status = local_var_resp.status(); + let local_var_content = local_var_resp.text().await?; + + if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + serde_json::from_str(&local_var_content).map_err(Error::from) + } else { + let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); + let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; + Err(Error::ResponseError(local_var_error)) + } +} + +pub async fn user_current_check_subscription(configuration: &configuration::Configuration, owner: &str, repo: &str) -> Result> { + let local_var_configuration = configuration; + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!("{}/repos/{owner}/{repo}/subscription", local_var_configuration.base_path, owner=crate::apis::urlencode(owner), repo=crate::apis::urlencode(repo)); + let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str()); + + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.query(&[("access_token", local_var_value)]); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.query(&[("sudo", local_var_value)]); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.query(&[("token", local_var_value)]); + } + if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { + local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("Authorization", local_var_value); + }; + if let Some(ref local_var_auth_conf) = local_var_configuration.basic_auth { + local_var_req_builder = local_var_req_builder.basic_auth(local_var_auth_conf.0.to_owned(), local_var_auth_conf.1.to_owned()); + }; + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("Sudo", local_var_value); + }; + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("X-GITEA-OTP", local_var_value); + }; + + let local_var_req = local_var_req_builder.build()?; + let local_var_resp = local_var_client.execute(local_var_req).await?; + + let local_var_status = local_var_resp.status(); + let local_var_content = local_var_resp.text().await?; + + if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + serde_json::from_str(&local_var_content).map_err(Error::from) + } else { + let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); + let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; + Err(Error::ResponseError(local_var_error)) + } +} + +pub async fn user_current_delete_subscription(configuration: &configuration::Configuration, owner: &str, repo: &str) -> Result<(), Error> { + let local_var_configuration = configuration; + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!("{}/repos/{owner}/{repo}/subscription", local_var_configuration.base_path, owner=crate::apis::urlencode(owner), repo=crate::apis::urlencode(repo)); + let mut local_var_req_builder = local_var_client.request(reqwest::Method::DELETE, local_var_uri_str.as_str()); + + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.query(&[("access_token", local_var_value)]); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.query(&[("sudo", local_var_value)]); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.query(&[("token", local_var_value)]); + } + if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { + local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("Authorization", local_var_value); + }; + if let Some(ref local_var_auth_conf) = local_var_configuration.basic_auth { + local_var_req_builder = local_var_req_builder.basic_auth(local_var_auth_conf.0.to_owned(), local_var_auth_conf.1.to_owned()); + }; + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("Sudo", local_var_value); + }; + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("X-GITEA-OTP", local_var_value); + }; + + let local_var_req = local_var_req_builder.build()?; + let local_var_resp = local_var_client.execute(local_var_req).await?; + + let local_var_status = local_var_resp.status(); + let local_var_content = local_var_resp.text().await?; + + if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + Ok(()) + } else { + let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); + let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; + Err(Error::ResponseError(local_var_error)) + } +} + +pub async fn user_current_put_subscription(configuration: &configuration::Configuration, owner: &str, repo: &str) -> Result> { + let local_var_configuration = configuration; + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!("{}/repos/{owner}/{repo}/subscription", local_var_configuration.base_path, owner=crate::apis::urlencode(owner), repo=crate::apis::urlencode(repo)); + let mut local_var_req_builder = local_var_client.request(reqwest::Method::PUT, local_var_uri_str.as_str()); + + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.query(&[("access_token", local_var_value)]); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.query(&[("sudo", local_var_value)]); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.query(&[("token", local_var_value)]); + } + if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { + local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("Authorization", local_var_value); + }; + if let Some(ref local_var_auth_conf) = local_var_configuration.basic_auth { + local_var_req_builder = local_var_req_builder.basic_auth(local_var_auth_conf.0.to_owned(), local_var_auth_conf.1.to_owned()); + }; + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("Sudo", local_var_value); + }; + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("X-GITEA-OTP", local_var_value); + }; + + let local_var_req = local_var_req_builder.build()?; + let local_var_resp = local_var_client.execute(local_var_req).await?; + + let local_var_status = local_var_resp.status(); + let local_var_content = local_var_resp.text().await?; + + if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + serde_json::from_str(&local_var_content).map_err(Error::from) + } else { + let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); + let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; + Err(Error::ResponseError(local_var_error)) + } +} + +pub async fn user_tracked_times(configuration: &configuration::Configuration, owner: &str, repo: &str, user: &str) -> Result, Error> { + let local_var_configuration = configuration; + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!("{}/repos/{owner}/{repo}/times/{user}", local_var_configuration.base_path, owner=crate::apis::urlencode(owner), repo=crate::apis::urlencode(repo), user=crate::apis::urlencode(user)); + let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str()); + + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.query(&[("access_token", local_var_value)]); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.query(&[("sudo", local_var_value)]); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.query(&[("token", local_var_value)]); + } + if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { + local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("Authorization", local_var_value); + }; + if let Some(ref local_var_auth_conf) = local_var_configuration.basic_auth { + local_var_req_builder = local_var_req_builder.basic_auth(local_var_auth_conf.0.to_owned(), local_var_auth_conf.1.to_owned()); + }; + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("Sudo", local_var_value); + }; + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("X-GITEA-OTP", local_var_value); + }; + + let local_var_req = local_var_req_builder.build()?; + let local_var_resp = local_var_client.execute(local_var_req).await?; + + let local_var_status = local_var_resp.status(); + let local_var_content = local_var_resp.text().await?; + + if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + serde_json::from_str(&local_var_content).map_err(Error::from) + } else { + let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); + let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; + Err(Error::ResponseError(local_var_error)) + } +} + diff --git a/crates/gitea_raw_client/src/apis/settings_api.rs b/crates/gitea_raw_client/src/apis/settings_api.rs new file mode 100644 index 0000000..87eae2d --- /dev/null +++ b/crates/gitea_raw_client/src/apis/settings_api.rs @@ -0,0 +1,358 @@ +/* + * Gitea API. + * + * This documentation describes the Gitea API. + * + * The version of the OpenAPI document: 1.17.3 + * + * Generated by: https://openapi-generator.tech + */ + + +use reqwest; + +use crate::apis::ResponseContent; +use super::{Error, configuration}; + + +/// struct for typed errors of method [`get_general_api_settings`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum GetGeneralApiSettingsError { + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`get_general_attachment_settings`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum GetGeneralAttachmentSettingsError { + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`get_general_repository_settings`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum GetGeneralRepositorySettingsError { + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`get_general_ui_settings`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum GetGeneralUiSettingsError { + UnknownValue(serde_json::Value), +} + + +pub async fn get_general_api_settings(configuration: &configuration::Configuration, ) -> Result> { + let local_var_configuration = configuration; + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!("{}/settings/api", local_var_configuration.base_path); + let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str()); + + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.query(&[("access_token", local_var_value)]); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.query(&[("sudo", local_var_value)]); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.query(&[("token", local_var_value)]); + } + if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { + local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("Authorization", local_var_value); + }; + if let Some(ref local_var_auth_conf) = local_var_configuration.basic_auth { + local_var_req_builder = local_var_req_builder.basic_auth(local_var_auth_conf.0.to_owned(), local_var_auth_conf.1.to_owned()); + }; + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("Sudo", local_var_value); + }; + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("X-GITEA-OTP", local_var_value); + }; + + let local_var_req = local_var_req_builder.build()?; + let local_var_resp = local_var_client.execute(local_var_req).await?; + + let local_var_status = local_var_resp.status(); + let local_var_content = local_var_resp.text().await?; + + if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + serde_json::from_str(&local_var_content).map_err(Error::from) + } else { + let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); + let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; + Err(Error::ResponseError(local_var_error)) + } +} + +pub async fn get_general_attachment_settings(configuration: &configuration::Configuration, ) -> Result> { + let local_var_configuration = configuration; + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!("{}/settings/attachment", local_var_configuration.base_path); + let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str()); + + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.query(&[("access_token", local_var_value)]); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.query(&[("sudo", local_var_value)]); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.query(&[("token", local_var_value)]); + } + if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { + local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("Authorization", local_var_value); + }; + if let Some(ref local_var_auth_conf) = local_var_configuration.basic_auth { + local_var_req_builder = local_var_req_builder.basic_auth(local_var_auth_conf.0.to_owned(), local_var_auth_conf.1.to_owned()); + }; + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("Sudo", local_var_value); + }; + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("X-GITEA-OTP", local_var_value); + }; + + let local_var_req = local_var_req_builder.build()?; + let local_var_resp = local_var_client.execute(local_var_req).await?; + + let local_var_status = local_var_resp.status(); + let local_var_content = local_var_resp.text().await?; + + if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + serde_json::from_str(&local_var_content).map_err(Error::from) + } else { + let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); + let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; + Err(Error::ResponseError(local_var_error)) + } +} + +pub async fn get_general_repository_settings(configuration: &configuration::Configuration, ) -> Result> { + let local_var_configuration = configuration; + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!("{}/settings/repository", local_var_configuration.base_path); + let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str()); + + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.query(&[("access_token", local_var_value)]); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.query(&[("sudo", local_var_value)]); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.query(&[("token", local_var_value)]); + } + if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { + local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("Authorization", local_var_value); + }; + if let Some(ref local_var_auth_conf) = local_var_configuration.basic_auth { + local_var_req_builder = local_var_req_builder.basic_auth(local_var_auth_conf.0.to_owned(), local_var_auth_conf.1.to_owned()); + }; + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("Sudo", local_var_value); + }; + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("X-GITEA-OTP", local_var_value); + }; + + let local_var_req = local_var_req_builder.build()?; + let local_var_resp = local_var_client.execute(local_var_req).await?; + + let local_var_status = local_var_resp.status(); + let local_var_content = local_var_resp.text().await?; + + if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + serde_json::from_str(&local_var_content).map_err(Error::from) + } else { + let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); + let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; + Err(Error::ResponseError(local_var_error)) + } +} + +pub async fn get_general_ui_settings(configuration: &configuration::Configuration, ) -> Result> { + let local_var_configuration = configuration; + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!("{}/settings/ui", local_var_configuration.base_path); + let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str()); + + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.query(&[("access_token", local_var_value)]); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.query(&[("sudo", local_var_value)]); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.query(&[("token", local_var_value)]); + } + if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { + local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("Authorization", local_var_value); + }; + if let Some(ref local_var_auth_conf) = local_var_configuration.basic_auth { + local_var_req_builder = local_var_req_builder.basic_auth(local_var_auth_conf.0.to_owned(), local_var_auth_conf.1.to_owned()); + }; + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("Sudo", local_var_value); + }; + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("X-GITEA-OTP", local_var_value); + }; + + let local_var_req = local_var_req_builder.build()?; + let local_var_resp = local_var_client.execute(local_var_req).await?; + + let local_var_status = local_var_resp.status(); + let local_var_content = local_var_resp.text().await?; + + if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + serde_json::from_str(&local_var_content).map_err(Error::from) + } else { + let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); + let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; + Err(Error::ResponseError(local_var_error)) + } +} + diff --git a/crates/gitea_raw_client/src/apis/user_api.rs b/crates/gitea_raw_client/src/apis/user_api.rs new file mode 100644 index 0000000..f19ac75 --- /dev/null +++ b/crates/gitea_raw_client/src/apis/user_api.rs @@ -0,0 +1,4443 @@ +/* + * Gitea API. + * + * This documentation describes the Gitea API. + * + * The version of the OpenAPI document: 1.17.3 + * + * Generated by: https://openapi-generator.tech + */ + + +use reqwest; + +use crate::apis::ResponseContent; +use super::{Error, configuration}; + + +/// struct for typed errors of method [`create_current_user_repo`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum CreateCurrentUserRepoError { + Status409(), + Status422(), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`get_user_settings`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum GetUserSettingsError { + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`get_verification_token`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum GetVerificationTokenError { + Status404(), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`update_user_settings`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum UpdateUserSettingsError { + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`user_add_email`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum UserAddEmailError { + Status422(), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`user_check_following`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum UserCheckFollowingError { + Status404(), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`user_create_o_auth2_application`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum UserCreateOAuth2ApplicationError { + Status400(), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`user_create_token`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum UserCreateTokenError { + Status400(), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`user_current_check_following`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum UserCurrentCheckFollowingError { + Status404(), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`user_current_check_starring`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum UserCurrentCheckStarringError { + Status404(), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`user_current_delete_follow`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum UserCurrentDeleteFollowError { + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`user_current_delete_gpg_key`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum UserCurrentDeleteGpgKeyError { + Status403(), + Status404(), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`user_current_delete_key`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum UserCurrentDeleteKeyError { + Status403(), + Status404(), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`user_current_delete_star`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum UserCurrentDeleteStarError { + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`user_current_get_gpg_key`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum UserCurrentGetGpgKeyError { + Status404(), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`user_current_get_key`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum UserCurrentGetKeyError { + Status404(), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`user_current_list_followers`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum UserCurrentListFollowersError { + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`user_current_list_following`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum UserCurrentListFollowingError { + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`user_current_list_gpg_keys`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum UserCurrentListGpgKeysError { + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`user_current_list_keys`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum UserCurrentListKeysError { + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`user_current_list_repos`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum UserCurrentListReposError { + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`user_current_list_starred`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum UserCurrentListStarredError { + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`user_current_list_subscriptions`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum UserCurrentListSubscriptionsError { + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`user_current_post_gpg_key`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum UserCurrentPostGpgKeyError { + Status404(), + Status422(), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`user_current_post_key`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum UserCurrentPostKeyError { + Status422(), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`user_current_put_follow`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum UserCurrentPutFollowError { + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`user_current_put_star`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum UserCurrentPutStarError { + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`user_current_tracked_times`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum UserCurrentTrackedTimesError { + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`user_delete_access_token`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum UserDeleteAccessTokenError { + Status404(), + Status422(), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`user_delete_email`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum UserDeleteEmailError { + Status404(), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`user_delete_o_auth2_application`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum UserDeleteOAuth2ApplicationError { + Status404(), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`user_get`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum UserGetError { + Status404(), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`user_get_current`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum UserGetCurrentError { + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`user_get_heatmap_data`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum UserGetHeatmapDataError { + Status404(), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`user_get_o_auth2_application`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum UserGetOAuth2ApplicationError { + Status404(), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`user_get_oauth2_application`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum UserGetOauth2ApplicationError { + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`user_get_stop_watches`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum UserGetStopWatchesError { + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`user_get_tokens`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum UserGetTokensError { + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`user_list_emails`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum UserListEmailsError { + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`user_list_followers`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum UserListFollowersError { + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`user_list_following`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum UserListFollowingError { + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`user_list_gpg_keys`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum UserListGpgKeysError { + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`user_list_keys`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum UserListKeysError { + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`user_list_repos`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum UserListReposError { + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`user_list_starred`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum UserListStarredError { + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`user_list_subscriptions`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum UserListSubscriptionsError { + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`user_list_teams`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum UserListTeamsError { + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`user_search`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum UserSearchError { + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`user_update_o_auth2_application`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum UserUpdateOAuth2ApplicationError { + Status404(), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`user_verify_gpg_key`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum UserVerifyGpgKeyError { + Status404(), + Status422(), + UnknownValue(serde_json::Value), +} + + +pub async fn create_current_user_repo(configuration: &configuration::Configuration, body: Option) -> Result> { + let local_var_configuration = configuration; + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!("{}/user/repos", local_var_configuration.base_path); + let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str()); + + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.query(&[("access_token", local_var_value)]); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.query(&[("sudo", local_var_value)]); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.query(&[("token", local_var_value)]); + } + if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { + local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("Authorization", local_var_value); + }; + if let Some(ref local_var_auth_conf) = local_var_configuration.basic_auth { + local_var_req_builder = local_var_req_builder.basic_auth(local_var_auth_conf.0.to_owned(), local_var_auth_conf.1.to_owned()); + }; + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("Sudo", local_var_value); + }; + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("X-GITEA-OTP", local_var_value); + }; + local_var_req_builder = local_var_req_builder.json(&body); + + let local_var_req = local_var_req_builder.build()?; + let local_var_resp = local_var_client.execute(local_var_req).await?; + + let local_var_status = local_var_resp.status(); + let local_var_content = local_var_resp.text().await?; + + if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + serde_json::from_str(&local_var_content).map_err(Error::from) + } else { + let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); + let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; + Err(Error::ResponseError(local_var_error)) + } +} + +pub async fn get_user_settings(configuration: &configuration::Configuration, ) -> Result, Error> { + let local_var_configuration = configuration; + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!("{}/user/settings", local_var_configuration.base_path); + let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str()); + + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.query(&[("access_token", local_var_value)]); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.query(&[("sudo", local_var_value)]); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.query(&[("token", local_var_value)]); + } + if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { + local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("Authorization", local_var_value); + }; + if let Some(ref local_var_auth_conf) = local_var_configuration.basic_auth { + local_var_req_builder = local_var_req_builder.basic_auth(local_var_auth_conf.0.to_owned(), local_var_auth_conf.1.to_owned()); + }; + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("Sudo", local_var_value); + }; + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("X-GITEA-OTP", local_var_value); + }; + + let local_var_req = local_var_req_builder.build()?; + let local_var_resp = local_var_client.execute(local_var_req).await?; + + let local_var_status = local_var_resp.status(); + let local_var_content = local_var_resp.text().await?; + + if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + serde_json::from_str(&local_var_content).map_err(Error::from) + } else { + let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); + let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; + Err(Error::ResponseError(local_var_error)) + } +} + +pub async fn get_verification_token(configuration: &configuration::Configuration, ) -> Result> { + let local_var_configuration = configuration; + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!("{}/user/gpg_key_token", local_var_configuration.base_path); + let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str()); + + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.query(&[("access_token", local_var_value)]); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.query(&[("sudo", local_var_value)]); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.query(&[("token", local_var_value)]); + } + if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { + local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("Authorization", local_var_value); + }; + if let Some(ref local_var_auth_conf) = local_var_configuration.basic_auth { + local_var_req_builder = local_var_req_builder.basic_auth(local_var_auth_conf.0.to_owned(), local_var_auth_conf.1.to_owned()); + }; + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("Sudo", local_var_value); + }; + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("X-GITEA-OTP", local_var_value); + }; + + let local_var_req = local_var_req_builder.build()?; + let local_var_resp = local_var_client.execute(local_var_req).await?; + + let local_var_status = local_var_resp.status(); + let local_var_content = local_var_resp.text().await?; + + if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + serde_json::from_str(&local_var_content).map_err(Error::from) + } else { + let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); + let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; + Err(Error::ResponseError(local_var_error)) + } +} + +pub async fn update_user_settings(configuration: &configuration::Configuration, body: Option) -> Result, Error> { + let local_var_configuration = configuration; + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!("{}/user/settings", local_var_configuration.base_path); + let mut local_var_req_builder = local_var_client.request(reqwest::Method::PATCH, local_var_uri_str.as_str()); + + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.query(&[("access_token", local_var_value)]); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.query(&[("sudo", local_var_value)]); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.query(&[("token", local_var_value)]); + } + if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { + local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("Authorization", local_var_value); + }; + if let Some(ref local_var_auth_conf) = local_var_configuration.basic_auth { + local_var_req_builder = local_var_req_builder.basic_auth(local_var_auth_conf.0.to_owned(), local_var_auth_conf.1.to_owned()); + }; + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("Sudo", local_var_value); + }; + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("X-GITEA-OTP", local_var_value); + }; + local_var_req_builder = local_var_req_builder.json(&body); + + let local_var_req = local_var_req_builder.build()?; + let local_var_resp = local_var_client.execute(local_var_req).await?; + + let local_var_status = local_var_resp.status(); + let local_var_content = local_var_resp.text().await?; + + if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + serde_json::from_str(&local_var_content).map_err(Error::from) + } else { + let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); + let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; + Err(Error::ResponseError(local_var_error)) + } +} + +pub async fn user_add_email(configuration: &configuration::Configuration, body: Option) -> Result, Error> { + let local_var_configuration = configuration; + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!("{}/user/emails", local_var_configuration.base_path); + let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str()); + + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.query(&[("access_token", local_var_value)]); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.query(&[("sudo", local_var_value)]); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.query(&[("token", local_var_value)]); + } + if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { + local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("Authorization", local_var_value); + }; + if let Some(ref local_var_auth_conf) = local_var_configuration.basic_auth { + local_var_req_builder = local_var_req_builder.basic_auth(local_var_auth_conf.0.to_owned(), local_var_auth_conf.1.to_owned()); + }; + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("Sudo", local_var_value); + }; + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("X-GITEA-OTP", local_var_value); + }; + local_var_req_builder = local_var_req_builder.json(&body); + + let local_var_req = local_var_req_builder.build()?; + let local_var_resp = local_var_client.execute(local_var_req).await?; + + let local_var_status = local_var_resp.status(); + let local_var_content = local_var_resp.text().await?; + + if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + serde_json::from_str(&local_var_content).map_err(Error::from) + } else { + let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); + let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; + Err(Error::ResponseError(local_var_error)) + } +} + +pub async fn user_check_following(configuration: &configuration::Configuration, username: &str, target: &str) -> Result<(), Error> { + let local_var_configuration = configuration; + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!("{}/users/{username}/following/{target}", local_var_configuration.base_path, username=crate::apis::urlencode(username), target=crate::apis::urlencode(target)); + let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str()); + + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.query(&[("access_token", local_var_value)]); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.query(&[("sudo", local_var_value)]); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.query(&[("token", local_var_value)]); + } + if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { + local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("Authorization", local_var_value); + }; + if let Some(ref local_var_auth_conf) = local_var_configuration.basic_auth { + local_var_req_builder = local_var_req_builder.basic_auth(local_var_auth_conf.0.to_owned(), local_var_auth_conf.1.to_owned()); + }; + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("Sudo", local_var_value); + }; + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("X-GITEA-OTP", local_var_value); + }; + + let local_var_req = local_var_req_builder.build()?; + let local_var_resp = local_var_client.execute(local_var_req).await?; + + let local_var_status = local_var_resp.status(); + let local_var_content = local_var_resp.text().await?; + + if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + Ok(()) + } else { + let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); + let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; + Err(Error::ResponseError(local_var_error)) + } +} + +pub async fn user_create_o_auth2_application(configuration: &configuration::Configuration, body: crate::models::CreateOAuth2ApplicationOptions) -> Result> { + let local_var_configuration = configuration; + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!("{}/user/applications/oauth2", local_var_configuration.base_path); + let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str()); + + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.query(&[("access_token", local_var_value)]); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.query(&[("sudo", local_var_value)]); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.query(&[("token", local_var_value)]); + } + if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { + local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("Authorization", local_var_value); + }; + if let Some(ref local_var_auth_conf) = local_var_configuration.basic_auth { + local_var_req_builder = local_var_req_builder.basic_auth(local_var_auth_conf.0.to_owned(), local_var_auth_conf.1.to_owned()); + }; + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("Sudo", local_var_value); + }; + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("X-GITEA-OTP", local_var_value); + }; + local_var_req_builder = local_var_req_builder.json(&body); + + let local_var_req = local_var_req_builder.build()?; + let local_var_resp = local_var_client.execute(local_var_req).await?; + + let local_var_status = local_var_resp.status(); + let local_var_content = local_var_resp.text().await?; + + if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + serde_json::from_str(&local_var_content).map_err(Error::from) + } else { + let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); + let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; + Err(Error::ResponseError(local_var_error)) + } +} + +pub async fn user_create_token(configuration: &configuration::Configuration, username: &str, user_create_token: Option) -> Result> { + let local_var_configuration = configuration; + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!("{}/users/{username}/tokens", local_var_configuration.base_path, username=crate::apis::urlencode(username)); + let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str()); + + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.query(&[("access_token", local_var_value)]); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.query(&[("sudo", local_var_value)]); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.query(&[("token", local_var_value)]); + } + if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { + local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("Authorization", local_var_value); + }; + if let Some(ref local_var_auth_conf) = local_var_configuration.basic_auth { + local_var_req_builder = local_var_req_builder.basic_auth(local_var_auth_conf.0.to_owned(), local_var_auth_conf.1.to_owned()); + }; + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("Sudo", local_var_value); + }; + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("X-GITEA-OTP", local_var_value); + }; + local_var_req_builder = local_var_req_builder.json(&user_create_token); + + let local_var_req = local_var_req_builder.build()?; + let local_var_resp = local_var_client.execute(local_var_req).await?; + + let local_var_status = local_var_resp.status(); + let local_var_content = local_var_resp.text().await?; + + if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + serde_json::from_str(&local_var_content).map_err(Error::from) + } else { + let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); + let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; + Err(Error::ResponseError(local_var_error)) + } +} + +pub async fn user_current_check_following(configuration: &configuration::Configuration, username: &str) -> Result<(), Error> { + let local_var_configuration = configuration; + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!("{}/user/following/{username}", local_var_configuration.base_path, username=crate::apis::urlencode(username)); + let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str()); + + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.query(&[("access_token", local_var_value)]); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.query(&[("sudo", local_var_value)]); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.query(&[("token", local_var_value)]); + } + if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { + local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("Authorization", local_var_value); + }; + if let Some(ref local_var_auth_conf) = local_var_configuration.basic_auth { + local_var_req_builder = local_var_req_builder.basic_auth(local_var_auth_conf.0.to_owned(), local_var_auth_conf.1.to_owned()); + }; + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("Sudo", local_var_value); + }; + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("X-GITEA-OTP", local_var_value); + }; + + let local_var_req = local_var_req_builder.build()?; + let local_var_resp = local_var_client.execute(local_var_req).await?; + + let local_var_status = local_var_resp.status(); + let local_var_content = local_var_resp.text().await?; + + if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + Ok(()) + } else { + let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); + let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; + Err(Error::ResponseError(local_var_error)) + } +} + +pub async fn user_current_check_starring(configuration: &configuration::Configuration, owner: &str, repo: &str) -> Result<(), Error> { + let local_var_configuration = configuration; + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!("{}/user/starred/{owner}/{repo}", local_var_configuration.base_path, owner=crate::apis::urlencode(owner), repo=crate::apis::urlencode(repo)); + let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str()); + + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.query(&[("access_token", local_var_value)]); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.query(&[("sudo", local_var_value)]); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.query(&[("token", local_var_value)]); + } + if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { + local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("Authorization", local_var_value); + }; + if let Some(ref local_var_auth_conf) = local_var_configuration.basic_auth { + local_var_req_builder = local_var_req_builder.basic_auth(local_var_auth_conf.0.to_owned(), local_var_auth_conf.1.to_owned()); + }; + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("Sudo", local_var_value); + }; + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("X-GITEA-OTP", local_var_value); + }; + + let local_var_req = local_var_req_builder.build()?; + let local_var_resp = local_var_client.execute(local_var_req).await?; + + let local_var_status = local_var_resp.status(); + let local_var_content = local_var_resp.text().await?; + + if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + Ok(()) + } else { + let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); + let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; + Err(Error::ResponseError(local_var_error)) + } +} + +pub async fn user_current_delete_follow(configuration: &configuration::Configuration, username: &str) -> Result<(), Error> { + let local_var_configuration = configuration; + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!("{}/user/following/{username}", local_var_configuration.base_path, username=crate::apis::urlencode(username)); + let mut local_var_req_builder = local_var_client.request(reqwest::Method::DELETE, local_var_uri_str.as_str()); + + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.query(&[("access_token", local_var_value)]); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.query(&[("sudo", local_var_value)]); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.query(&[("token", local_var_value)]); + } + if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { + local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("Authorization", local_var_value); + }; + if let Some(ref local_var_auth_conf) = local_var_configuration.basic_auth { + local_var_req_builder = local_var_req_builder.basic_auth(local_var_auth_conf.0.to_owned(), local_var_auth_conf.1.to_owned()); + }; + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("Sudo", local_var_value); + }; + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("X-GITEA-OTP", local_var_value); + }; + + let local_var_req = local_var_req_builder.build()?; + let local_var_resp = local_var_client.execute(local_var_req).await?; + + let local_var_status = local_var_resp.status(); + let local_var_content = local_var_resp.text().await?; + + if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + Ok(()) + } else { + let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); + let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; + Err(Error::ResponseError(local_var_error)) + } +} + +pub async fn user_current_delete_gpg_key(configuration: &configuration::Configuration, id: i64) -> Result<(), Error> { + let local_var_configuration = configuration; + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!("{}/user/gpg_keys/{id}", local_var_configuration.base_path, id=id); + let mut local_var_req_builder = local_var_client.request(reqwest::Method::DELETE, local_var_uri_str.as_str()); + + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.query(&[("access_token", local_var_value)]); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.query(&[("sudo", local_var_value)]); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.query(&[("token", local_var_value)]); + } + if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { + local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("Authorization", local_var_value); + }; + if let Some(ref local_var_auth_conf) = local_var_configuration.basic_auth { + local_var_req_builder = local_var_req_builder.basic_auth(local_var_auth_conf.0.to_owned(), local_var_auth_conf.1.to_owned()); + }; + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("Sudo", local_var_value); + }; + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("X-GITEA-OTP", local_var_value); + }; + + let local_var_req = local_var_req_builder.build()?; + let local_var_resp = local_var_client.execute(local_var_req).await?; + + let local_var_status = local_var_resp.status(); + let local_var_content = local_var_resp.text().await?; + + if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + Ok(()) + } else { + let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); + let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; + Err(Error::ResponseError(local_var_error)) + } +} + +pub async fn user_current_delete_key(configuration: &configuration::Configuration, id: i64) -> Result<(), Error> { + let local_var_configuration = configuration; + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!("{}/user/keys/{id}", local_var_configuration.base_path, id=id); + let mut local_var_req_builder = local_var_client.request(reqwest::Method::DELETE, local_var_uri_str.as_str()); + + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.query(&[("access_token", local_var_value)]); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.query(&[("sudo", local_var_value)]); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.query(&[("token", local_var_value)]); + } + if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { + local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("Authorization", local_var_value); + }; + if let Some(ref local_var_auth_conf) = local_var_configuration.basic_auth { + local_var_req_builder = local_var_req_builder.basic_auth(local_var_auth_conf.0.to_owned(), local_var_auth_conf.1.to_owned()); + }; + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("Sudo", local_var_value); + }; + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("X-GITEA-OTP", local_var_value); + }; + + let local_var_req = local_var_req_builder.build()?; + let local_var_resp = local_var_client.execute(local_var_req).await?; + + let local_var_status = local_var_resp.status(); + let local_var_content = local_var_resp.text().await?; + + if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + Ok(()) + } else { + let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); + let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; + Err(Error::ResponseError(local_var_error)) + } +} + +pub async fn user_current_delete_star(configuration: &configuration::Configuration, owner: &str, repo: &str) -> Result<(), Error> { + let local_var_configuration = configuration; + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!("{}/user/starred/{owner}/{repo}", local_var_configuration.base_path, owner=crate::apis::urlencode(owner), repo=crate::apis::urlencode(repo)); + let mut local_var_req_builder = local_var_client.request(reqwest::Method::DELETE, local_var_uri_str.as_str()); + + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.query(&[("access_token", local_var_value)]); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.query(&[("sudo", local_var_value)]); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.query(&[("token", local_var_value)]); + } + if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { + local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("Authorization", local_var_value); + }; + if let Some(ref local_var_auth_conf) = local_var_configuration.basic_auth { + local_var_req_builder = local_var_req_builder.basic_auth(local_var_auth_conf.0.to_owned(), local_var_auth_conf.1.to_owned()); + }; + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("Sudo", local_var_value); + }; + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("X-GITEA-OTP", local_var_value); + }; + + let local_var_req = local_var_req_builder.build()?; + let local_var_resp = local_var_client.execute(local_var_req).await?; + + let local_var_status = local_var_resp.status(); + let local_var_content = local_var_resp.text().await?; + + if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + Ok(()) + } else { + let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); + let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; + Err(Error::ResponseError(local_var_error)) + } +} + +pub async fn user_current_get_gpg_key(configuration: &configuration::Configuration, id: i64) -> Result> { + let local_var_configuration = configuration; + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!("{}/user/gpg_keys/{id}", local_var_configuration.base_path, id=id); + let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str()); + + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.query(&[("access_token", local_var_value)]); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.query(&[("sudo", local_var_value)]); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.query(&[("token", local_var_value)]); + } + if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { + local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("Authorization", local_var_value); + }; + if let Some(ref local_var_auth_conf) = local_var_configuration.basic_auth { + local_var_req_builder = local_var_req_builder.basic_auth(local_var_auth_conf.0.to_owned(), local_var_auth_conf.1.to_owned()); + }; + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("Sudo", local_var_value); + }; + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("X-GITEA-OTP", local_var_value); + }; + + let local_var_req = local_var_req_builder.build()?; + let local_var_resp = local_var_client.execute(local_var_req).await?; + + let local_var_status = local_var_resp.status(); + let local_var_content = local_var_resp.text().await?; + + if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + serde_json::from_str(&local_var_content).map_err(Error::from) + } else { + let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); + let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; + Err(Error::ResponseError(local_var_error)) + } +} + +pub async fn user_current_get_key(configuration: &configuration::Configuration, id: i64) -> Result> { + let local_var_configuration = configuration; + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!("{}/user/keys/{id}", local_var_configuration.base_path, id=id); + let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str()); + + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.query(&[("access_token", local_var_value)]); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.query(&[("sudo", local_var_value)]); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.query(&[("token", local_var_value)]); + } + if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { + local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("Authorization", local_var_value); + }; + if let Some(ref local_var_auth_conf) = local_var_configuration.basic_auth { + local_var_req_builder = local_var_req_builder.basic_auth(local_var_auth_conf.0.to_owned(), local_var_auth_conf.1.to_owned()); + }; + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("Sudo", local_var_value); + }; + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("X-GITEA-OTP", local_var_value); + }; + + let local_var_req = local_var_req_builder.build()?; + let local_var_resp = local_var_client.execute(local_var_req).await?; + + let local_var_status = local_var_resp.status(); + let local_var_content = local_var_resp.text().await?; + + if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + serde_json::from_str(&local_var_content).map_err(Error::from) + } else { + let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); + let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; + Err(Error::ResponseError(local_var_error)) + } +} + +pub async fn user_current_list_followers(configuration: &configuration::Configuration, page: Option, limit: Option) -> Result, Error> { + let local_var_configuration = configuration; + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!("{}/user/followers", local_var_configuration.base_path); + let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str()); + + if let Some(ref local_var_str) = page { + local_var_req_builder = local_var_req_builder.query(&[("page", &local_var_str.to_string())]); + } + if let Some(ref local_var_str) = limit { + local_var_req_builder = local_var_req_builder.query(&[("limit", &local_var_str.to_string())]); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.query(&[("access_token", local_var_value)]); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.query(&[("sudo", local_var_value)]); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.query(&[("token", local_var_value)]); + } + if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { + local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("Authorization", local_var_value); + }; + if let Some(ref local_var_auth_conf) = local_var_configuration.basic_auth { + local_var_req_builder = local_var_req_builder.basic_auth(local_var_auth_conf.0.to_owned(), local_var_auth_conf.1.to_owned()); + }; + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("Sudo", local_var_value); + }; + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("X-GITEA-OTP", local_var_value); + }; + + let local_var_req = local_var_req_builder.build()?; + let local_var_resp = local_var_client.execute(local_var_req).await?; + + let local_var_status = local_var_resp.status(); + let local_var_content = local_var_resp.text().await?; + + if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + serde_json::from_str(&local_var_content).map_err(Error::from) + } else { + let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); + let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; + Err(Error::ResponseError(local_var_error)) + } +} + +pub async fn user_current_list_following(configuration: &configuration::Configuration, page: Option, limit: Option) -> Result, Error> { + let local_var_configuration = configuration; + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!("{}/user/following", local_var_configuration.base_path); + let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str()); + + if let Some(ref local_var_str) = page { + local_var_req_builder = local_var_req_builder.query(&[("page", &local_var_str.to_string())]); + } + if let Some(ref local_var_str) = limit { + local_var_req_builder = local_var_req_builder.query(&[("limit", &local_var_str.to_string())]); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.query(&[("access_token", local_var_value)]); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.query(&[("sudo", local_var_value)]); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.query(&[("token", local_var_value)]); + } + if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { + local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("Authorization", local_var_value); + }; + if let Some(ref local_var_auth_conf) = local_var_configuration.basic_auth { + local_var_req_builder = local_var_req_builder.basic_auth(local_var_auth_conf.0.to_owned(), local_var_auth_conf.1.to_owned()); + }; + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("Sudo", local_var_value); + }; + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("X-GITEA-OTP", local_var_value); + }; + + let local_var_req = local_var_req_builder.build()?; + let local_var_resp = local_var_client.execute(local_var_req).await?; + + let local_var_status = local_var_resp.status(); + let local_var_content = local_var_resp.text().await?; + + if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + serde_json::from_str(&local_var_content).map_err(Error::from) + } else { + let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); + let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; + Err(Error::ResponseError(local_var_error)) + } +} + +pub async fn user_current_list_gpg_keys(configuration: &configuration::Configuration, page: Option, limit: Option) -> Result, Error> { + let local_var_configuration = configuration; + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!("{}/user/gpg_keys", local_var_configuration.base_path); + let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str()); + + if let Some(ref local_var_str) = page { + local_var_req_builder = local_var_req_builder.query(&[("page", &local_var_str.to_string())]); + } + if let Some(ref local_var_str) = limit { + local_var_req_builder = local_var_req_builder.query(&[("limit", &local_var_str.to_string())]); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.query(&[("access_token", local_var_value)]); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.query(&[("sudo", local_var_value)]); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.query(&[("token", local_var_value)]); + } + if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { + local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("Authorization", local_var_value); + }; + if let Some(ref local_var_auth_conf) = local_var_configuration.basic_auth { + local_var_req_builder = local_var_req_builder.basic_auth(local_var_auth_conf.0.to_owned(), local_var_auth_conf.1.to_owned()); + }; + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("Sudo", local_var_value); + }; + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("X-GITEA-OTP", local_var_value); + }; + + let local_var_req = local_var_req_builder.build()?; + let local_var_resp = local_var_client.execute(local_var_req).await?; + + let local_var_status = local_var_resp.status(); + let local_var_content = local_var_resp.text().await?; + + if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + serde_json::from_str(&local_var_content).map_err(Error::from) + } else { + let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); + let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; + Err(Error::ResponseError(local_var_error)) + } +} + +pub async fn user_current_list_keys(configuration: &configuration::Configuration, fingerprint: Option<&str>, page: Option, limit: Option) -> Result, Error> { + let local_var_configuration = configuration; + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!("{}/user/keys", local_var_configuration.base_path); + let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str()); + + if let Some(ref local_var_str) = fingerprint { + local_var_req_builder = local_var_req_builder.query(&[("fingerprint", &local_var_str.to_string())]); + } + if let Some(ref local_var_str) = page { + local_var_req_builder = local_var_req_builder.query(&[("page", &local_var_str.to_string())]); + } + if let Some(ref local_var_str) = limit { + local_var_req_builder = local_var_req_builder.query(&[("limit", &local_var_str.to_string())]); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.query(&[("access_token", local_var_value)]); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.query(&[("sudo", local_var_value)]); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.query(&[("token", local_var_value)]); + } + if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { + local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("Authorization", local_var_value); + }; + if let Some(ref local_var_auth_conf) = local_var_configuration.basic_auth { + local_var_req_builder = local_var_req_builder.basic_auth(local_var_auth_conf.0.to_owned(), local_var_auth_conf.1.to_owned()); + }; + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("Sudo", local_var_value); + }; + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("X-GITEA-OTP", local_var_value); + }; + + let local_var_req = local_var_req_builder.build()?; + let local_var_resp = local_var_client.execute(local_var_req).await?; + + let local_var_status = local_var_resp.status(); + let local_var_content = local_var_resp.text().await?; + + if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + serde_json::from_str(&local_var_content).map_err(Error::from) + } else { + let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); + let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; + Err(Error::ResponseError(local_var_error)) + } +} + +pub async fn user_current_list_repos(configuration: &configuration::Configuration, page: Option, limit: Option) -> Result, Error> { + let local_var_configuration = configuration; + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!("{}/user/repos", local_var_configuration.base_path); + let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str()); + + if let Some(ref local_var_str) = page { + local_var_req_builder = local_var_req_builder.query(&[("page", &local_var_str.to_string())]); + } + if let Some(ref local_var_str) = limit { + local_var_req_builder = local_var_req_builder.query(&[("limit", &local_var_str.to_string())]); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.query(&[("access_token", local_var_value)]); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.query(&[("sudo", local_var_value)]); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.query(&[("token", local_var_value)]); + } + if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { + local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("Authorization", local_var_value); + }; + if let Some(ref local_var_auth_conf) = local_var_configuration.basic_auth { + local_var_req_builder = local_var_req_builder.basic_auth(local_var_auth_conf.0.to_owned(), local_var_auth_conf.1.to_owned()); + }; + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("Sudo", local_var_value); + }; + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("X-GITEA-OTP", local_var_value); + }; + + let local_var_req = local_var_req_builder.build()?; + let local_var_resp = local_var_client.execute(local_var_req).await?; + + let local_var_status = local_var_resp.status(); + let local_var_content = local_var_resp.text().await?; + + if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + serde_json::from_str(&local_var_content).map_err(Error::from) + } else { + let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); + let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; + Err(Error::ResponseError(local_var_error)) + } +} + +pub async fn user_current_list_starred(configuration: &configuration::Configuration, page: Option, limit: Option) -> Result, Error> { + let local_var_configuration = configuration; + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!("{}/user/starred", local_var_configuration.base_path); + let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str()); + + if let Some(ref local_var_str) = page { + local_var_req_builder = local_var_req_builder.query(&[("page", &local_var_str.to_string())]); + } + if let Some(ref local_var_str) = limit { + local_var_req_builder = local_var_req_builder.query(&[("limit", &local_var_str.to_string())]); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.query(&[("access_token", local_var_value)]); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.query(&[("sudo", local_var_value)]); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.query(&[("token", local_var_value)]); + } + if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { + local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("Authorization", local_var_value); + }; + if let Some(ref local_var_auth_conf) = local_var_configuration.basic_auth { + local_var_req_builder = local_var_req_builder.basic_auth(local_var_auth_conf.0.to_owned(), local_var_auth_conf.1.to_owned()); + }; + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("Sudo", local_var_value); + }; + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("X-GITEA-OTP", local_var_value); + }; + + let local_var_req = local_var_req_builder.build()?; + let local_var_resp = local_var_client.execute(local_var_req).await?; + + let local_var_status = local_var_resp.status(); + let local_var_content = local_var_resp.text().await?; + + if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + serde_json::from_str(&local_var_content).map_err(Error::from) + } else { + let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); + let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; + Err(Error::ResponseError(local_var_error)) + } +} + +pub async fn user_current_list_subscriptions(configuration: &configuration::Configuration, page: Option, limit: Option) -> Result, Error> { + let local_var_configuration = configuration; + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!("{}/user/subscriptions", local_var_configuration.base_path); + let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str()); + + if let Some(ref local_var_str) = page { + local_var_req_builder = local_var_req_builder.query(&[("page", &local_var_str.to_string())]); + } + if let Some(ref local_var_str) = limit { + local_var_req_builder = local_var_req_builder.query(&[("limit", &local_var_str.to_string())]); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.query(&[("access_token", local_var_value)]); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.query(&[("sudo", local_var_value)]); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.query(&[("token", local_var_value)]); + } + if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { + local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("Authorization", local_var_value); + }; + if let Some(ref local_var_auth_conf) = local_var_configuration.basic_auth { + local_var_req_builder = local_var_req_builder.basic_auth(local_var_auth_conf.0.to_owned(), local_var_auth_conf.1.to_owned()); + }; + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("Sudo", local_var_value); + }; + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("X-GITEA-OTP", local_var_value); + }; + + let local_var_req = local_var_req_builder.build()?; + let local_var_resp = local_var_client.execute(local_var_req).await?; + + let local_var_status = local_var_resp.status(); + let local_var_content = local_var_resp.text().await?; + + if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + serde_json::from_str(&local_var_content).map_err(Error::from) + } else { + let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); + let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; + Err(Error::ResponseError(local_var_error)) + } +} + +pub async fn user_current_post_gpg_key(configuration: &configuration::Configuration, form: Option) -> Result> { + let local_var_configuration = configuration; + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!("{}/user/gpg_keys", local_var_configuration.base_path); + let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str()); + + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.query(&[("access_token", local_var_value)]); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.query(&[("sudo", local_var_value)]); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.query(&[("token", local_var_value)]); + } + if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { + local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("Authorization", local_var_value); + }; + if let Some(ref local_var_auth_conf) = local_var_configuration.basic_auth { + local_var_req_builder = local_var_req_builder.basic_auth(local_var_auth_conf.0.to_owned(), local_var_auth_conf.1.to_owned()); + }; + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("Sudo", local_var_value); + }; + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("X-GITEA-OTP", local_var_value); + }; + local_var_req_builder = local_var_req_builder.json(&form); + + let local_var_req = local_var_req_builder.build()?; + let local_var_resp = local_var_client.execute(local_var_req).await?; + + let local_var_status = local_var_resp.status(); + let local_var_content = local_var_resp.text().await?; + + if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + serde_json::from_str(&local_var_content).map_err(Error::from) + } else { + let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); + let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; + Err(Error::ResponseError(local_var_error)) + } +} + +pub async fn user_current_post_key(configuration: &configuration::Configuration, body: Option) -> Result> { + let local_var_configuration = configuration; + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!("{}/user/keys", local_var_configuration.base_path); + let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str()); + + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.query(&[("access_token", local_var_value)]); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.query(&[("sudo", local_var_value)]); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.query(&[("token", local_var_value)]); + } + if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { + local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("Authorization", local_var_value); + }; + if let Some(ref local_var_auth_conf) = local_var_configuration.basic_auth { + local_var_req_builder = local_var_req_builder.basic_auth(local_var_auth_conf.0.to_owned(), local_var_auth_conf.1.to_owned()); + }; + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("Sudo", local_var_value); + }; + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("X-GITEA-OTP", local_var_value); + }; + local_var_req_builder = local_var_req_builder.json(&body); + + let local_var_req = local_var_req_builder.build()?; + let local_var_resp = local_var_client.execute(local_var_req).await?; + + let local_var_status = local_var_resp.status(); + let local_var_content = local_var_resp.text().await?; + + if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + serde_json::from_str(&local_var_content).map_err(Error::from) + } else { + let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); + let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; + Err(Error::ResponseError(local_var_error)) + } +} + +pub async fn user_current_put_follow(configuration: &configuration::Configuration, username: &str) -> Result<(), Error> { + let local_var_configuration = configuration; + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!("{}/user/following/{username}", local_var_configuration.base_path, username=crate::apis::urlencode(username)); + let mut local_var_req_builder = local_var_client.request(reqwest::Method::PUT, local_var_uri_str.as_str()); + + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.query(&[("access_token", local_var_value)]); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.query(&[("sudo", local_var_value)]); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.query(&[("token", local_var_value)]); + } + if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { + local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("Authorization", local_var_value); + }; + if let Some(ref local_var_auth_conf) = local_var_configuration.basic_auth { + local_var_req_builder = local_var_req_builder.basic_auth(local_var_auth_conf.0.to_owned(), local_var_auth_conf.1.to_owned()); + }; + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("Sudo", local_var_value); + }; + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("X-GITEA-OTP", local_var_value); + }; + + let local_var_req = local_var_req_builder.build()?; + let local_var_resp = local_var_client.execute(local_var_req).await?; + + let local_var_status = local_var_resp.status(); + let local_var_content = local_var_resp.text().await?; + + if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + Ok(()) + } else { + let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); + let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; + Err(Error::ResponseError(local_var_error)) + } +} + +pub async fn user_current_put_star(configuration: &configuration::Configuration, owner: &str, repo: &str) -> Result<(), Error> { + let local_var_configuration = configuration; + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!("{}/user/starred/{owner}/{repo}", local_var_configuration.base_path, owner=crate::apis::urlencode(owner), repo=crate::apis::urlencode(repo)); + let mut local_var_req_builder = local_var_client.request(reqwest::Method::PUT, local_var_uri_str.as_str()); + + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.query(&[("access_token", local_var_value)]); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.query(&[("sudo", local_var_value)]); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.query(&[("token", local_var_value)]); + } + if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { + local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("Authorization", local_var_value); + }; + if let Some(ref local_var_auth_conf) = local_var_configuration.basic_auth { + local_var_req_builder = local_var_req_builder.basic_auth(local_var_auth_conf.0.to_owned(), local_var_auth_conf.1.to_owned()); + }; + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("Sudo", local_var_value); + }; + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("X-GITEA-OTP", local_var_value); + }; + + let local_var_req = local_var_req_builder.build()?; + let local_var_resp = local_var_client.execute(local_var_req).await?; + + let local_var_status = local_var_resp.status(); + let local_var_content = local_var_resp.text().await?; + + if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + Ok(()) + } else { + let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); + let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; + Err(Error::ResponseError(local_var_error)) + } +} + +pub async fn user_current_tracked_times(configuration: &configuration::Configuration, page: Option, limit: Option, since: Option, before: Option) -> Result, Error> { + let local_var_configuration = configuration; + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!("{}/user/times", local_var_configuration.base_path); + let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str()); + + if let Some(ref local_var_str) = page { + local_var_req_builder = local_var_req_builder.query(&[("page", &local_var_str.to_string())]); + } + if let Some(ref local_var_str) = limit { + local_var_req_builder = local_var_req_builder.query(&[("limit", &local_var_str.to_string())]); + } + if let Some(ref local_var_str) = since { + local_var_req_builder = local_var_req_builder.query(&[("since", &local_var_str.to_string())]); + } + if let Some(ref local_var_str) = before { + local_var_req_builder = local_var_req_builder.query(&[("before", &local_var_str.to_string())]); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.query(&[("access_token", local_var_value)]); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.query(&[("sudo", local_var_value)]); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.query(&[("token", local_var_value)]); + } + if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { + local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("Authorization", local_var_value); + }; + if let Some(ref local_var_auth_conf) = local_var_configuration.basic_auth { + local_var_req_builder = local_var_req_builder.basic_auth(local_var_auth_conf.0.to_owned(), local_var_auth_conf.1.to_owned()); + }; + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("Sudo", local_var_value); + }; + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("X-GITEA-OTP", local_var_value); + }; + + let local_var_req = local_var_req_builder.build()?; + let local_var_resp = local_var_client.execute(local_var_req).await?; + + let local_var_status = local_var_resp.status(); + let local_var_content = local_var_resp.text().await?; + + if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + serde_json::from_str(&local_var_content).map_err(Error::from) + } else { + let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); + let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; + Err(Error::ResponseError(local_var_error)) + } +} + +pub async fn user_delete_access_token(configuration: &configuration::Configuration, username: &str, token: &str) -> Result<(), Error> { + let local_var_configuration = configuration; + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!("{}/users/{username}/tokens/{token}", local_var_configuration.base_path, username=crate::apis::urlencode(username), token=crate::apis::urlencode(token)); + let mut local_var_req_builder = local_var_client.request(reqwest::Method::DELETE, local_var_uri_str.as_str()); + + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.query(&[("access_token", local_var_value)]); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.query(&[("sudo", local_var_value)]); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.query(&[("token", local_var_value)]); + } + if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { + local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("Authorization", local_var_value); + }; + if let Some(ref local_var_auth_conf) = local_var_configuration.basic_auth { + local_var_req_builder = local_var_req_builder.basic_auth(local_var_auth_conf.0.to_owned(), local_var_auth_conf.1.to_owned()); + }; + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("Sudo", local_var_value); + }; + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("X-GITEA-OTP", local_var_value); + }; + + let local_var_req = local_var_req_builder.build()?; + let local_var_resp = local_var_client.execute(local_var_req).await?; + + let local_var_status = local_var_resp.status(); + let local_var_content = local_var_resp.text().await?; + + if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + Ok(()) + } else { + let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); + let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; + Err(Error::ResponseError(local_var_error)) + } +} + +pub async fn user_delete_email(configuration: &configuration::Configuration, body: Option) -> Result<(), Error> { + let local_var_configuration = configuration; + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!("{}/user/emails", local_var_configuration.base_path); + let mut local_var_req_builder = local_var_client.request(reqwest::Method::DELETE, local_var_uri_str.as_str()); + + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.query(&[("access_token", local_var_value)]); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.query(&[("sudo", local_var_value)]); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.query(&[("token", local_var_value)]); + } + if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { + local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("Authorization", local_var_value); + }; + if let Some(ref local_var_auth_conf) = local_var_configuration.basic_auth { + local_var_req_builder = local_var_req_builder.basic_auth(local_var_auth_conf.0.to_owned(), local_var_auth_conf.1.to_owned()); + }; + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("Sudo", local_var_value); + }; + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("X-GITEA-OTP", local_var_value); + }; + local_var_req_builder = local_var_req_builder.json(&body); + + let local_var_req = local_var_req_builder.build()?; + let local_var_resp = local_var_client.execute(local_var_req).await?; + + let local_var_status = local_var_resp.status(); + let local_var_content = local_var_resp.text().await?; + + if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + Ok(()) + } else { + let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); + let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; + Err(Error::ResponseError(local_var_error)) + } +} + +pub async fn user_delete_o_auth2_application(configuration: &configuration::Configuration, id: i64) -> Result<(), Error> { + let local_var_configuration = configuration; + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!("{}/user/applications/oauth2/{id}", local_var_configuration.base_path, id=id); + let mut local_var_req_builder = local_var_client.request(reqwest::Method::DELETE, local_var_uri_str.as_str()); + + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.query(&[("access_token", local_var_value)]); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.query(&[("sudo", local_var_value)]); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.query(&[("token", local_var_value)]); + } + if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { + local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("Authorization", local_var_value); + }; + if let Some(ref local_var_auth_conf) = local_var_configuration.basic_auth { + local_var_req_builder = local_var_req_builder.basic_auth(local_var_auth_conf.0.to_owned(), local_var_auth_conf.1.to_owned()); + }; + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("Sudo", local_var_value); + }; + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("X-GITEA-OTP", local_var_value); + }; + + let local_var_req = local_var_req_builder.build()?; + let local_var_resp = local_var_client.execute(local_var_req).await?; + + let local_var_status = local_var_resp.status(); + let local_var_content = local_var_resp.text().await?; + + if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + Ok(()) + } else { + let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); + let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; + Err(Error::ResponseError(local_var_error)) + } +} + +pub async fn user_get(configuration: &configuration::Configuration, username: &str) -> Result> { + let local_var_configuration = configuration; + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!("{}/users/{username}", local_var_configuration.base_path, username=crate::apis::urlencode(username)); + let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str()); + + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.query(&[("access_token", local_var_value)]); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.query(&[("sudo", local_var_value)]); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.query(&[("token", local_var_value)]); + } + if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { + local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("Authorization", local_var_value); + }; + if let Some(ref local_var_auth_conf) = local_var_configuration.basic_auth { + local_var_req_builder = local_var_req_builder.basic_auth(local_var_auth_conf.0.to_owned(), local_var_auth_conf.1.to_owned()); + }; + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("Sudo", local_var_value); + }; + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("X-GITEA-OTP", local_var_value); + }; + + let local_var_req = local_var_req_builder.build()?; + let local_var_resp = local_var_client.execute(local_var_req).await?; + + let local_var_status = local_var_resp.status(); + let local_var_content = local_var_resp.text().await?; + + if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + serde_json::from_str(&local_var_content).map_err(Error::from) + } else { + let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); + let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; + Err(Error::ResponseError(local_var_error)) + } +} + +pub async fn user_get_current(configuration: &configuration::Configuration, ) -> Result> { + let local_var_configuration = configuration; + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!("{}/user", local_var_configuration.base_path); + let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str()); + + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.query(&[("access_token", local_var_value)]); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.query(&[("sudo", local_var_value)]); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.query(&[("token", local_var_value)]); + } + if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { + local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("Authorization", local_var_value); + }; + if let Some(ref local_var_auth_conf) = local_var_configuration.basic_auth { + local_var_req_builder = local_var_req_builder.basic_auth(local_var_auth_conf.0.to_owned(), local_var_auth_conf.1.to_owned()); + }; + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("Sudo", local_var_value); + }; + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("X-GITEA-OTP", local_var_value); + }; + + let local_var_req = local_var_req_builder.build()?; + let local_var_resp = local_var_client.execute(local_var_req).await?; + + let local_var_status = local_var_resp.status(); + let local_var_content = local_var_resp.text().await?; + + if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + serde_json::from_str(&local_var_content).map_err(Error::from) + } else { + let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); + let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; + Err(Error::ResponseError(local_var_error)) + } +} + +pub async fn user_get_heatmap_data(configuration: &configuration::Configuration, username: &str) -> Result, Error> { + let local_var_configuration = configuration; + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!("{}/users/{username}/heatmap", local_var_configuration.base_path, username=crate::apis::urlencode(username)); + let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str()); + + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.query(&[("access_token", local_var_value)]); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.query(&[("sudo", local_var_value)]); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.query(&[("token", local_var_value)]); + } + if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { + local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("Authorization", local_var_value); + }; + if let Some(ref local_var_auth_conf) = local_var_configuration.basic_auth { + local_var_req_builder = local_var_req_builder.basic_auth(local_var_auth_conf.0.to_owned(), local_var_auth_conf.1.to_owned()); + }; + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("Sudo", local_var_value); + }; + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("X-GITEA-OTP", local_var_value); + }; + + let local_var_req = local_var_req_builder.build()?; + let local_var_resp = local_var_client.execute(local_var_req).await?; + + let local_var_status = local_var_resp.status(); + let local_var_content = local_var_resp.text().await?; + + if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + serde_json::from_str(&local_var_content).map_err(Error::from) + } else { + let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); + let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; + Err(Error::ResponseError(local_var_error)) + } +} + +pub async fn user_get_o_auth2_application(configuration: &configuration::Configuration, id: i64) -> Result> { + let local_var_configuration = configuration; + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!("{}/user/applications/oauth2/{id}", local_var_configuration.base_path, id=id); + let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str()); + + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.query(&[("access_token", local_var_value)]); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.query(&[("sudo", local_var_value)]); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.query(&[("token", local_var_value)]); + } + if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { + local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("Authorization", local_var_value); + }; + if let Some(ref local_var_auth_conf) = local_var_configuration.basic_auth { + local_var_req_builder = local_var_req_builder.basic_auth(local_var_auth_conf.0.to_owned(), local_var_auth_conf.1.to_owned()); + }; + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("Sudo", local_var_value); + }; + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("X-GITEA-OTP", local_var_value); + }; + + let local_var_req = local_var_req_builder.build()?; + let local_var_resp = local_var_client.execute(local_var_req).await?; + + let local_var_status = local_var_resp.status(); + let local_var_content = local_var_resp.text().await?; + + if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + serde_json::from_str(&local_var_content).map_err(Error::from) + } else { + let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); + let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; + Err(Error::ResponseError(local_var_error)) + } +} + +pub async fn user_get_oauth2_application(configuration: &configuration::Configuration, page: Option, limit: Option) -> Result, Error> { + let local_var_configuration = configuration; + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!("{}/user/applications/oauth2", local_var_configuration.base_path); + let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str()); + + if let Some(ref local_var_str) = page { + local_var_req_builder = local_var_req_builder.query(&[("page", &local_var_str.to_string())]); + } + if let Some(ref local_var_str) = limit { + local_var_req_builder = local_var_req_builder.query(&[("limit", &local_var_str.to_string())]); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.query(&[("access_token", local_var_value)]); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.query(&[("sudo", local_var_value)]); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.query(&[("token", local_var_value)]); + } + if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { + local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("Authorization", local_var_value); + }; + if let Some(ref local_var_auth_conf) = local_var_configuration.basic_auth { + local_var_req_builder = local_var_req_builder.basic_auth(local_var_auth_conf.0.to_owned(), local_var_auth_conf.1.to_owned()); + }; + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("Sudo", local_var_value); + }; + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("X-GITEA-OTP", local_var_value); + }; + + let local_var_req = local_var_req_builder.build()?; + let local_var_resp = local_var_client.execute(local_var_req).await?; + + let local_var_status = local_var_resp.status(); + let local_var_content = local_var_resp.text().await?; + + if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + serde_json::from_str(&local_var_content).map_err(Error::from) + } else { + let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); + let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; + Err(Error::ResponseError(local_var_error)) + } +} + +pub async fn user_get_stop_watches(configuration: &configuration::Configuration, page: Option, limit: Option) -> Result, Error> { + let local_var_configuration = configuration; + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!("{}/user/stopwatches", local_var_configuration.base_path); + let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str()); + + if let Some(ref local_var_str) = page { + local_var_req_builder = local_var_req_builder.query(&[("page", &local_var_str.to_string())]); + } + if let Some(ref local_var_str) = limit { + local_var_req_builder = local_var_req_builder.query(&[("limit", &local_var_str.to_string())]); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.query(&[("access_token", local_var_value)]); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.query(&[("sudo", local_var_value)]); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.query(&[("token", local_var_value)]); + } + if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { + local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("Authorization", local_var_value); + }; + if let Some(ref local_var_auth_conf) = local_var_configuration.basic_auth { + local_var_req_builder = local_var_req_builder.basic_auth(local_var_auth_conf.0.to_owned(), local_var_auth_conf.1.to_owned()); + }; + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("Sudo", local_var_value); + }; + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("X-GITEA-OTP", local_var_value); + }; + + let local_var_req = local_var_req_builder.build()?; + let local_var_resp = local_var_client.execute(local_var_req).await?; + + let local_var_status = local_var_resp.status(); + let local_var_content = local_var_resp.text().await?; + + if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + serde_json::from_str(&local_var_content).map_err(Error::from) + } else { + let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); + let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; + Err(Error::ResponseError(local_var_error)) + } +} + +pub async fn user_get_tokens(configuration: &configuration::Configuration, username: &str, page: Option, limit: Option) -> Result, Error> { + let local_var_configuration = configuration; + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!("{}/users/{username}/tokens", local_var_configuration.base_path, username=crate::apis::urlencode(username)); + let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str()); + + if let Some(ref local_var_str) = page { + local_var_req_builder = local_var_req_builder.query(&[("page", &local_var_str.to_string())]); + } + if let Some(ref local_var_str) = limit { + local_var_req_builder = local_var_req_builder.query(&[("limit", &local_var_str.to_string())]); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.query(&[("access_token", local_var_value)]); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.query(&[("sudo", local_var_value)]); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.query(&[("token", local_var_value)]); + } + if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { + local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("Authorization", local_var_value); + }; + if let Some(ref local_var_auth_conf) = local_var_configuration.basic_auth { + local_var_req_builder = local_var_req_builder.basic_auth(local_var_auth_conf.0.to_owned(), local_var_auth_conf.1.to_owned()); + }; + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("Sudo", local_var_value); + }; + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("X-GITEA-OTP", local_var_value); + }; + + let local_var_req = local_var_req_builder.build()?; + let local_var_resp = local_var_client.execute(local_var_req).await?; + + let local_var_status = local_var_resp.status(); + let local_var_content = local_var_resp.text().await?; + + if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + serde_json::from_str(&local_var_content).map_err(Error::from) + } else { + let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); + let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; + Err(Error::ResponseError(local_var_error)) + } +} + +pub async fn user_list_emails(configuration: &configuration::Configuration, ) -> Result, Error> { + let local_var_configuration = configuration; + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!("{}/user/emails", local_var_configuration.base_path); + let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str()); + + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.query(&[("access_token", local_var_value)]); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.query(&[("sudo", local_var_value)]); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.query(&[("token", local_var_value)]); + } + if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { + local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("Authorization", local_var_value); + }; + if let Some(ref local_var_auth_conf) = local_var_configuration.basic_auth { + local_var_req_builder = local_var_req_builder.basic_auth(local_var_auth_conf.0.to_owned(), local_var_auth_conf.1.to_owned()); + }; + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("Sudo", local_var_value); + }; + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("X-GITEA-OTP", local_var_value); + }; + + let local_var_req = local_var_req_builder.build()?; + let local_var_resp = local_var_client.execute(local_var_req).await?; + + let local_var_status = local_var_resp.status(); + let local_var_content = local_var_resp.text().await?; + + if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + serde_json::from_str(&local_var_content).map_err(Error::from) + } else { + let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); + let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; + Err(Error::ResponseError(local_var_error)) + } +} + +pub async fn user_list_followers(configuration: &configuration::Configuration, username: &str, page: Option, limit: Option) -> Result, Error> { + let local_var_configuration = configuration; + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!("{}/users/{username}/followers", local_var_configuration.base_path, username=crate::apis::urlencode(username)); + let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str()); + + if let Some(ref local_var_str) = page { + local_var_req_builder = local_var_req_builder.query(&[("page", &local_var_str.to_string())]); + } + if let Some(ref local_var_str) = limit { + local_var_req_builder = local_var_req_builder.query(&[("limit", &local_var_str.to_string())]); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.query(&[("access_token", local_var_value)]); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.query(&[("sudo", local_var_value)]); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.query(&[("token", local_var_value)]); + } + if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { + local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("Authorization", local_var_value); + }; + if let Some(ref local_var_auth_conf) = local_var_configuration.basic_auth { + local_var_req_builder = local_var_req_builder.basic_auth(local_var_auth_conf.0.to_owned(), local_var_auth_conf.1.to_owned()); + }; + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("Sudo", local_var_value); + }; + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("X-GITEA-OTP", local_var_value); + }; + + let local_var_req = local_var_req_builder.build()?; + let local_var_resp = local_var_client.execute(local_var_req).await?; + + let local_var_status = local_var_resp.status(); + let local_var_content = local_var_resp.text().await?; + + if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + serde_json::from_str(&local_var_content).map_err(Error::from) + } else { + let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); + let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; + Err(Error::ResponseError(local_var_error)) + } +} + +pub async fn user_list_following(configuration: &configuration::Configuration, username: &str, page: Option, limit: Option) -> Result, Error> { + let local_var_configuration = configuration; + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!("{}/users/{username}/following", local_var_configuration.base_path, username=crate::apis::urlencode(username)); + let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str()); + + if let Some(ref local_var_str) = page { + local_var_req_builder = local_var_req_builder.query(&[("page", &local_var_str.to_string())]); + } + if let Some(ref local_var_str) = limit { + local_var_req_builder = local_var_req_builder.query(&[("limit", &local_var_str.to_string())]); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.query(&[("access_token", local_var_value)]); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.query(&[("sudo", local_var_value)]); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.query(&[("token", local_var_value)]); + } + if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { + local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("Authorization", local_var_value); + }; + if let Some(ref local_var_auth_conf) = local_var_configuration.basic_auth { + local_var_req_builder = local_var_req_builder.basic_auth(local_var_auth_conf.0.to_owned(), local_var_auth_conf.1.to_owned()); + }; + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("Sudo", local_var_value); + }; + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("X-GITEA-OTP", local_var_value); + }; + + let local_var_req = local_var_req_builder.build()?; + let local_var_resp = local_var_client.execute(local_var_req).await?; + + let local_var_status = local_var_resp.status(); + let local_var_content = local_var_resp.text().await?; + + if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + serde_json::from_str(&local_var_content).map_err(Error::from) + } else { + let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); + let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; + Err(Error::ResponseError(local_var_error)) + } +} + +pub async fn user_list_gpg_keys(configuration: &configuration::Configuration, username: &str, page: Option, limit: Option) -> Result, Error> { + let local_var_configuration = configuration; + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!("{}/users/{username}/gpg_keys", local_var_configuration.base_path, username=crate::apis::urlencode(username)); + let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str()); + + if let Some(ref local_var_str) = page { + local_var_req_builder = local_var_req_builder.query(&[("page", &local_var_str.to_string())]); + } + if let Some(ref local_var_str) = limit { + local_var_req_builder = local_var_req_builder.query(&[("limit", &local_var_str.to_string())]); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.query(&[("access_token", local_var_value)]); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.query(&[("sudo", local_var_value)]); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.query(&[("token", local_var_value)]); + } + if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { + local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("Authorization", local_var_value); + }; + if let Some(ref local_var_auth_conf) = local_var_configuration.basic_auth { + local_var_req_builder = local_var_req_builder.basic_auth(local_var_auth_conf.0.to_owned(), local_var_auth_conf.1.to_owned()); + }; + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("Sudo", local_var_value); + }; + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("X-GITEA-OTP", local_var_value); + }; + + let local_var_req = local_var_req_builder.build()?; + let local_var_resp = local_var_client.execute(local_var_req).await?; + + let local_var_status = local_var_resp.status(); + let local_var_content = local_var_resp.text().await?; + + if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + serde_json::from_str(&local_var_content).map_err(Error::from) + } else { + let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); + let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; + Err(Error::ResponseError(local_var_error)) + } +} + +pub async fn user_list_keys(configuration: &configuration::Configuration, username: &str, fingerprint: Option<&str>, page: Option, limit: Option) -> Result, Error> { + let local_var_configuration = configuration; + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!("{}/users/{username}/keys", local_var_configuration.base_path, username=crate::apis::urlencode(username)); + let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str()); + + if let Some(ref local_var_str) = fingerprint { + local_var_req_builder = local_var_req_builder.query(&[("fingerprint", &local_var_str.to_string())]); + } + if let Some(ref local_var_str) = page { + local_var_req_builder = local_var_req_builder.query(&[("page", &local_var_str.to_string())]); + } + if let Some(ref local_var_str) = limit { + local_var_req_builder = local_var_req_builder.query(&[("limit", &local_var_str.to_string())]); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.query(&[("access_token", local_var_value)]); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.query(&[("sudo", local_var_value)]); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.query(&[("token", local_var_value)]); + } + if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { + local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("Authorization", local_var_value); + }; + if let Some(ref local_var_auth_conf) = local_var_configuration.basic_auth { + local_var_req_builder = local_var_req_builder.basic_auth(local_var_auth_conf.0.to_owned(), local_var_auth_conf.1.to_owned()); + }; + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("Sudo", local_var_value); + }; + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("X-GITEA-OTP", local_var_value); + }; + + let local_var_req = local_var_req_builder.build()?; + let local_var_resp = local_var_client.execute(local_var_req).await?; + + let local_var_status = local_var_resp.status(); + let local_var_content = local_var_resp.text().await?; + + if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + serde_json::from_str(&local_var_content).map_err(Error::from) + } else { + let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); + let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; + Err(Error::ResponseError(local_var_error)) + } +} + +pub async fn user_list_repos(configuration: &configuration::Configuration, username: &str, page: Option, limit: Option) -> Result, Error> { + let local_var_configuration = configuration; + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!("{}/users/{username}/repos", local_var_configuration.base_path, username=crate::apis::urlencode(username)); + let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str()); + + if let Some(ref local_var_str) = page { + local_var_req_builder = local_var_req_builder.query(&[("page", &local_var_str.to_string())]); + } + if let Some(ref local_var_str) = limit { + local_var_req_builder = local_var_req_builder.query(&[("limit", &local_var_str.to_string())]); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.query(&[("access_token", local_var_value)]); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.query(&[("sudo", local_var_value)]); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.query(&[("token", local_var_value)]); + } + if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { + local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("Authorization", local_var_value); + }; + if let Some(ref local_var_auth_conf) = local_var_configuration.basic_auth { + local_var_req_builder = local_var_req_builder.basic_auth(local_var_auth_conf.0.to_owned(), local_var_auth_conf.1.to_owned()); + }; + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("Sudo", local_var_value); + }; + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("X-GITEA-OTP", local_var_value); + }; + + let local_var_req = local_var_req_builder.build()?; + let local_var_resp = local_var_client.execute(local_var_req).await?; + + let local_var_status = local_var_resp.status(); + let local_var_content = local_var_resp.text().await?; + + if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + serde_json::from_str(&local_var_content).map_err(Error::from) + } else { + let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); + let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; + Err(Error::ResponseError(local_var_error)) + } +} + +pub async fn user_list_starred(configuration: &configuration::Configuration, username: &str, page: Option, limit: Option) -> Result, Error> { + let local_var_configuration = configuration; + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!("{}/users/{username}/starred", local_var_configuration.base_path, username=crate::apis::urlencode(username)); + let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str()); + + if let Some(ref local_var_str) = page { + local_var_req_builder = local_var_req_builder.query(&[("page", &local_var_str.to_string())]); + } + if let Some(ref local_var_str) = limit { + local_var_req_builder = local_var_req_builder.query(&[("limit", &local_var_str.to_string())]); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.query(&[("access_token", local_var_value)]); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.query(&[("sudo", local_var_value)]); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.query(&[("token", local_var_value)]); + } + if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { + local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("Authorization", local_var_value); + }; + if let Some(ref local_var_auth_conf) = local_var_configuration.basic_auth { + local_var_req_builder = local_var_req_builder.basic_auth(local_var_auth_conf.0.to_owned(), local_var_auth_conf.1.to_owned()); + }; + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("Sudo", local_var_value); + }; + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("X-GITEA-OTP", local_var_value); + }; + + let local_var_req = local_var_req_builder.build()?; + let local_var_resp = local_var_client.execute(local_var_req).await?; + + let local_var_status = local_var_resp.status(); + let local_var_content = local_var_resp.text().await?; + + if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + serde_json::from_str(&local_var_content).map_err(Error::from) + } else { + let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); + let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; + Err(Error::ResponseError(local_var_error)) + } +} + +pub async fn user_list_subscriptions(configuration: &configuration::Configuration, username: &str, page: Option, limit: Option) -> Result, Error> { + let local_var_configuration = configuration; + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!("{}/users/{username}/subscriptions", local_var_configuration.base_path, username=crate::apis::urlencode(username)); + let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str()); + + if let Some(ref local_var_str) = page { + local_var_req_builder = local_var_req_builder.query(&[("page", &local_var_str.to_string())]); + } + if let Some(ref local_var_str) = limit { + local_var_req_builder = local_var_req_builder.query(&[("limit", &local_var_str.to_string())]); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.query(&[("access_token", local_var_value)]); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.query(&[("sudo", local_var_value)]); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.query(&[("token", local_var_value)]); + } + if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { + local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("Authorization", local_var_value); + }; + if let Some(ref local_var_auth_conf) = local_var_configuration.basic_auth { + local_var_req_builder = local_var_req_builder.basic_auth(local_var_auth_conf.0.to_owned(), local_var_auth_conf.1.to_owned()); + }; + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("Sudo", local_var_value); + }; + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("X-GITEA-OTP", local_var_value); + }; + + let local_var_req = local_var_req_builder.build()?; + let local_var_resp = local_var_client.execute(local_var_req).await?; + + let local_var_status = local_var_resp.status(); + let local_var_content = local_var_resp.text().await?; + + if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + serde_json::from_str(&local_var_content).map_err(Error::from) + } else { + let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); + let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; + Err(Error::ResponseError(local_var_error)) + } +} + +pub async fn user_list_teams(configuration: &configuration::Configuration, page: Option, limit: Option) -> Result, Error> { + let local_var_configuration = configuration; + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!("{}/user/teams", local_var_configuration.base_path); + let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str()); + + if let Some(ref local_var_str) = page { + local_var_req_builder = local_var_req_builder.query(&[("page", &local_var_str.to_string())]); + } + if let Some(ref local_var_str) = limit { + local_var_req_builder = local_var_req_builder.query(&[("limit", &local_var_str.to_string())]); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.query(&[("access_token", local_var_value)]); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.query(&[("sudo", local_var_value)]); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.query(&[("token", local_var_value)]); + } + if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { + local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("Authorization", local_var_value); + }; + if let Some(ref local_var_auth_conf) = local_var_configuration.basic_auth { + local_var_req_builder = local_var_req_builder.basic_auth(local_var_auth_conf.0.to_owned(), local_var_auth_conf.1.to_owned()); + }; + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("Sudo", local_var_value); + }; + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("X-GITEA-OTP", local_var_value); + }; + + let local_var_req = local_var_req_builder.build()?; + let local_var_resp = local_var_client.execute(local_var_req).await?; + + let local_var_status = local_var_resp.status(); + let local_var_content = local_var_resp.text().await?; + + if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + serde_json::from_str(&local_var_content).map_err(Error::from) + } else { + let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); + let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; + Err(Error::ResponseError(local_var_error)) + } +} + +pub async fn user_search(configuration: &configuration::Configuration, q: Option<&str>, uid: Option, page: Option, limit: Option) -> Result> { + let local_var_configuration = configuration; + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!("{}/users/search", local_var_configuration.base_path); + let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str()); + + if let Some(ref local_var_str) = q { + local_var_req_builder = local_var_req_builder.query(&[("q", &local_var_str.to_string())]); + } + if let Some(ref local_var_str) = uid { + local_var_req_builder = local_var_req_builder.query(&[("uid", &local_var_str.to_string())]); + } + if let Some(ref local_var_str) = page { + local_var_req_builder = local_var_req_builder.query(&[("page", &local_var_str.to_string())]); + } + if let Some(ref local_var_str) = limit { + local_var_req_builder = local_var_req_builder.query(&[("limit", &local_var_str.to_string())]); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.query(&[("access_token", local_var_value)]); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.query(&[("sudo", local_var_value)]); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.query(&[("token", local_var_value)]); + } + if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { + local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("Authorization", local_var_value); + }; + if let Some(ref local_var_auth_conf) = local_var_configuration.basic_auth { + local_var_req_builder = local_var_req_builder.basic_auth(local_var_auth_conf.0.to_owned(), local_var_auth_conf.1.to_owned()); + }; + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("Sudo", local_var_value); + }; + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("X-GITEA-OTP", local_var_value); + }; + + let local_var_req = local_var_req_builder.build()?; + let local_var_resp = local_var_client.execute(local_var_req).await?; + + let local_var_status = local_var_resp.status(); + let local_var_content = local_var_resp.text().await?; + + if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + serde_json::from_str(&local_var_content).map_err(Error::from) + } else { + let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); + let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; + Err(Error::ResponseError(local_var_error)) + } +} + +pub async fn user_update_o_auth2_application(configuration: &configuration::Configuration, id: i64, body: crate::models::CreateOAuth2ApplicationOptions) -> Result> { + let local_var_configuration = configuration; + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!("{}/user/applications/oauth2/{id}", local_var_configuration.base_path, id=id); + let mut local_var_req_builder = local_var_client.request(reqwest::Method::PATCH, local_var_uri_str.as_str()); + + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.query(&[("access_token", local_var_value)]); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.query(&[("sudo", local_var_value)]); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.query(&[("token", local_var_value)]); + } + if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { + local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("Authorization", local_var_value); + }; + if let Some(ref local_var_auth_conf) = local_var_configuration.basic_auth { + local_var_req_builder = local_var_req_builder.basic_auth(local_var_auth_conf.0.to_owned(), local_var_auth_conf.1.to_owned()); + }; + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("Sudo", local_var_value); + }; + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("X-GITEA-OTP", local_var_value); + }; + local_var_req_builder = local_var_req_builder.json(&body); + + let local_var_req = local_var_req_builder.build()?; + let local_var_resp = local_var_client.execute(local_var_req).await?; + + let local_var_status = local_var_resp.status(); + let local_var_content = local_var_resp.text().await?; + + if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + serde_json::from_str(&local_var_content).map_err(Error::from) + } else { + let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); + let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; + Err(Error::ResponseError(local_var_error)) + } +} + +pub async fn user_verify_gpg_key(configuration: &configuration::Configuration, ) -> Result> { + let local_var_configuration = configuration; + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!("{}/user/gpg_key_verify", local_var_configuration.base_path); + let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str()); + + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.query(&[("access_token", local_var_value)]); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.query(&[("sudo", local_var_value)]); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.query(&[("token", local_var_value)]); + } + if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { + local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); + } + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("Authorization", local_var_value); + }; + if let Some(ref local_var_auth_conf) = local_var_configuration.basic_auth { + local_var_req_builder = local_var_req_builder.basic_auth(local_var_auth_conf.0.to_owned(), local_var_auth_conf.1.to_owned()); + }; + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("Sudo", local_var_value); + }; + if let Some(ref local_var_apikey) = local_var_configuration.api_key { + let local_var_key = local_var_apikey.key.clone(); + let local_var_value = match local_var_apikey.prefix { + Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key), + None => local_var_key, + }; + local_var_req_builder = local_var_req_builder.header("X-GITEA-OTP", local_var_value); + }; + + let local_var_req = local_var_req_builder.build()?; + let local_var_resp = local_var_client.execute(local_var_req).await?; + + let local_var_status = local_var_resp.status(); + let local_var_content = local_var_resp.text().await?; + + if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + serde_json::from_str(&local_var_content).map_err(Error::from) + } else { + let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); + let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; + Err(Error::ResponseError(local_var_error)) + } +} + diff --git a/crates/gitea_raw_client/src/lib.rs b/crates/gitea_raw_client/src/lib.rs new file mode 100644 index 0000000..c1dd666 --- /dev/null +++ b/crates/gitea_raw_client/src/lib.rs @@ -0,0 +1,10 @@ +#[macro_use] +extern crate serde_derive; + +extern crate serde; +extern crate serde_json; +extern crate url; +extern crate reqwest; + +pub mod apis; +pub mod models; diff --git a/crates/gitea_raw_client/src/models/access_token.rs b/crates/gitea_raw_client/src/models/access_token.rs new file mode 100644 index 0000000..ca1d87d --- /dev/null +++ b/crates/gitea_raw_client/src/models/access_token.rs @@ -0,0 +1,37 @@ +/* + * Gitea API. + * + * This documentation describes the Gitea API. + * + * The version of the OpenAPI document: 1.17.3 + * + * Generated by: https://openapi-generator.tech + */ + + + + +#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)] +pub struct AccessToken { + #[serde(rename = "id", skip_serializing_if = "Option::is_none")] + pub id: Option, + #[serde(rename = "name", skip_serializing_if = "Option::is_none")] + pub name: Option, + #[serde(rename = "sha1", skip_serializing_if = "Option::is_none")] + pub sha1: Option, + #[serde(rename = "token_last_eight", skip_serializing_if = "Option::is_none")] + pub token_last_eight: Option, +} + +impl AccessToken { + pub fn new() -> AccessToken { + AccessToken { + id: None, + name: None, + sha1: None, + token_last_eight: None, + } + } +} + + diff --git a/crates/gitea_raw_client/src/models/add_collaborator_option.rs b/crates/gitea_raw_client/src/models/add_collaborator_option.rs new file mode 100644 index 0000000..b0013fd --- /dev/null +++ b/crates/gitea_raw_client/src/models/add_collaborator_option.rs @@ -0,0 +1,30 @@ +/* + * Gitea API. + * + * This documentation describes the Gitea API. + * + * The version of the OpenAPI document: 1.17.3 + * + * Generated by: https://openapi-generator.tech + */ + +/// AddCollaboratorOption : AddCollaboratorOption options when adding a user as a collaborator of a repository + + + +#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)] +pub struct AddCollaboratorOption { + #[serde(rename = "permission", skip_serializing_if = "Option::is_none")] + pub permission: Option, +} + +impl AddCollaboratorOption { + /// AddCollaboratorOption options when adding a user as a collaborator of a repository + pub fn new() -> AddCollaboratorOption { + AddCollaboratorOption { + permission: None, + } + } +} + + diff --git a/crates/gitea_raw_client/src/models/add_time_option.rs b/crates/gitea_raw_client/src/models/add_time_option.rs new file mode 100644 index 0000000..9b5691c --- /dev/null +++ b/crates/gitea_raw_client/src/models/add_time_option.rs @@ -0,0 +1,38 @@ +/* + * Gitea API. + * + * This documentation describes the Gitea API. + * + * The version of the OpenAPI document: 1.17.3 + * + * Generated by: https://openapi-generator.tech + */ + +/// AddTimeOption : AddTimeOption options for adding time to an issue + + + +#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)] +pub struct AddTimeOption { + #[serde(rename = "created", skip_serializing_if = "Option::is_none")] + pub created: Option, + /// time in seconds + #[serde(rename = "time")] + pub time: i64, + /// User who spent the time (optional) + #[serde(rename = "user_name", skip_serializing_if = "Option::is_none")] + pub user_name: Option, +} + +impl AddTimeOption { + /// AddTimeOption options for adding time to an issue + pub fn new(time: i64) -> AddTimeOption { + AddTimeOption { + created: None, + time, + user_name: None, + } + } +} + + diff --git a/crates/gitea_raw_client/src/models/annotated_tag.rs b/crates/gitea_raw_client/src/models/annotated_tag.rs new file mode 100644 index 0000000..0f939ea --- /dev/null +++ b/crates/gitea_raw_client/src/models/annotated_tag.rs @@ -0,0 +1,48 @@ +/* + * Gitea API. + * + * This documentation describes the Gitea API. + * + * The version of the OpenAPI document: 1.17.3 + * + * Generated by: https://openapi-generator.tech + */ + +/// AnnotatedTag : AnnotatedTag represents an annotated tag + + + +#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)] +pub struct AnnotatedTag { + #[serde(rename = "message", skip_serializing_if = "Option::is_none")] + pub message: Option, + #[serde(rename = "object", skip_serializing_if = "Option::is_none")] + pub object: Option>, + #[serde(rename = "sha", skip_serializing_if = "Option::is_none")] + pub sha: Option, + #[serde(rename = "tag", skip_serializing_if = "Option::is_none")] + pub tag: Option, + #[serde(rename = "tagger", skip_serializing_if = "Option::is_none")] + pub tagger: Option>, + #[serde(rename = "url", skip_serializing_if = "Option::is_none")] + pub url: Option, + #[serde(rename = "verification", skip_serializing_if = "Option::is_none")] + pub verification: Option>, +} + +impl AnnotatedTag { + /// AnnotatedTag represents an annotated tag + pub fn new() -> AnnotatedTag { + AnnotatedTag { + message: None, + object: None, + sha: None, + tag: None, + tagger: None, + url: None, + verification: None, + } + } +} + + diff --git a/crates/gitea_raw_client/src/models/annotated_tag_object.rs b/crates/gitea_raw_client/src/models/annotated_tag_object.rs new file mode 100644 index 0000000..ab4faa5 --- /dev/null +++ b/crates/gitea_raw_client/src/models/annotated_tag_object.rs @@ -0,0 +1,36 @@ +/* + * Gitea API. + * + * This documentation describes the Gitea API. + * + * The version of the OpenAPI document: 1.17.3 + * + * Generated by: https://openapi-generator.tech + */ + +/// AnnotatedTagObject : AnnotatedTagObject contains meta information of the tag object + + + +#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)] +pub struct AnnotatedTagObject { + #[serde(rename = "sha", skip_serializing_if = "Option::is_none")] + pub sha: Option, + #[serde(rename = "type", skip_serializing_if = "Option::is_none")] + pub r#type: Option, + #[serde(rename = "url", skip_serializing_if = "Option::is_none")] + pub url: Option, +} + +impl AnnotatedTagObject { + /// AnnotatedTagObject contains meta information of the tag object + pub fn new() -> AnnotatedTagObject { + AnnotatedTagObject { + sha: None, + r#type: None, + url: None, + } + } +} + + diff --git a/crates/gitea_raw_client/src/models/api_error.rs b/crates/gitea_raw_client/src/models/api_error.rs new file mode 100644 index 0000000..6ce6bd5 --- /dev/null +++ b/crates/gitea_raw_client/src/models/api_error.rs @@ -0,0 +1,33 @@ +/* + * Gitea API. + * + * This documentation describes the Gitea API. + * + * The version of the OpenAPI document: 1.17.3 + * + * Generated by: https://openapi-generator.tech + */ + +/// ApiError : APIError is an api error with a message + + + +#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)] +pub struct ApiError { + #[serde(rename = "message", skip_serializing_if = "Option::is_none")] + pub message: Option, + #[serde(rename = "url", skip_serializing_if = "Option::is_none")] + pub url: Option, +} + +impl ApiError { + /// APIError is an api error with a message + pub fn new() -> ApiError { + ApiError { + message: None, + url: None, + } + } +} + + diff --git a/crates/gitea_raw_client/src/models/attachment.rs b/crates/gitea_raw_client/src/models/attachment.rs new file mode 100644 index 0000000..8ecfbf3 --- /dev/null +++ b/crates/gitea_raw_client/src/models/attachment.rs @@ -0,0 +1,48 @@ +/* + * Gitea API. + * + * This documentation describes the Gitea API. + * + * The version of the OpenAPI document: 1.17.3 + * + * Generated by: https://openapi-generator.tech + */ + +/// Attachment : Attachment a generic attachment + + + +#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)] +pub struct Attachment { + #[serde(rename = "browser_download_url", skip_serializing_if = "Option::is_none")] + pub browser_download_url: Option, + #[serde(rename = "created_at", skip_serializing_if = "Option::is_none")] + pub created_at: Option, + #[serde(rename = "download_count", skip_serializing_if = "Option::is_none")] + pub download_count: Option, + #[serde(rename = "id", skip_serializing_if = "Option::is_none")] + pub id: Option, + #[serde(rename = "name", skip_serializing_if = "Option::is_none")] + pub name: Option, + #[serde(rename = "size", skip_serializing_if = "Option::is_none")] + pub size: Option, + #[serde(rename = "uuid", skip_serializing_if = "Option::is_none")] + pub uuid: Option, +} + +impl Attachment { + /// Attachment a generic attachment + pub fn new() -> Attachment { + Attachment { + browser_download_url: None, + created_at: None, + download_count: None, + id: None, + name: None, + size: None, + uuid: None, + } + } +} + + diff --git a/crates/gitea_raw_client/src/models/branch.rs b/crates/gitea_raw_client/src/models/branch.rs new file mode 100644 index 0000000..da8f52a --- /dev/null +++ b/crates/gitea_raw_client/src/models/branch.rs @@ -0,0 +1,54 @@ +/* + * Gitea API. + * + * This documentation describes the Gitea API. + * + * The version of the OpenAPI document: 1.17.3 + * + * Generated by: https://openapi-generator.tech + */ + +/// Branch : Branch represents a repository branch + + + +#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)] +pub struct Branch { + #[serde(rename = "commit", skip_serializing_if = "Option::is_none")] + pub commit: Option>, + #[serde(rename = "effective_branch_protection_name", skip_serializing_if = "Option::is_none")] + pub effective_branch_protection_name: Option, + #[serde(rename = "enable_status_check", skip_serializing_if = "Option::is_none")] + pub enable_status_check: Option, + #[serde(rename = "name", skip_serializing_if = "Option::is_none")] + pub name: Option, + #[serde(rename = "protected", skip_serializing_if = "Option::is_none")] + pub protected: Option, + #[serde(rename = "required_approvals", skip_serializing_if = "Option::is_none")] + pub required_approvals: Option, + #[serde(rename = "status_check_contexts", skip_serializing_if = "Option::is_none")] + pub status_check_contexts: Option>, + #[serde(rename = "user_can_merge", skip_serializing_if = "Option::is_none")] + pub user_can_merge: Option, + #[serde(rename = "user_can_push", skip_serializing_if = "Option::is_none")] + pub user_can_push: Option, +} + +impl Branch { + /// Branch represents a repository branch + pub fn new() -> Branch { + Branch { + commit: None, + effective_branch_protection_name: None, + enable_status_check: None, + name: None, + protected: None, + required_approvals: None, + status_check_contexts: None, + user_can_merge: None, + user_can_push: None, + } + } +} + + diff --git a/crates/gitea_raw_client/src/models/branch_protection.rs b/crates/gitea_raw_client/src/models/branch_protection.rs new file mode 100644 index 0000000..129970f --- /dev/null +++ b/crates/gitea_raw_client/src/models/branch_protection.rs @@ -0,0 +1,99 @@ +/* + * Gitea API. + * + * This documentation describes the Gitea API. + * + * The version of the OpenAPI document: 1.17.3 + * + * Generated by: https://openapi-generator.tech + */ + +/// BranchProtection : BranchProtection represents a branch protection for a repository + + + +#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)] +pub struct BranchProtection { + #[serde(rename = "approvals_whitelist_teams", skip_serializing_if = "Option::is_none")] + pub approvals_whitelist_teams: Option>, + #[serde(rename = "approvals_whitelist_username", skip_serializing_if = "Option::is_none")] + pub approvals_whitelist_username: Option>, + #[serde(rename = "block_on_official_review_requests", skip_serializing_if = "Option::is_none")] + pub block_on_official_review_requests: Option, + #[serde(rename = "block_on_outdated_branch", skip_serializing_if = "Option::is_none")] + pub block_on_outdated_branch: Option, + #[serde(rename = "block_on_rejected_reviews", skip_serializing_if = "Option::is_none")] + pub block_on_rejected_reviews: Option, + #[serde(rename = "branch_name", skip_serializing_if = "Option::is_none")] + pub branch_name: Option, + #[serde(rename = "created_at", skip_serializing_if = "Option::is_none")] + pub created_at: Option, + #[serde(rename = "dismiss_stale_approvals", skip_serializing_if = "Option::is_none")] + pub dismiss_stale_approvals: Option, + #[serde(rename = "enable_approvals_whitelist", skip_serializing_if = "Option::is_none")] + pub enable_approvals_whitelist: Option, + #[serde(rename = "enable_merge_whitelist", skip_serializing_if = "Option::is_none")] + pub enable_merge_whitelist: Option, + #[serde(rename = "enable_push", skip_serializing_if = "Option::is_none")] + pub enable_push: Option, + #[serde(rename = "enable_push_whitelist", skip_serializing_if = "Option::is_none")] + pub enable_push_whitelist: Option, + #[serde(rename = "enable_status_check", skip_serializing_if = "Option::is_none")] + pub enable_status_check: Option, + #[serde(rename = "merge_whitelist_teams", skip_serializing_if = "Option::is_none")] + pub merge_whitelist_teams: Option>, + #[serde(rename = "merge_whitelist_usernames", skip_serializing_if = "Option::is_none")] + pub merge_whitelist_usernames: Option>, + #[serde(rename = "protected_file_patterns", skip_serializing_if = "Option::is_none")] + pub protected_file_patterns: Option, + #[serde(rename = "push_whitelist_deploy_keys", skip_serializing_if = "Option::is_none")] + pub push_whitelist_deploy_keys: Option, + #[serde(rename = "push_whitelist_teams", skip_serializing_if = "Option::is_none")] + pub push_whitelist_teams: Option>, + #[serde(rename = "push_whitelist_usernames", skip_serializing_if = "Option::is_none")] + pub push_whitelist_usernames: Option>, + #[serde(rename = "require_signed_commits", skip_serializing_if = "Option::is_none")] + pub require_signed_commits: Option, + #[serde(rename = "required_approvals", skip_serializing_if = "Option::is_none")] + pub required_approvals: Option, + #[serde(rename = "status_check_contexts", skip_serializing_if = "Option::is_none")] + pub status_check_contexts: Option>, + #[serde(rename = "unprotected_file_patterns", skip_serializing_if = "Option::is_none")] + pub unprotected_file_patterns: Option, + #[serde(rename = "updated_at", skip_serializing_if = "Option::is_none")] + pub updated_at: Option, +} + +impl BranchProtection { + /// BranchProtection represents a branch protection for a repository + pub fn new() -> BranchProtection { + BranchProtection { + approvals_whitelist_teams: None, + approvals_whitelist_username: None, + block_on_official_review_requests: None, + block_on_outdated_branch: None, + block_on_rejected_reviews: None, + branch_name: None, + created_at: None, + dismiss_stale_approvals: None, + enable_approvals_whitelist: None, + enable_merge_whitelist: None, + enable_push: None, + enable_push_whitelist: None, + enable_status_check: None, + merge_whitelist_teams: None, + merge_whitelist_usernames: None, + protected_file_patterns: None, + push_whitelist_deploy_keys: None, + push_whitelist_teams: None, + push_whitelist_usernames: None, + require_signed_commits: None, + required_approvals: None, + status_check_contexts: None, + unprotected_file_patterns: None, + updated_at: None, + } + } +} + + diff --git a/crates/gitea_raw_client/src/models/combined_status.rs b/crates/gitea_raw_client/src/models/combined_status.rs new file mode 100644 index 0000000..c01ba6c --- /dev/null +++ b/crates/gitea_raw_client/src/models/combined_status.rs @@ -0,0 +1,49 @@ +/* + * Gitea API. + * + * This documentation describes the Gitea API. + * + * The version of the OpenAPI document: 1.17.3 + * + * Generated by: https://openapi-generator.tech + */ + +/// CombinedStatus : CombinedStatus holds the combined state of several statuses for a single commit + + + +#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)] +pub struct CombinedStatus { + #[serde(rename = "commit_url", skip_serializing_if = "Option::is_none")] + pub commit_url: Option, + #[serde(rename = "repository", skip_serializing_if = "Option::is_none")] + pub repository: Option>, + #[serde(rename = "sha", skip_serializing_if = "Option::is_none")] + pub sha: Option, + /// CommitStatusState holds the state of a CommitStatus It can be \"pending\", \"success\", \"error\", \"failure\", and \"warning\" + #[serde(rename = "state", skip_serializing_if = "Option::is_none")] + pub state: Option, + #[serde(rename = "statuses", skip_serializing_if = "Option::is_none")] + pub statuses: Option>, + #[serde(rename = "total_count", skip_serializing_if = "Option::is_none")] + pub total_count: Option, + #[serde(rename = "url", skip_serializing_if = "Option::is_none")] + pub url: Option, +} + +impl CombinedStatus { + /// CombinedStatus holds the combined state of several statuses for a single commit + pub fn new() -> CombinedStatus { + CombinedStatus { + commit_url: None, + repository: None, + sha: None, + state: None, + statuses: None, + total_count: None, + url: None, + } + } +} + + diff --git a/crates/gitea_raw_client/src/models/comment.rs b/crates/gitea_raw_client/src/models/comment.rs new file mode 100644 index 0000000..21ac9b5 --- /dev/null +++ b/crates/gitea_raw_client/src/models/comment.rs @@ -0,0 +1,57 @@ +/* + * Gitea API. + * + * This documentation describes the Gitea API. + * + * The version of the OpenAPI document: 1.17.3 + * + * Generated by: https://openapi-generator.tech + */ + +/// Comment : Comment represents a comment on a commit or issue + + + +#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)] +pub struct Comment { + #[serde(rename = "body", skip_serializing_if = "Option::is_none")] + pub body: Option, + #[serde(rename = "created_at", skip_serializing_if = "Option::is_none")] + pub created_at: Option, + #[serde(rename = "html_url", skip_serializing_if = "Option::is_none")] + pub html_url: Option, + #[serde(rename = "id", skip_serializing_if = "Option::is_none")] + pub id: Option, + #[serde(rename = "issue_url", skip_serializing_if = "Option::is_none")] + pub issue_url: Option, + #[serde(rename = "original_author", skip_serializing_if = "Option::is_none")] + pub original_author: Option, + #[serde(rename = "original_author_id", skip_serializing_if = "Option::is_none")] + pub original_author_id: Option, + #[serde(rename = "pull_request_url", skip_serializing_if = "Option::is_none")] + pub pull_request_url: Option, + #[serde(rename = "updated_at", skip_serializing_if = "Option::is_none")] + pub updated_at: Option, + #[serde(rename = "user", skip_serializing_if = "Option::is_none")] + pub user: Option>, +} + +impl Comment { + /// Comment represents a comment on a commit or issue + pub fn new() -> Comment { + Comment { + body: None, + created_at: None, + html_url: None, + id: None, + issue_url: None, + original_author: None, + original_author_id: None, + pull_request_url: None, + updated_at: None, + user: None, + } + } +} + + diff --git a/crates/gitea_raw_client/src/models/commit.rs b/crates/gitea_raw_client/src/models/commit.rs new file mode 100644 index 0000000..3037fc6 --- /dev/null +++ b/crates/gitea_raw_client/src/models/commit.rs @@ -0,0 +1,55 @@ +/* + * Gitea API. + * + * This documentation describes the Gitea API. + * + * The version of the OpenAPI document: 1.17.3 + * + * Generated by: https://openapi-generator.tech + */ + + + + +#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)] +pub struct Commit { + #[serde(rename = "author", skip_serializing_if = "Option::is_none")] + pub author: Option>, + #[serde(rename = "commit", skip_serializing_if = "Option::is_none")] + pub commit: Option>, + #[serde(rename = "committer", skip_serializing_if = "Option::is_none")] + pub committer: Option>, + #[serde(rename = "created", skip_serializing_if = "Option::is_none")] + pub created: Option, + #[serde(rename = "files", skip_serializing_if = "Option::is_none")] + pub files: Option>, + #[serde(rename = "html_url", skip_serializing_if = "Option::is_none")] + pub html_url: Option, + #[serde(rename = "parents", skip_serializing_if = "Option::is_none")] + pub parents: Option>, + #[serde(rename = "sha", skip_serializing_if = "Option::is_none")] + pub sha: Option, + #[serde(rename = "stats", skip_serializing_if = "Option::is_none")] + pub stats: Option>, + #[serde(rename = "url", skip_serializing_if = "Option::is_none")] + pub url: Option, +} + +impl Commit { + pub fn new() -> Commit { + Commit { + author: None, + commit: None, + committer: None, + created: None, + files: None, + html_url: None, + parents: None, + sha: None, + stats: None, + url: None, + } + } +} + + diff --git a/crates/gitea_raw_client/src/models/commit_affected_files.rs b/crates/gitea_raw_client/src/models/commit_affected_files.rs new file mode 100644 index 0000000..aa196fc --- /dev/null +++ b/crates/gitea_raw_client/src/models/commit_affected_files.rs @@ -0,0 +1,30 @@ +/* + * Gitea API. + * + * This documentation describes the Gitea API. + * + * The version of the OpenAPI document: 1.17.3 + * + * Generated by: https://openapi-generator.tech + */ + +/// CommitAffectedFiles : CommitAffectedFiles store information about files affected by the commit + + + +#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)] +pub struct CommitAffectedFiles { + #[serde(rename = "filename", skip_serializing_if = "Option::is_none")] + pub filename: Option, +} + +impl CommitAffectedFiles { + /// CommitAffectedFiles store information about files affected by the commit + pub fn new() -> CommitAffectedFiles { + CommitAffectedFiles { + filename: None, + } + } +} + + diff --git a/crates/gitea_raw_client/src/models/commit_date_options.rs b/crates/gitea_raw_client/src/models/commit_date_options.rs new file mode 100644 index 0000000..2046eed --- /dev/null +++ b/crates/gitea_raw_client/src/models/commit_date_options.rs @@ -0,0 +1,33 @@ +/* + * Gitea API. + * + * This documentation describes the Gitea API. + * + * The version of the OpenAPI document: 1.17.3 + * + * Generated by: https://openapi-generator.tech + */ + +/// CommitDateOptions : CommitDateOptions store dates for GIT_AUTHOR_DATE and GIT_COMMITTER_DATE + + + +#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)] +pub struct CommitDateOptions { + #[serde(rename = "author", skip_serializing_if = "Option::is_none")] + pub author: Option, + #[serde(rename = "committer", skip_serializing_if = "Option::is_none")] + pub committer: Option, +} + +impl CommitDateOptions { + /// CommitDateOptions store dates for GIT_AUTHOR_DATE and GIT_COMMITTER_DATE + pub fn new() -> CommitDateOptions { + CommitDateOptions { + author: None, + committer: None, + } + } +} + + diff --git a/crates/gitea_raw_client/src/models/commit_meta.rs b/crates/gitea_raw_client/src/models/commit_meta.rs new file mode 100644 index 0000000..f906138 --- /dev/null +++ b/crates/gitea_raw_client/src/models/commit_meta.rs @@ -0,0 +1,34 @@ +/* + * Gitea API. + * + * This documentation describes the Gitea API. + * + * The version of the OpenAPI document: 1.17.3 + * + * Generated by: https://openapi-generator.tech + */ + + + + +#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)] +pub struct CommitMeta { + #[serde(rename = "created", skip_serializing_if = "Option::is_none")] + pub created: Option, + #[serde(rename = "sha", skip_serializing_if = "Option::is_none")] + pub sha: Option, + #[serde(rename = "url", skip_serializing_if = "Option::is_none")] + pub url: Option, +} + +impl CommitMeta { + pub fn new() -> CommitMeta { + CommitMeta { + created: None, + sha: None, + url: None, + } + } +} + + diff --git a/crates/gitea_raw_client/src/models/commit_stats.rs b/crates/gitea_raw_client/src/models/commit_stats.rs new file mode 100644 index 0000000..1c91b1a --- /dev/null +++ b/crates/gitea_raw_client/src/models/commit_stats.rs @@ -0,0 +1,36 @@ +/* + * Gitea API. + * + * This documentation describes the Gitea API. + * + * The version of the OpenAPI document: 1.17.3 + * + * Generated by: https://openapi-generator.tech + */ + +/// CommitStats : CommitStats is statistics for a RepoCommit + + + +#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)] +pub struct CommitStats { + #[serde(rename = "additions", skip_serializing_if = "Option::is_none")] + pub additions: Option, + #[serde(rename = "deletions", skip_serializing_if = "Option::is_none")] + pub deletions: Option, + #[serde(rename = "total", skip_serializing_if = "Option::is_none")] + pub total: Option, +} + +impl CommitStats { + /// CommitStats is statistics for a RepoCommit + pub fn new() -> CommitStats { + CommitStats { + additions: None, + deletions: None, + total: None, + } + } +} + + diff --git a/crates/gitea_raw_client/src/models/commit_status.rs b/crates/gitea_raw_client/src/models/commit_status.rs new file mode 100644 index 0000000..86e2daa --- /dev/null +++ b/crates/gitea_raw_client/src/models/commit_status.rs @@ -0,0 +1,55 @@ +/* + * Gitea API. + * + * This documentation describes the Gitea API. + * + * The version of the OpenAPI document: 1.17.3 + * + * Generated by: https://openapi-generator.tech + */ + +/// CommitStatus : CommitStatus holds a single status of a single Commit + + + +#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)] +pub struct CommitStatus { + #[serde(rename = "context", skip_serializing_if = "Option::is_none")] + pub context: Option, + #[serde(rename = "created_at", skip_serializing_if = "Option::is_none")] + pub created_at: Option, + #[serde(rename = "creator", skip_serializing_if = "Option::is_none")] + pub creator: Option>, + #[serde(rename = "description", skip_serializing_if = "Option::is_none")] + pub description: Option, + #[serde(rename = "id", skip_serializing_if = "Option::is_none")] + pub id: Option, + /// CommitStatusState holds the state of a CommitStatus It can be \"pending\", \"success\", \"error\", \"failure\", and \"warning\" + #[serde(rename = "status", skip_serializing_if = "Option::is_none")] + pub status: Option, + #[serde(rename = "target_url", skip_serializing_if = "Option::is_none")] + pub target_url: Option, + #[serde(rename = "updated_at", skip_serializing_if = "Option::is_none")] + pub updated_at: Option, + #[serde(rename = "url", skip_serializing_if = "Option::is_none")] + pub url: Option, +} + +impl CommitStatus { + /// CommitStatus holds a single status of a single Commit + pub fn new() -> CommitStatus { + CommitStatus { + context: None, + created_at: None, + creator: None, + description: None, + id: None, + status: None, + target_url: None, + updated_at: None, + url: None, + } + } +} + + diff --git a/crates/gitea_raw_client/src/models/commit_user.rs b/crates/gitea_raw_client/src/models/commit_user.rs new file mode 100644 index 0000000..8fb584e --- /dev/null +++ b/crates/gitea_raw_client/src/models/commit_user.rs @@ -0,0 +1,34 @@ +/* + * Gitea API. + * + * This documentation describes the Gitea API. + * + * The version of the OpenAPI document: 1.17.3 + * + * Generated by: https://openapi-generator.tech + */ + + + + +#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)] +pub struct CommitUser { + #[serde(rename = "date", skip_serializing_if = "Option::is_none")] + pub date: Option, + #[serde(rename = "email", skip_serializing_if = "Option::is_none")] + pub email: Option, + #[serde(rename = "name", skip_serializing_if = "Option::is_none")] + pub name: Option, +} + +impl CommitUser { + pub fn new() -> CommitUser { + CommitUser { + date: None, + email: None, + name: None, + } + } +} + + diff --git a/crates/gitea_raw_client/src/models/contents_response.rs b/crates/gitea_raw_client/src/models/contents_response.rs new file mode 100644 index 0000000..4022f53 --- /dev/null +++ b/crates/gitea_raw_client/src/models/contents_response.rs @@ -0,0 +1,74 @@ +/* + * Gitea API. + * + * This documentation describes the Gitea API. + * + * The version of the OpenAPI document: 1.17.3 + * + * Generated by: https://openapi-generator.tech + */ + +/// ContentsResponse : ContentsResponse contains information about a repo's entry's (dir, file, symlink, submodule) metadata and content + + + +#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)] +pub struct ContentsResponse { + #[serde(rename = "_links", skip_serializing_if = "Option::is_none")] + pub _links: Option>, + /// `content` is populated when `type` is `file`, otherwise null + #[serde(rename = "content", skip_serializing_if = "Option::is_none")] + pub content: Option, + #[serde(rename = "download_url", skip_serializing_if = "Option::is_none")] + pub download_url: Option, + /// `encoding` is populated when `type` is `file`, otherwise null + #[serde(rename = "encoding", skip_serializing_if = "Option::is_none")] + pub encoding: Option, + #[serde(rename = "git_url", skip_serializing_if = "Option::is_none")] + pub git_url: Option, + #[serde(rename = "html_url", skip_serializing_if = "Option::is_none")] + pub html_url: Option, + #[serde(rename = "name", skip_serializing_if = "Option::is_none")] + pub name: Option, + #[serde(rename = "path", skip_serializing_if = "Option::is_none")] + pub path: Option, + #[serde(rename = "sha", skip_serializing_if = "Option::is_none")] + pub sha: Option, + #[serde(rename = "size", skip_serializing_if = "Option::is_none")] + pub size: Option, + /// `submodule_git_url` is populated when `type` is `submodule`, otherwise null + #[serde(rename = "submodule_git_url", skip_serializing_if = "Option::is_none")] + pub submodule_git_url: Option, + /// `target` is populated when `type` is `symlink`, otherwise null + #[serde(rename = "target", skip_serializing_if = "Option::is_none")] + pub target: Option, + /// `type` will be `file`, `dir`, `symlink`, or `submodule` + #[serde(rename = "type", skip_serializing_if = "Option::is_none")] + pub r#type: Option, + #[serde(rename = "url", skip_serializing_if = "Option::is_none")] + pub url: Option, +} + +impl ContentsResponse { + /// ContentsResponse contains information about a repo's entry's (dir, file, symlink, submodule) metadata and content + pub fn new() -> ContentsResponse { + ContentsResponse { + _links: None, + content: None, + download_url: None, + encoding: None, + git_url: None, + html_url: None, + name: None, + path: None, + sha: None, + size: None, + submodule_git_url: None, + target: None, + r#type: None, + url: None, + } + } +} + + diff --git a/crates/gitea_raw_client/src/models/create_access_token_option.rs b/crates/gitea_raw_client/src/models/create_access_token_option.rs new file mode 100644 index 0000000..861050d --- /dev/null +++ b/crates/gitea_raw_client/src/models/create_access_token_option.rs @@ -0,0 +1,30 @@ +/* + * Gitea API. + * + * This documentation describes the Gitea API. + * + * The version of the OpenAPI document: 1.17.3 + * + * Generated by: https://openapi-generator.tech + */ + +/// CreateAccessTokenOption : CreateAccessTokenOption options when create access token + + + +#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)] +pub struct CreateAccessTokenOption { + #[serde(rename = "name", skip_serializing_if = "Option::is_none")] + pub name: Option, +} + +impl CreateAccessTokenOption { + /// CreateAccessTokenOption options when create access token + pub fn new() -> CreateAccessTokenOption { + CreateAccessTokenOption { + name: None, + } + } +} + + diff --git a/crates/gitea_raw_client/src/models/create_branch_protection_option.rs b/crates/gitea_raw_client/src/models/create_branch_protection_option.rs new file mode 100644 index 0000000..6726c69 --- /dev/null +++ b/crates/gitea_raw_client/src/models/create_branch_protection_option.rs @@ -0,0 +1,93 @@ +/* + * Gitea API. + * + * This documentation describes the Gitea API. + * + * The version of the OpenAPI document: 1.17.3 + * + * Generated by: https://openapi-generator.tech + */ + +/// CreateBranchProtectionOption : CreateBranchProtectionOption options for creating a branch protection + + + +#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)] +pub struct CreateBranchProtectionOption { + #[serde(rename = "approvals_whitelist_teams", skip_serializing_if = "Option::is_none")] + pub approvals_whitelist_teams: Option>, + #[serde(rename = "approvals_whitelist_username", skip_serializing_if = "Option::is_none")] + pub approvals_whitelist_username: Option>, + #[serde(rename = "block_on_official_review_requests", skip_serializing_if = "Option::is_none")] + pub block_on_official_review_requests: Option, + #[serde(rename = "block_on_outdated_branch", skip_serializing_if = "Option::is_none")] + pub block_on_outdated_branch: Option, + #[serde(rename = "block_on_rejected_reviews", skip_serializing_if = "Option::is_none")] + pub block_on_rejected_reviews: Option, + #[serde(rename = "branch_name", skip_serializing_if = "Option::is_none")] + pub branch_name: Option, + #[serde(rename = "dismiss_stale_approvals", skip_serializing_if = "Option::is_none")] + pub dismiss_stale_approvals: Option, + #[serde(rename = "enable_approvals_whitelist", skip_serializing_if = "Option::is_none")] + pub enable_approvals_whitelist: Option, + #[serde(rename = "enable_merge_whitelist", skip_serializing_if = "Option::is_none")] + pub enable_merge_whitelist: Option, + #[serde(rename = "enable_push", skip_serializing_if = "Option::is_none")] + pub enable_push: Option, + #[serde(rename = "enable_push_whitelist", skip_serializing_if = "Option::is_none")] + pub enable_push_whitelist: Option, + #[serde(rename = "enable_status_check", skip_serializing_if = "Option::is_none")] + pub enable_status_check: Option, + #[serde(rename = "merge_whitelist_teams", skip_serializing_if = "Option::is_none")] + pub merge_whitelist_teams: Option>, + #[serde(rename = "merge_whitelist_usernames", skip_serializing_if = "Option::is_none")] + pub merge_whitelist_usernames: Option>, + #[serde(rename = "protected_file_patterns", skip_serializing_if = "Option::is_none")] + pub protected_file_patterns: Option, + #[serde(rename = "push_whitelist_deploy_keys", skip_serializing_if = "Option::is_none")] + pub push_whitelist_deploy_keys: Option, + #[serde(rename = "push_whitelist_teams", skip_serializing_if = "Option::is_none")] + pub push_whitelist_teams: Option>, + #[serde(rename = "push_whitelist_usernames", skip_serializing_if = "Option::is_none")] + pub push_whitelist_usernames: Option>, + #[serde(rename = "require_signed_commits", skip_serializing_if = "Option::is_none")] + pub require_signed_commits: Option, + #[serde(rename = "required_approvals", skip_serializing_if = "Option::is_none")] + pub required_approvals: Option, + #[serde(rename = "status_check_contexts", skip_serializing_if = "Option::is_none")] + pub status_check_contexts: Option>, + #[serde(rename = "unprotected_file_patterns", skip_serializing_if = "Option::is_none")] + pub unprotected_file_patterns: Option, +} + +impl CreateBranchProtectionOption { + /// CreateBranchProtectionOption options for creating a branch protection + pub fn new() -> CreateBranchProtectionOption { + CreateBranchProtectionOption { + approvals_whitelist_teams: None, + approvals_whitelist_username: None, + block_on_official_review_requests: None, + block_on_outdated_branch: None, + block_on_rejected_reviews: None, + branch_name: None, + dismiss_stale_approvals: None, + enable_approvals_whitelist: None, + enable_merge_whitelist: None, + enable_push: None, + enable_push_whitelist: None, + enable_status_check: None, + merge_whitelist_teams: None, + merge_whitelist_usernames: None, + protected_file_patterns: None, + push_whitelist_deploy_keys: None, + push_whitelist_teams: None, + push_whitelist_usernames: None, + require_signed_commits: None, + required_approvals: None, + status_check_contexts: None, + unprotected_file_patterns: None, + } + } +} + + diff --git a/crates/gitea_raw_client/src/models/create_branch_repo_option.rs b/crates/gitea_raw_client/src/models/create_branch_repo_option.rs new file mode 100644 index 0000000..87920a8 --- /dev/null +++ b/crates/gitea_raw_client/src/models/create_branch_repo_option.rs @@ -0,0 +1,35 @@ +/* + * Gitea API. + * + * This documentation describes the Gitea API. + * + * The version of the OpenAPI document: 1.17.3 + * + * Generated by: https://openapi-generator.tech + */ + +/// CreateBranchRepoOption : CreateBranchRepoOption options when creating a branch in a repository + + + +#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)] +pub struct CreateBranchRepoOption { + /// Name of the branch to create + #[serde(rename = "new_branch_name")] + pub new_branch_name: String, + /// Name of the old branch to create from + #[serde(rename = "old_branch_name", skip_serializing_if = "Option::is_none")] + pub old_branch_name: Option, +} + +impl CreateBranchRepoOption { + /// CreateBranchRepoOption options when creating a branch in a repository + pub fn new(new_branch_name: String) -> CreateBranchRepoOption { + CreateBranchRepoOption { + new_branch_name, + old_branch_name: None, + } + } +} + + diff --git a/crates/gitea_raw_client/src/models/create_email_option.rs b/crates/gitea_raw_client/src/models/create_email_option.rs new file mode 100644 index 0000000..df6254e --- /dev/null +++ b/crates/gitea_raw_client/src/models/create_email_option.rs @@ -0,0 +1,31 @@ +/* + * Gitea API. + * + * This documentation describes the Gitea API. + * + * The version of the OpenAPI document: 1.17.3 + * + * Generated by: https://openapi-generator.tech + */ + +/// CreateEmailOption : CreateEmailOption options when creating email addresses + + + +#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)] +pub struct CreateEmailOption { + /// email addresses to add + #[serde(rename = "emails", skip_serializing_if = "Option::is_none")] + pub emails: Option>, +} + +impl CreateEmailOption { + /// CreateEmailOption options when creating email addresses + pub fn new() -> CreateEmailOption { + CreateEmailOption { + emails: None, + } + } +} + + diff --git a/crates/gitea_raw_client/src/models/create_file_options.rs b/crates/gitea_raw_client/src/models/create_file_options.rs new file mode 100644 index 0000000..9f4992f --- /dev/null +++ b/crates/gitea_raw_client/src/models/create_file_options.rs @@ -0,0 +1,56 @@ +/* + * Gitea API. + * + * This documentation describes the Gitea API. + * + * The version of the OpenAPI document: 1.17.3 + * + * Generated by: https://openapi-generator.tech + */ + +/// CreateFileOptions : CreateFileOptions options for creating files Note: `author` and `committer` are optional (if only one is given, it will be used for the other, otherwise the authenticated user will be used) + + + +#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)] +pub struct CreateFileOptions { + #[serde(rename = "author", skip_serializing_if = "Option::is_none")] + pub author: Option>, + /// branch (optional) to base this file from. if not given, the default branch is used + #[serde(rename = "branch", skip_serializing_if = "Option::is_none")] + pub branch: Option, + #[serde(rename = "committer", skip_serializing_if = "Option::is_none")] + pub committer: Option>, + /// content must be base64 encoded + #[serde(rename = "content")] + pub content: String, + #[serde(rename = "dates", skip_serializing_if = "Option::is_none")] + pub dates: Option>, + /// message (optional) for the commit of this file. if not supplied, a default message will be used + #[serde(rename = "message", skip_serializing_if = "Option::is_none")] + pub message: Option, + /// new_branch (optional) will make a new branch from `branch` before creating the file + #[serde(rename = "new_branch", skip_serializing_if = "Option::is_none")] + pub new_branch: Option, + /// Add a Signed-off-by trailer by the committer at the end of the commit log message. + #[serde(rename = "signoff", skip_serializing_if = "Option::is_none")] + pub signoff: Option, +} + +impl CreateFileOptions { + /// CreateFileOptions options for creating files Note: `author` and `committer` are optional (if only one is given, it will be used for the other, otherwise the authenticated user will be used) + pub fn new(content: String) -> CreateFileOptions { + CreateFileOptions { + author: None, + branch: None, + committer: None, + content, + dates: None, + message: None, + new_branch: None, + signoff: None, + } + } +} + + diff --git a/crates/gitea_raw_client/src/models/create_fork_option.rs b/crates/gitea_raw_client/src/models/create_fork_option.rs new file mode 100644 index 0000000..95260e9 --- /dev/null +++ b/crates/gitea_raw_client/src/models/create_fork_option.rs @@ -0,0 +1,35 @@ +/* + * Gitea API. + * + * This documentation describes the Gitea API. + * + * The version of the OpenAPI document: 1.17.3 + * + * Generated by: https://openapi-generator.tech + */ + +/// CreateForkOption : CreateForkOption options for creating a fork + + + +#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)] +pub struct CreateForkOption { + /// name of the forked repository + #[serde(rename = "name", skip_serializing_if = "Option::is_none")] + pub name: Option, + /// organization name, if forking into an organization + #[serde(rename = "organization", skip_serializing_if = "Option::is_none")] + pub organization: Option, +} + +impl CreateForkOption { + /// CreateForkOption options for creating a fork + pub fn new() -> CreateForkOption { + CreateForkOption { + name: None, + organization: None, + } + } +} + + diff --git a/crates/gitea_raw_client/src/models/create_gpg_key_option.rs b/crates/gitea_raw_client/src/models/create_gpg_key_option.rs new file mode 100644 index 0000000..2581b4f --- /dev/null +++ b/crates/gitea_raw_client/src/models/create_gpg_key_option.rs @@ -0,0 +1,34 @@ +/* + * Gitea API. + * + * This documentation describes the Gitea API. + * + * The version of the OpenAPI document: 1.17.3 + * + * Generated by: https://openapi-generator.tech + */ + +/// CreateGpgKeyOption : CreateGPGKeyOption options create user GPG key + + + +#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)] +pub struct CreateGpgKeyOption { + /// An armored GPG key to add + #[serde(rename = "armored_public_key")] + pub armored_public_key: String, + #[serde(rename = "armored_signature", skip_serializing_if = "Option::is_none")] + pub armored_signature: Option, +} + +impl CreateGpgKeyOption { + /// CreateGPGKeyOption options create user GPG key + pub fn new(armored_public_key: String) -> CreateGpgKeyOption { + CreateGpgKeyOption { + armored_public_key, + armored_signature: None, + } + } +} + + diff --git a/crates/gitea_raw_client/src/models/create_hook_option.rs b/crates/gitea_raw_client/src/models/create_hook_option.rs new file mode 100644 index 0000000..649888c --- /dev/null +++ b/crates/gitea_raw_client/src/models/create_hook_option.rs @@ -0,0 +1,73 @@ +/* + * Gitea API. + * + * This documentation describes the Gitea API. + * + * The version of the OpenAPI document: 1.17.3 + * + * Generated by: https://openapi-generator.tech + */ + +/// CreateHookOption : CreateHookOption options when create a hook + + + +#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)] +pub struct CreateHookOption { + #[serde(rename = "active", skip_serializing_if = "Option::is_none")] + pub active: Option, + #[serde(rename = "branch_filter", skip_serializing_if = "Option::is_none")] + pub branch_filter: Option, + /// CreateHookOptionConfig has all config options in it required are \"content_type\" and \"url\" Required + #[serde(rename = "config")] + pub config: ::std::collections::HashMap, + #[serde(rename = "events", skip_serializing_if = "Option::is_none")] + pub events: Option>, + #[serde(rename = "type")] + pub r#type: RHashType, +} + +impl CreateHookOption { + /// CreateHookOption options when create a hook + pub fn new(config: ::std::collections::HashMap, r#type: RHashType) -> CreateHookOption { + CreateHookOption { + active: None, + branch_filter: None, + config, + events: None, + r#type, + } + } +} + +/// +#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)] +pub enum RHashType { + #[serde(rename = "dingtalk")] + Dingtalk, + #[serde(rename = "discord")] + Discord, + #[serde(rename = "gitea")] + Gitea, + #[serde(rename = "gogs")] + Gogs, + #[serde(rename = "msteams")] + Msteams, + #[serde(rename = "slack")] + Slack, + #[serde(rename = "telegram")] + Telegram, + #[serde(rename = "feishu")] + Feishu, + #[serde(rename = "wechatwork")] + Wechatwork, + #[serde(rename = "packagist")] + Packagist, +} + +impl Default for RHashType { + fn default() -> RHashType { + Self::Dingtalk + } +} + diff --git a/crates/gitea_raw_client/src/models/create_issue_comment_option.rs b/crates/gitea_raw_client/src/models/create_issue_comment_option.rs new file mode 100644 index 0000000..03b1210 --- /dev/null +++ b/crates/gitea_raw_client/src/models/create_issue_comment_option.rs @@ -0,0 +1,30 @@ +/* + * Gitea API. + * + * This documentation describes the Gitea API. + * + * The version of the OpenAPI document: 1.17.3 + * + * Generated by: https://openapi-generator.tech + */ + +/// CreateIssueCommentOption : CreateIssueCommentOption options for creating a comment on an issue + + + +#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)] +pub struct CreateIssueCommentOption { + #[serde(rename = "body")] + pub body: String, +} + +impl CreateIssueCommentOption { + /// CreateIssueCommentOption options for creating a comment on an issue + pub fn new(body: String) -> CreateIssueCommentOption { + CreateIssueCommentOption { + body, + } + } +} + + diff --git a/crates/gitea_raw_client/src/models/create_issue_option.rs b/crates/gitea_raw_client/src/models/create_issue_option.rs new file mode 100644 index 0000000..8d55aa7 --- /dev/null +++ b/crates/gitea_raw_client/src/models/create_issue_option.rs @@ -0,0 +1,57 @@ +/* + * Gitea API. + * + * This documentation describes the Gitea API. + * + * The version of the OpenAPI document: 1.17.3 + * + * Generated by: https://openapi-generator.tech + */ + +/// CreateIssueOption : CreateIssueOption options to create one issue + + + +#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)] +pub struct CreateIssueOption { + /// deprecated + #[serde(rename = "assignee", skip_serializing_if = "Option::is_none")] + pub assignee: Option, + #[serde(rename = "assignees", skip_serializing_if = "Option::is_none")] + pub assignees: Option>, + #[serde(rename = "body", skip_serializing_if = "Option::is_none")] + pub body: Option, + #[serde(rename = "closed", skip_serializing_if = "Option::is_none")] + pub closed: Option, + #[serde(rename = "due_date", skip_serializing_if = "Option::is_none")] + pub due_date: Option, + /// list of label ids + #[serde(rename = "labels", skip_serializing_if = "Option::is_none")] + pub labels: Option>, + /// milestone id + #[serde(rename = "milestone", skip_serializing_if = "Option::is_none")] + pub milestone: Option, + #[serde(rename = "ref", skip_serializing_if = "Option::is_none")] + pub r#ref: Option, + #[serde(rename = "title")] + pub title: String, +} + +impl CreateIssueOption { + /// CreateIssueOption options to create one issue + pub fn new(title: String) -> CreateIssueOption { + CreateIssueOption { + assignee: None, + assignees: None, + body: None, + closed: None, + due_date: None, + labels: None, + milestone: None, + r#ref: None, + title, + } + } +} + + diff --git a/crates/gitea_raw_client/src/models/create_key_option.rs b/crates/gitea_raw_client/src/models/create_key_option.rs new file mode 100644 index 0000000..76c6143 --- /dev/null +++ b/crates/gitea_raw_client/src/models/create_key_option.rs @@ -0,0 +1,39 @@ +/* + * Gitea API. + * + * This documentation describes the Gitea API. + * + * The version of the OpenAPI document: 1.17.3 + * + * Generated by: https://openapi-generator.tech + */ + +/// CreateKeyOption : CreateKeyOption options when creating a key + + + +#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)] +pub struct CreateKeyOption { + /// An armored SSH key to add + #[serde(rename = "key")] + pub key: String, + /// Describe if the key has only read access or read/write + #[serde(rename = "read_only", skip_serializing_if = "Option::is_none")] + pub read_only: Option, + /// Title of the key to add + #[serde(rename = "title")] + pub title: String, +} + +impl CreateKeyOption { + /// CreateKeyOption options when creating a key + pub fn new(key: String, title: String) -> CreateKeyOption { + CreateKeyOption { + key, + read_only: None, + title, + } + } +} + + diff --git a/crates/gitea_raw_client/src/models/create_label_option.rs b/crates/gitea_raw_client/src/models/create_label_option.rs new file mode 100644 index 0000000..81c0ac9 --- /dev/null +++ b/crates/gitea_raw_client/src/models/create_label_option.rs @@ -0,0 +1,36 @@ +/* + * Gitea API. + * + * This documentation describes the Gitea API. + * + * The version of the OpenAPI document: 1.17.3 + * + * Generated by: https://openapi-generator.tech + */ + +/// CreateLabelOption : CreateLabelOption options for creating a label + + + +#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)] +pub struct CreateLabelOption { + #[serde(rename = "color")] + pub color: String, + #[serde(rename = "description", skip_serializing_if = "Option::is_none")] + pub description: Option, + #[serde(rename = "name")] + pub name: String, +} + +impl CreateLabelOption { + /// CreateLabelOption options for creating a label + pub fn new(color: String, name: String) -> CreateLabelOption { + CreateLabelOption { + color, + description: None, + name, + } + } +} + + diff --git a/crates/gitea_raw_client/src/models/create_milestone_option.rs b/crates/gitea_raw_client/src/models/create_milestone_option.rs new file mode 100644 index 0000000..fddc4dc --- /dev/null +++ b/crates/gitea_raw_client/src/models/create_milestone_option.rs @@ -0,0 +1,53 @@ +/* + * Gitea API. + * + * This documentation describes the Gitea API. + * + * The version of the OpenAPI document: 1.17.3 + * + * Generated by: https://openapi-generator.tech + */ + +/// CreateMilestoneOption : CreateMilestoneOption options for creating a milestone + + + +#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)] +pub struct CreateMilestoneOption { + #[serde(rename = "description", skip_serializing_if = "Option::is_none")] + pub description: Option, + #[serde(rename = "due_on", skip_serializing_if = "Option::is_none")] + pub due_on: Option, + #[serde(rename = "state", skip_serializing_if = "Option::is_none")] + pub state: Option, + #[serde(rename = "title", skip_serializing_if = "Option::is_none")] + pub title: Option, +} + +impl CreateMilestoneOption { + /// CreateMilestoneOption options for creating a milestone + pub fn new() -> CreateMilestoneOption { + CreateMilestoneOption { + description: None, + due_on: None, + state: None, + title: None, + } + } +} + +/// +#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)] +pub enum State { + #[serde(rename = "open")] + Open, + #[serde(rename = "closed")] + Closed, +} + +impl Default for State { + fn default() -> State { + Self::Open + } +} + diff --git a/crates/gitea_raw_client/src/models/create_o_auth2_application_options.rs b/crates/gitea_raw_client/src/models/create_o_auth2_application_options.rs new file mode 100644 index 0000000..337d0ac --- /dev/null +++ b/crates/gitea_raw_client/src/models/create_o_auth2_application_options.rs @@ -0,0 +1,33 @@ +/* + * Gitea API. + * + * This documentation describes the Gitea API. + * + * The version of the OpenAPI document: 1.17.3 + * + * Generated by: https://openapi-generator.tech + */ + +/// CreateOAuth2ApplicationOptions : CreateOAuth2ApplicationOptions holds options to create an oauth2 application + + + +#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)] +pub struct CreateOAuth2ApplicationOptions { + #[serde(rename = "name", skip_serializing_if = "Option::is_none")] + pub name: Option, + #[serde(rename = "redirect_uris", skip_serializing_if = "Option::is_none")] + pub redirect_uris: Option>, +} + +impl CreateOAuth2ApplicationOptions { + /// CreateOAuth2ApplicationOptions holds options to create an oauth2 application + pub fn new() -> CreateOAuth2ApplicationOptions { + CreateOAuth2ApplicationOptions { + name: None, + redirect_uris: None, + } + } +} + + diff --git a/crates/gitea_raw_client/src/models/create_org_option.rs b/crates/gitea_raw_client/src/models/create_org_option.rs new file mode 100644 index 0000000..001e1a7 --- /dev/null +++ b/crates/gitea_raw_client/src/models/create_org_option.rs @@ -0,0 +1,65 @@ +/* + * Gitea API. + * + * This documentation describes the Gitea API. + * + * The version of the OpenAPI document: 1.17.3 + * + * Generated by: https://openapi-generator.tech + */ + +/// CreateOrgOption : CreateOrgOption options for creating an organization + + + +#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)] +pub struct CreateOrgOption { + #[serde(rename = "description", skip_serializing_if = "Option::is_none")] + pub description: Option, + #[serde(rename = "full_name", skip_serializing_if = "Option::is_none")] + pub full_name: Option, + #[serde(rename = "location", skip_serializing_if = "Option::is_none")] + pub location: Option, + #[serde(rename = "repo_admin_change_team_access", skip_serializing_if = "Option::is_none")] + pub repo_admin_change_team_access: Option, + #[serde(rename = "username")] + pub username: String, + /// possible values are `public` (default), `limited` or `private` + #[serde(rename = "visibility", skip_serializing_if = "Option::is_none")] + pub visibility: Option, + #[serde(rename = "website", skip_serializing_if = "Option::is_none")] + pub website: Option, +} + +impl CreateOrgOption { + /// CreateOrgOption options for creating an organization + pub fn new(username: String) -> CreateOrgOption { + CreateOrgOption { + description: None, + full_name: None, + location: None, + repo_admin_change_team_access: None, + username, + visibility: None, + website: None, + } + } +} + +/// possible values are `public` (default), `limited` or `private` +#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)] +pub enum Visibility { + #[serde(rename = "public")] + Public, + #[serde(rename = "limited")] + Limited, + #[serde(rename = "private")] + Private, +} + +impl Default for Visibility { + fn default() -> Visibility { + Self::Public + } +} + diff --git a/crates/gitea_raw_client/src/models/create_pull_request_option.rs b/crates/gitea_raw_client/src/models/create_pull_request_option.rs new file mode 100644 index 0000000..eaec989 --- /dev/null +++ b/crates/gitea_raw_client/src/models/create_pull_request_option.rs @@ -0,0 +1,54 @@ +/* + * Gitea API. + * + * This documentation describes the Gitea API. + * + * The version of the OpenAPI document: 1.17.3 + * + * Generated by: https://openapi-generator.tech + */ + +/// CreatePullRequestOption : CreatePullRequestOption options when creating a pull request + + + +#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)] +pub struct CreatePullRequestOption { + #[serde(rename = "assignee", skip_serializing_if = "Option::is_none")] + pub assignee: Option, + #[serde(rename = "assignees", skip_serializing_if = "Option::is_none")] + pub assignees: Option>, + #[serde(rename = "base", skip_serializing_if = "Option::is_none")] + pub base: Option, + #[serde(rename = "body", skip_serializing_if = "Option::is_none")] + pub body: Option, + #[serde(rename = "due_date", skip_serializing_if = "Option::is_none")] + pub due_date: Option, + #[serde(rename = "head", skip_serializing_if = "Option::is_none")] + pub head: Option, + #[serde(rename = "labels", skip_serializing_if = "Option::is_none")] + pub labels: Option>, + #[serde(rename = "milestone", skip_serializing_if = "Option::is_none")] + pub milestone: Option, + #[serde(rename = "title", skip_serializing_if = "Option::is_none")] + pub title: Option, +} + +impl CreatePullRequestOption { + /// CreatePullRequestOption options when creating a pull request + pub fn new() -> CreatePullRequestOption { + CreatePullRequestOption { + assignee: None, + assignees: None, + base: None, + body: None, + due_date: None, + head: None, + labels: None, + milestone: None, + title: None, + } + } +} + + diff --git a/crates/gitea_raw_client/src/models/create_pull_review_comment.rs b/crates/gitea_raw_client/src/models/create_pull_review_comment.rs new file mode 100644 index 0000000..9aacfe9 --- /dev/null +++ b/crates/gitea_raw_client/src/models/create_pull_review_comment.rs @@ -0,0 +1,42 @@ +/* + * Gitea API. + * + * This documentation describes the Gitea API. + * + * The version of the OpenAPI document: 1.17.3 + * + * Generated by: https://openapi-generator.tech + */ + +/// CreatePullReviewComment : CreatePullReviewComment represent a review comment for creation api + + + +#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)] +pub struct CreatePullReviewComment { + #[serde(rename = "body", skip_serializing_if = "Option::is_none")] + pub body: Option, + /// if comment to new file line or 0 + #[serde(rename = "new_position", skip_serializing_if = "Option::is_none")] + pub new_position: Option, + /// if comment to old file line or 0 + #[serde(rename = "old_position", skip_serializing_if = "Option::is_none")] + pub old_position: Option, + /// the tree path + #[serde(rename = "path", skip_serializing_if = "Option::is_none")] + pub path: Option, +} + +impl CreatePullReviewComment { + /// CreatePullReviewComment represent a review comment for creation api + pub fn new() -> CreatePullReviewComment { + CreatePullReviewComment { + body: None, + new_position: None, + old_position: None, + path: None, + } + } +} + + diff --git a/crates/gitea_raw_client/src/models/create_pull_review_options.rs b/crates/gitea_raw_client/src/models/create_pull_review_options.rs new file mode 100644 index 0000000..508b41e --- /dev/null +++ b/crates/gitea_raw_client/src/models/create_pull_review_options.rs @@ -0,0 +1,40 @@ +/* + * Gitea API. + * + * This documentation describes the Gitea API. + * + * The version of the OpenAPI document: 1.17.3 + * + * Generated by: https://openapi-generator.tech + */ + +/// CreatePullReviewOptions : CreatePullReviewOptions are options to create a pull review + + + +#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)] +pub struct CreatePullReviewOptions { + #[serde(rename = "body", skip_serializing_if = "Option::is_none")] + pub body: Option, + #[serde(rename = "comments", skip_serializing_if = "Option::is_none")] + pub comments: Option>, + #[serde(rename = "commit_id", skip_serializing_if = "Option::is_none")] + pub commit_id: Option, + /// ReviewStateType review state type + #[serde(rename = "event", skip_serializing_if = "Option::is_none")] + pub event: Option, +} + +impl CreatePullReviewOptions { + /// CreatePullReviewOptions are options to create a pull review + pub fn new() -> CreatePullReviewOptions { + CreatePullReviewOptions { + body: None, + comments: None, + commit_id: None, + event: None, + } + } +} + + diff --git a/crates/gitea_raw_client/src/models/create_release_option.rs b/crates/gitea_raw_client/src/models/create_release_option.rs new file mode 100644 index 0000000..2d4b75d --- /dev/null +++ b/crates/gitea_raw_client/src/models/create_release_option.rs @@ -0,0 +1,45 @@ +/* + * Gitea API. + * + * This documentation describes the Gitea API. + * + * The version of the OpenAPI document: 1.17.3 + * + * Generated by: https://openapi-generator.tech + */ + +/// CreateReleaseOption : CreateReleaseOption options when creating a release + + + +#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)] +pub struct CreateReleaseOption { + #[serde(rename = "body", skip_serializing_if = "Option::is_none")] + pub body: Option, + #[serde(rename = "draft", skip_serializing_if = "Option::is_none")] + pub draft: Option, + #[serde(rename = "name", skip_serializing_if = "Option::is_none")] + pub name: Option, + #[serde(rename = "prerelease", skip_serializing_if = "Option::is_none")] + pub prerelease: Option, + #[serde(rename = "tag_name")] + pub tag_name: String, + #[serde(rename = "target_commitish", skip_serializing_if = "Option::is_none")] + pub target_commitish: Option, +} + +impl CreateReleaseOption { + /// CreateReleaseOption options when creating a release + pub fn new(tag_name: String) -> CreateReleaseOption { + CreateReleaseOption { + body: None, + draft: None, + name: None, + prerelease: None, + tag_name, + target_commitish: None, + } + } +} + + diff --git a/crates/gitea_raw_client/src/models/create_repo_option.rs b/crates/gitea_raw_client/src/models/create_repo_option.rs new file mode 100644 index 0000000..52a9a61 --- /dev/null +++ b/crates/gitea_raw_client/src/models/create_repo_option.rs @@ -0,0 +1,89 @@ +/* + * Gitea API. + * + * This documentation describes the Gitea API. + * + * The version of the OpenAPI document: 1.17.3 + * + * Generated by: https://openapi-generator.tech + */ + +/// CreateRepoOption : CreateRepoOption options when creating repository + + + +#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)] +pub struct CreateRepoOption { + /// Whether the repository should be auto-initialized? + #[serde(rename = "auto_init", skip_serializing_if = "Option::is_none")] + pub auto_init: Option, + /// DefaultBranch of the repository (used when initializes and in template) + #[serde(rename = "default_branch", skip_serializing_if = "Option::is_none")] + pub default_branch: Option, + /// Description of the repository to create + #[serde(rename = "description", skip_serializing_if = "Option::is_none")] + pub description: Option, + /// Gitignores to use + #[serde(rename = "gitignores", skip_serializing_if = "Option::is_none")] + pub gitignores: Option, + /// Label-Set to use + #[serde(rename = "issue_labels", skip_serializing_if = "Option::is_none")] + pub issue_labels: Option, + /// License to use + #[serde(rename = "license", skip_serializing_if = "Option::is_none")] + pub license: Option, + /// Name of the repository to create + #[serde(rename = "name")] + pub name: String, + /// Whether the repository is private + #[serde(rename = "private", skip_serializing_if = "Option::is_none")] + pub private: Option, + /// Readme of the repository to create + #[serde(rename = "readme", skip_serializing_if = "Option::is_none")] + pub readme: Option, + /// Whether the repository is template + #[serde(rename = "template", skip_serializing_if = "Option::is_none")] + pub template: Option, + /// TrustModel of the repository + #[serde(rename = "trust_model", skip_serializing_if = "Option::is_none")] + pub trust_model: Option, +} + +impl CreateRepoOption { + /// CreateRepoOption options when creating repository + pub fn new(name: String) -> CreateRepoOption { + CreateRepoOption { + auto_init: None, + default_branch: None, + description: None, + gitignores: None, + issue_labels: None, + license: None, + name, + private: None, + readme: None, + template: None, + trust_model: None, + } + } +} + +/// TrustModel of the repository +#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)] +pub enum TrustModel { + #[serde(rename = "default")] + Default, + #[serde(rename = "collaborator")] + Collaborator, + #[serde(rename = "committer")] + Committer, + #[serde(rename = "collaboratorcommitter")] + Collaboratorcommitter, +} + +impl Default for TrustModel { + fn default() -> TrustModel { + Self::Default + } +} + diff --git a/crates/gitea_raw_client/src/models/create_status_option.rs b/crates/gitea_raw_client/src/models/create_status_option.rs new file mode 100644 index 0000000..9bb0ad4 --- /dev/null +++ b/crates/gitea_raw_client/src/models/create_status_option.rs @@ -0,0 +1,40 @@ +/* + * Gitea API. + * + * This documentation describes the Gitea API. + * + * The version of the OpenAPI document: 1.17.3 + * + * Generated by: https://openapi-generator.tech + */ + +/// CreateStatusOption : CreateStatusOption holds the information needed to create a new CommitStatus for a Commit + + + +#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)] +pub struct CreateStatusOption { + #[serde(rename = "context", skip_serializing_if = "Option::is_none")] + pub context: Option, + #[serde(rename = "description", skip_serializing_if = "Option::is_none")] + pub description: Option, + /// CommitStatusState holds the state of a CommitStatus It can be \"pending\", \"success\", \"error\", \"failure\", and \"warning\" + #[serde(rename = "state", skip_serializing_if = "Option::is_none")] + pub state: Option, + #[serde(rename = "target_url", skip_serializing_if = "Option::is_none")] + pub target_url: Option, +} + +impl CreateStatusOption { + /// CreateStatusOption holds the information needed to create a new CommitStatus for a Commit + pub fn new() -> CreateStatusOption { + CreateStatusOption { + context: None, + description: None, + state: None, + target_url: None, + } + } +} + + diff --git a/crates/gitea_raw_client/src/models/create_tag_option.rs b/crates/gitea_raw_client/src/models/create_tag_option.rs new file mode 100644 index 0000000..398ef37 --- /dev/null +++ b/crates/gitea_raw_client/src/models/create_tag_option.rs @@ -0,0 +1,36 @@ +/* + * Gitea API. + * + * This documentation describes the Gitea API. + * + * The version of the OpenAPI document: 1.17.3 + * + * Generated by: https://openapi-generator.tech + */ + +/// CreateTagOption : CreateTagOption options when creating a tag + + + +#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)] +pub struct CreateTagOption { + #[serde(rename = "message", skip_serializing_if = "Option::is_none")] + pub message: Option, + #[serde(rename = "tag_name")] + pub tag_name: String, + #[serde(rename = "target", skip_serializing_if = "Option::is_none")] + pub target: Option, +} + +impl CreateTagOption { + /// CreateTagOption options when creating a tag + pub fn new(tag_name: String) -> CreateTagOption { + CreateTagOption { + message: None, + tag_name, + target: None, + } + } +} + + diff --git a/crates/gitea_raw_client/src/models/create_team_option.rs b/crates/gitea_raw_client/src/models/create_team_option.rs new file mode 100644 index 0000000..179ef3d --- /dev/null +++ b/crates/gitea_raw_client/src/models/create_team_option.rs @@ -0,0 +1,64 @@ +/* + * Gitea API. + * + * This documentation describes the Gitea API. + * + * The version of the OpenAPI document: 1.17.3 + * + * Generated by: https://openapi-generator.tech + */ + +/// CreateTeamOption : CreateTeamOption options for creating a team + + + +#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)] +pub struct CreateTeamOption { + #[serde(rename = "can_create_org_repo", skip_serializing_if = "Option::is_none")] + pub can_create_org_repo: Option, + #[serde(rename = "description", skip_serializing_if = "Option::is_none")] + pub description: Option, + #[serde(rename = "includes_all_repositories", skip_serializing_if = "Option::is_none")] + pub includes_all_repositories: Option, + #[serde(rename = "name")] + pub name: String, + #[serde(rename = "permission", skip_serializing_if = "Option::is_none")] + pub permission: Option, + #[serde(rename = "units", skip_serializing_if = "Option::is_none")] + pub units: Option>, + #[serde(rename = "units_map", skip_serializing_if = "Option::is_none")] + pub units_map: Option<::std::collections::HashMap>, +} + +impl CreateTeamOption { + /// CreateTeamOption options for creating a team + pub fn new(name: String) -> CreateTeamOption { + CreateTeamOption { + can_create_org_repo: None, + description: None, + includes_all_repositories: None, + name, + permission: None, + units: None, + units_map: None, + } + } +} + +/// +#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)] +pub enum Permission { + #[serde(rename = "read")] + Read, + #[serde(rename = "write")] + Write, + #[serde(rename = "admin")] + Admin, +} + +impl Default for Permission { + fn default() -> Permission { + Self::Read + } +} + diff --git a/crates/gitea_raw_client/src/models/create_user_option.rs b/crates/gitea_raw_client/src/models/create_user_option.rs new file mode 100644 index 0000000..86a3330 --- /dev/null +++ b/crates/gitea_raw_client/src/models/create_user_option.rs @@ -0,0 +1,57 @@ +/* + * Gitea API. + * + * This documentation describes the Gitea API. + * + * The version of the OpenAPI document: 1.17.3 + * + * Generated by: https://openapi-generator.tech + */ + +/// CreateUserOption : CreateUserOption create user options + + + +#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)] +pub struct CreateUserOption { + #[serde(rename = "email")] + pub email: String, + #[serde(rename = "full_name", skip_serializing_if = "Option::is_none")] + pub full_name: Option, + #[serde(rename = "login_name", skip_serializing_if = "Option::is_none")] + pub login_name: Option, + #[serde(rename = "must_change_password", skip_serializing_if = "Option::is_none")] + pub must_change_password: Option, + #[serde(rename = "password")] + pub password: String, + #[serde(rename = "restricted", skip_serializing_if = "Option::is_none")] + pub restricted: Option, + #[serde(rename = "send_notify", skip_serializing_if = "Option::is_none")] + pub send_notify: Option, + #[serde(rename = "source_id", skip_serializing_if = "Option::is_none")] + pub source_id: Option, + #[serde(rename = "username")] + pub username: String, + #[serde(rename = "visibility", skip_serializing_if = "Option::is_none")] + pub visibility: Option, +} + +impl CreateUserOption { + /// CreateUserOption create user options + pub fn new(email: String, password: String, username: String) -> CreateUserOption { + CreateUserOption { + email, + full_name: None, + login_name: None, + must_change_password: None, + password, + restricted: None, + send_notify: None, + source_id: None, + username, + visibility: None, + } + } +} + + diff --git a/crates/gitea_raw_client/src/models/create_wiki_page_options.rs b/crates/gitea_raw_client/src/models/create_wiki_page_options.rs new file mode 100644 index 0000000..b3820ef --- /dev/null +++ b/crates/gitea_raw_client/src/models/create_wiki_page_options.rs @@ -0,0 +1,39 @@ +/* + * Gitea API. + * + * This documentation describes the Gitea API. + * + * The version of the OpenAPI document: 1.17.3 + * + * Generated by: https://openapi-generator.tech + */ + +/// CreateWikiPageOptions : CreateWikiPageOptions form for creating wiki + + + +#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)] +pub struct CreateWikiPageOptions { + /// content must be base64 encoded + #[serde(rename = "content_base64", skip_serializing_if = "Option::is_none")] + pub content_base64: Option, + /// optional commit message summarizing the change + #[serde(rename = "message", skip_serializing_if = "Option::is_none")] + pub message: Option, + /// page title. leave empty to keep unchanged + #[serde(rename = "title", skip_serializing_if = "Option::is_none")] + pub title: Option, +} + +impl CreateWikiPageOptions { + /// CreateWikiPageOptions form for creating wiki + pub fn new() -> CreateWikiPageOptions { + CreateWikiPageOptions { + content_base64: None, + message: None, + title: None, + } + } +} + + diff --git a/crates/gitea_raw_client/src/models/cron.rs b/crates/gitea_raw_client/src/models/cron.rs new file mode 100644 index 0000000..d41fb15 --- /dev/null +++ b/crates/gitea_raw_client/src/models/cron.rs @@ -0,0 +1,42 @@ +/* + * Gitea API. + * + * This documentation describes the Gitea API. + * + * The version of the OpenAPI document: 1.17.3 + * + * Generated by: https://openapi-generator.tech + */ + +/// Cron : Cron represents a Cron task + + + +#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)] +pub struct Cron { + #[serde(rename = "exec_times", skip_serializing_if = "Option::is_none")] + pub exec_times: Option, + #[serde(rename = "name", skip_serializing_if = "Option::is_none")] + pub name: Option, + #[serde(rename = "next", skip_serializing_if = "Option::is_none")] + pub next: Option, + #[serde(rename = "prev", skip_serializing_if = "Option::is_none")] + pub prev: Option, + #[serde(rename = "schedule", skip_serializing_if = "Option::is_none")] + pub schedule: Option, +} + +impl Cron { + /// Cron represents a Cron task + pub fn new() -> Cron { + Cron { + exec_times: None, + name: None, + next: None, + prev: None, + schedule: None, + } + } +} + + diff --git a/crates/gitea_raw_client/src/models/delete_email_option.rs b/crates/gitea_raw_client/src/models/delete_email_option.rs new file mode 100644 index 0000000..5bae6da --- /dev/null +++ b/crates/gitea_raw_client/src/models/delete_email_option.rs @@ -0,0 +1,31 @@ +/* + * Gitea API. + * + * This documentation describes the Gitea API. + * + * The version of the OpenAPI document: 1.17.3 + * + * Generated by: https://openapi-generator.tech + */ + +/// DeleteEmailOption : DeleteEmailOption options when deleting email addresses + + + +#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)] +pub struct DeleteEmailOption { + /// email addresses to delete + #[serde(rename = "emails", skip_serializing_if = "Option::is_none")] + pub emails: Option>, +} + +impl DeleteEmailOption { + /// DeleteEmailOption options when deleting email addresses + pub fn new() -> DeleteEmailOption { + DeleteEmailOption { + emails: None, + } + } +} + + diff --git a/crates/gitea_raw_client/src/models/delete_file_options.rs b/crates/gitea_raw_client/src/models/delete_file_options.rs new file mode 100644 index 0000000..b5c72b9 --- /dev/null +++ b/crates/gitea_raw_client/src/models/delete_file_options.rs @@ -0,0 +1,56 @@ +/* + * Gitea API. + * + * This documentation describes the Gitea API. + * + * The version of the OpenAPI document: 1.17.3 + * + * Generated by: https://openapi-generator.tech + */ + +/// DeleteFileOptions : DeleteFileOptions options for deleting files (used for other File structs below) Note: `author` and `committer` are optional (if only one is given, it will be used for the other, otherwise the authenticated user will be used) + + + +#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)] +pub struct DeleteFileOptions { + #[serde(rename = "author", skip_serializing_if = "Option::is_none")] + pub author: Option>, + /// branch (optional) to base this file from. if not given, the default branch is used + #[serde(rename = "branch", skip_serializing_if = "Option::is_none")] + pub branch: Option, + #[serde(rename = "committer", skip_serializing_if = "Option::is_none")] + pub committer: Option>, + #[serde(rename = "dates", skip_serializing_if = "Option::is_none")] + pub dates: Option>, + /// message (optional) for the commit of this file. if not supplied, a default message will be used + #[serde(rename = "message", skip_serializing_if = "Option::is_none")] + pub message: Option, + /// new_branch (optional) will make a new branch from `branch` before creating the file + #[serde(rename = "new_branch", skip_serializing_if = "Option::is_none")] + pub new_branch: Option, + /// sha is the SHA for the file that already exists + #[serde(rename = "sha")] + pub sha: String, + /// Add a Signed-off-by trailer by the committer at the end of the commit log message. + #[serde(rename = "signoff", skip_serializing_if = "Option::is_none")] + pub signoff: Option, +} + +impl DeleteFileOptions { + /// DeleteFileOptions options for deleting files (used for other File structs below) Note: `author` and `committer` are optional (if only one is given, it will be used for the other, otherwise the authenticated user will be used) + pub fn new(sha: String) -> DeleteFileOptions { + DeleteFileOptions { + author: None, + branch: None, + committer: None, + dates: None, + message: None, + new_branch: None, + sha, + signoff: None, + } + } +} + + diff --git a/crates/gitea_raw_client/src/models/deploy_key.rs b/crates/gitea_raw_client/src/models/deploy_key.rs new file mode 100644 index 0000000..d20c733 --- /dev/null +++ b/crates/gitea_raw_client/src/models/deploy_key.rs @@ -0,0 +1,54 @@ +/* + * Gitea API. + * + * This documentation describes the Gitea API. + * + * The version of the OpenAPI document: 1.17.3 + * + * Generated by: https://openapi-generator.tech + */ + +/// DeployKey : DeployKey a deploy key + + + +#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)] +pub struct DeployKey { + #[serde(rename = "created_at", skip_serializing_if = "Option::is_none")] + pub created_at: Option, + #[serde(rename = "fingerprint", skip_serializing_if = "Option::is_none")] + pub fingerprint: Option, + #[serde(rename = "id", skip_serializing_if = "Option::is_none")] + pub id: Option, + #[serde(rename = "key", skip_serializing_if = "Option::is_none")] + pub key: Option, + #[serde(rename = "key_id", skip_serializing_if = "Option::is_none")] + pub key_id: Option, + #[serde(rename = "read_only", skip_serializing_if = "Option::is_none")] + pub read_only: Option, + #[serde(rename = "repository", skip_serializing_if = "Option::is_none")] + pub repository: Option>, + #[serde(rename = "title", skip_serializing_if = "Option::is_none")] + pub title: Option, + #[serde(rename = "url", skip_serializing_if = "Option::is_none")] + pub url: Option, +} + +impl DeployKey { + /// DeployKey a deploy key + pub fn new() -> DeployKey { + DeployKey { + created_at: None, + fingerprint: None, + id: None, + key: None, + key_id: None, + read_only: None, + repository: None, + title: None, + url: None, + } + } +} + + diff --git a/crates/gitea_raw_client/src/models/dismiss_pull_review_options.rs b/crates/gitea_raw_client/src/models/dismiss_pull_review_options.rs new file mode 100644 index 0000000..ebed682 --- /dev/null +++ b/crates/gitea_raw_client/src/models/dismiss_pull_review_options.rs @@ -0,0 +1,33 @@ +/* + * Gitea API. + * + * This documentation describes the Gitea API. + * + * The version of the OpenAPI document: 1.17.3 + * + * Generated by: https://openapi-generator.tech + */ + +/// DismissPullReviewOptions : DismissPullReviewOptions are options to dismiss a pull review + + + +#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)] +pub struct DismissPullReviewOptions { + #[serde(rename = "message", skip_serializing_if = "Option::is_none")] + pub message: Option, + #[serde(rename = "priors", skip_serializing_if = "Option::is_none")] + pub priors: Option, +} + +impl DismissPullReviewOptions { + /// DismissPullReviewOptions are options to dismiss a pull review + pub fn new() -> DismissPullReviewOptions { + DismissPullReviewOptions { + message: None, + priors: None, + } + } +} + + diff --git a/crates/gitea_raw_client/src/models/edit_attachment_options.rs b/crates/gitea_raw_client/src/models/edit_attachment_options.rs new file mode 100644 index 0000000..19518aa --- /dev/null +++ b/crates/gitea_raw_client/src/models/edit_attachment_options.rs @@ -0,0 +1,30 @@ +/* + * Gitea API. + * + * This documentation describes the Gitea API. + * + * The version of the OpenAPI document: 1.17.3 + * + * Generated by: https://openapi-generator.tech + */ + +/// EditAttachmentOptions : EditAttachmentOptions options for editing attachments + + + +#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)] +pub struct EditAttachmentOptions { + #[serde(rename = "name", skip_serializing_if = "Option::is_none")] + pub name: Option, +} + +impl EditAttachmentOptions { + /// EditAttachmentOptions options for editing attachments + pub fn new() -> EditAttachmentOptions { + EditAttachmentOptions { + name: None, + } + } +} + + diff --git a/crates/gitea_raw_client/src/models/edit_branch_protection_option.rs b/crates/gitea_raw_client/src/models/edit_branch_protection_option.rs new file mode 100644 index 0000000..18ab128 --- /dev/null +++ b/crates/gitea_raw_client/src/models/edit_branch_protection_option.rs @@ -0,0 +1,90 @@ +/* + * Gitea API. + * + * This documentation describes the Gitea API. + * + * The version of the OpenAPI document: 1.17.3 + * + * Generated by: https://openapi-generator.tech + */ + +/// EditBranchProtectionOption : EditBranchProtectionOption options for editing a branch protection + + + +#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)] +pub struct EditBranchProtectionOption { + #[serde(rename = "approvals_whitelist_teams", skip_serializing_if = "Option::is_none")] + pub approvals_whitelist_teams: Option>, + #[serde(rename = "approvals_whitelist_username", skip_serializing_if = "Option::is_none")] + pub approvals_whitelist_username: Option>, + #[serde(rename = "block_on_official_review_requests", skip_serializing_if = "Option::is_none")] + pub block_on_official_review_requests: Option, + #[serde(rename = "block_on_outdated_branch", skip_serializing_if = "Option::is_none")] + pub block_on_outdated_branch: Option, + #[serde(rename = "block_on_rejected_reviews", skip_serializing_if = "Option::is_none")] + pub block_on_rejected_reviews: Option, + #[serde(rename = "dismiss_stale_approvals", skip_serializing_if = "Option::is_none")] + pub dismiss_stale_approvals: Option, + #[serde(rename = "enable_approvals_whitelist", skip_serializing_if = "Option::is_none")] + pub enable_approvals_whitelist: Option, + #[serde(rename = "enable_merge_whitelist", skip_serializing_if = "Option::is_none")] + pub enable_merge_whitelist: Option, + #[serde(rename = "enable_push", skip_serializing_if = "Option::is_none")] + pub enable_push: Option, + #[serde(rename = "enable_push_whitelist", skip_serializing_if = "Option::is_none")] + pub enable_push_whitelist: Option, + #[serde(rename = "enable_status_check", skip_serializing_if = "Option::is_none")] + pub enable_status_check: Option, + #[serde(rename = "merge_whitelist_teams", skip_serializing_if = "Option::is_none")] + pub merge_whitelist_teams: Option>, + #[serde(rename = "merge_whitelist_usernames", skip_serializing_if = "Option::is_none")] + pub merge_whitelist_usernames: Option>, + #[serde(rename = "protected_file_patterns", skip_serializing_if = "Option::is_none")] + pub protected_file_patterns: Option, + #[serde(rename = "push_whitelist_deploy_keys", skip_serializing_if = "Option::is_none")] + pub push_whitelist_deploy_keys: Option, + #[serde(rename = "push_whitelist_teams", skip_serializing_if = "Option::is_none")] + pub push_whitelist_teams: Option>, + #[serde(rename = "push_whitelist_usernames", skip_serializing_if = "Option::is_none")] + pub push_whitelist_usernames: Option>, + #[serde(rename = "require_signed_commits", skip_serializing_if = "Option::is_none")] + pub require_signed_commits: Option, + #[serde(rename = "required_approvals", skip_serializing_if = "Option::is_none")] + pub required_approvals: Option, + #[serde(rename = "status_check_contexts", skip_serializing_if = "Option::is_none")] + pub status_check_contexts: Option>, + #[serde(rename = "unprotected_file_patterns", skip_serializing_if = "Option::is_none")] + pub unprotected_file_patterns: Option, +} + +impl EditBranchProtectionOption { + /// EditBranchProtectionOption options for editing a branch protection + pub fn new() -> EditBranchProtectionOption { + EditBranchProtectionOption { + approvals_whitelist_teams: None, + approvals_whitelist_username: None, + block_on_official_review_requests: None, + block_on_outdated_branch: None, + block_on_rejected_reviews: None, + dismiss_stale_approvals: None, + enable_approvals_whitelist: None, + enable_merge_whitelist: None, + enable_push: None, + enable_push_whitelist: None, + enable_status_check: None, + merge_whitelist_teams: None, + merge_whitelist_usernames: None, + protected_file_patterns: None, + push_whitelist_deploy_keys: None, + push_whitelist_teams: None, + push_whitelist_usernames: None, + require_signed_commits: None, + required_approvals: None, + status_check_contexts: None, + unprotected_file_patterns: None, + } + } +} + + diff --git a/crates/gitea_raw_client/src/models/edit_deadline_option.rs b/crates/gitea_raw_client/src/models/edit_deadline_option.rs new file mode 100644 index 0000000..4ed01a8 --- /dev/null +++ b/crates/gitea_raw_client/src/models/edit_deadline_option.rs @@ -0,0 +1,30 @@ +/* + * Gitea API. + * + * This documentation describes the Gitea API. + * + * The version of the OpenAPI document: 1.17.3 + * + * Generated by: https://openapi-generator.tech + */ + +/// EditDeadlineOption : EditDeadlineOption options for creating a deadline + + + +#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)] +pub struct EditDeadlineOption { + #[serde(rename = "due_date")] + pub due_date: String, +} + +impl EditDeadlineOption { + /// EditDeadlineOption options for creating a deadline + pub fn new(due_date: String) -> EditDeadlineOption { + EditDeadlineOption { + due_date, + } + } +} + + diff --git a/crates/gitea_raw_client/src/models/edit_git_hook_option.rs b/crates/gitea_raw_client/src/models/edit_git_hook_option.rs new file mode 100644 index 0000000..af87501 --- /dev/null +++ b/crates/gitea_raw_client/src/models/edit_git_hook_option.rs @@ -0,0 +1,30 @@ +/* + * Gitea API. + * + * This documentation describes the Gitea API. + * + * The version of the OpenAPI document: 1.17.3 + * + * Generated by: https://openapi-generator.tech + */ + +/// EditGitHookOption : EditGitHookOption options when modifying one Git hook + + + +#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)] +pub struct EditGitHookOption { + #[serde(rename = "content", skip_serializing_if = "Option::is_none")] + pub content: Option, +} + +impl EditGitHookOption { + /// EditGitHookOption options when modifying one Git hook + pub fn new() -> EditGitHookOption { + EditGitHookOption { + content: None, + } + } +} + + diff --git a/crates/gitea_raw_client/src/models/edit_hook_option.rs b/crates/gitea_raw_client/src/models/edit_hook_option.rs new file mode 100644 index 0000000..8fd3ea9 --- /dev/null +++ b/crates/gitea_raw_client/src/models/edit_hook_option.rs @@ -0,0 +1,39 @@ +/* + * Gitea API. + * + * This documentation describes the Gitea API. + * + * The version of the OpenAPI document: 1.17.3 + * + * Generated by: https://openapi-generator.tech + */ + +/// EditHookOption : EditHookOption options when modify one hook + + + +#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)] +pub struct EditHookOption { + #[serde(rename = "active", skip_serializing_if = "Option::is_none")] + pub active: Option, + #[serde(rename = "branch_filter", skip_serializing_if = "Option::is_none")] + pub branch_filter: Option, + #[serde(rename = "config", skip_serializing_if = "Option::is_none")] + pub config: Option<::std::collections::HashMap>, + #[serde(rename = "events", skip_serializing_if = "Option::is_none")] + pub events: Option>, +} + +impl EditHookOption { + /// EditHookOption options when modify one hook + pub fn new() -> EditHookOption { + EditHookOption { + active: None, + branch_filter: None, + config: None, + events: None, + } + } +} + + diff --git a/crates/gitea_raw_client/src/models/edit_issue_comment_option.rs b/crates/gitea_raw_client/src/models/edit_issue_comment_option.rs new file mode 100644 index 0000000..58b6f44 --- /dev/null +++ b/crates/gitea_raw_client/src/models/edit_issue_comment_option.rs @@ -0,0 +1,30 @@ +/* + * Gitea API. + * + * This documentation describes the Gitea API. + * + * The version of the OpenAPI document: 1.17.3 + * + * Generated by: https://openapi-generator.tech + */ + +/// EditIssueCommentOption : EditIssueCommentOption options for editing a comment + + + +#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)] +pub struct EditIssueCommentOption { + #[serde(rename = "body")] + pub body: String, +} + +impl EditIssueCommentOption { + /// EditIssueCommentOption options for editing a comment + pub fn new(body: String) -> EditIssueCommentOption { + EditIssueCommentOption { + body, + } + } +} + + diff --git a/crates/gitea_raw_client/src/models/edit_issue_option.rs b/crates/gitea_raw_client/src/models/edit_issue_option.rs new file mode 100644 index 0000000..8281540 --- /dev/null +++ b/crates/gitea_raw_client/src/models/edit_issue_option.rs @@ -0,0 +1,55 @@ +/* + * Gitea API. + * + * This documentation describes the Gitea API. + * + * The version of the OpenAPI document: 1.17.3 + * + * Generated by: https://openapi-generator.tech + */ + +/// EditIssueOption : EditIssueOption options for editing an issue + + + +#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)] +pub struct EditIssueOption { + /// deprecated + #[serde(rename = "assignee", skip_serializing_if = "Option::is_none")] + pub assignee: Option, + #[serde(rename = "assignees", skip_serializing_if = "Option::is_none")] + pub assignees: Option>, + #[serde(rename = "body", skip_serializing_if = "Option::is_none")] + pub body: Option, + #[serde(rename = "due_date", skip_serializing_if = "Option::is_none")] + pub due_date: Option, + #[serde(rename = "milestone", skip_serializing_if = "Option::is_none")] + pub milestone: Option, + #[serde(rename = "ref", skip_serializing_if = "Option::is_none")] + pub r#ref: Option, + #[serde(rename = "state", skip_serializing_if = "Option::is_none")] + pub state: Option, + #[serde(rename = "title", skip_serializing_if = "Option::is_none")] + pub title: Option, + #[serde(rename = "unset_due_date", skip_serializing_if = "Option::is_none")] + pub unset_due_date: Option, +} + +impl EditIssueOption { + /// EditIssueOption options for editing an issue + pub fn new() -> EditIssueOption { + EditIssueOption { + assignee: None, + assignees: None, + body: None, + due_date: None, + milestone: None, + r#ref: None, + state: None, + title: None, + unset_due_date: None, + } + } +} + + diff --git a/crates/gitea_raw_client/src/models/edit_label_option.rs b/crates/gitea_raw_client/src/models/edit_label_option.rs new file mode 100644 index 0000000..6147761 --- /dev/null +++ b/crates/gitea_raw_client/src/models/edit_label_option.rs @@ -0,0 +1,36 @@ +/* + * Gitea API. + * + * This documentation describes the Gitea API. + * + * The version of the OpenAPI document: 1.17.3 + * + * Generated by: https://openapi-generator.tech + */ + +/// EditLabelOption : EditLabelOption options for editing a label + + + +#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)] +pub struct EditLabelOption { + #[serde(rename = "color", skip_serializing_if = "Option::is_none")] + pub color: Option, + #[serde(rename = "description", skip_serializing_if = "Option::is_none")] + pub description: Option, + #[serde(rename = "name", skip_serializing_if = "Option::is_none")] + pub name: Option, +} + +impl EditLabelOption { + /// EditLabelOption options for editing a label + pub fn new() -> EditLabelOption { + EditLabelOption { + color: None, + description: None, + name: None, + } + } +} + + diff --git a/crates/gitea_raw_client/src/models/edit_milestone_option.rs b/crates/gitea_raw_client/src/models/edit_milestone_option.rs new file mode 100644 index 0000000..a879cef --- /dev/null +++ b/crates/gitea_raw_client/src/models/edit_milestone_option.rs @@ -0,0 +1,39 @@ +/* + * Gitea API. + * + * This documentation describes the Gitea API. + * + * The version of the OpenAPI document: 1.17.3 + * + * Generated by: https://openapi-generator.tech + */ + +/// EditMilestoneOption : EditMilestoneOption options for editing a milestone + + + +#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)] +pub struct EditMilestoneOption { + #[serde(rename = "description", skip_serializing_if = "Option::is_none")] + pub description: Option, + #[serde(rename = "due_on", skip_serializing_if = "Option::is_none")] + pub due_on: Option, + #[serde(rename = "state", skip_serializing_if = "Option::is_none")] + pub state: Option, + #[serde(rename = "title", skip_serializing_if = "Option::is_none")] + pub title: Option, +} + +impl EditMilestoneOption { + /// EditMilestoneOption options for editing a milestone + pub fn new() -> EditMilestoneOption { + EditMilestoneOption { + description: None, + due_on: None, + state: None, + title: None, + } + } +} + + diff --git a/crates/gitea_raw_client/src/models/edit_org_option.rs b/crates/gitea_raw_client/src/models/edit_org_option.rs new file mode 100644 index 0000000..d3b511d --- /dev/null +++ b/crates/gitea_raw_client/src/models/edit_org_option.rs @@ -0,0 +1,62 @@ +/* + * Gitea API. + * + * This documentation describes the Gitea API. + * + * The version of the OpenAPI document: 1.17.3 + * + * Generated by: https://openapi-generator.tech + */ + +/// EditOrgOption : EditOrgOption options for editing an organization + + + +#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)] +pub struct EditOrgOption { + #[serde(rename = "description", skip_serializing_if = "Option::is_none")] + pub description: Option, + #[serde(rename = "full_name", skip_serializing_if = "Option::is_none")] + pub full_name: Option, + #[serde(rename = "location", skip_serializing_if = "Option::is_none")] + pub location: Option, + #[serde(rename = "repo_admin_change_team_access", skip_serializing_if = "Option::is_none")] + pub repo_admin_change_team_access: Option, + /// possible values are `public`, `limited` or `private` + #[serde(rename = "visibility", skip_serializing_if = "Option::is_none")] + pub visibility: Option, + #[serde(rename = "website", skip_serializing_if = "Option::is_none")] + pub website: Option, +} + +impl EditOrgOption { + /// EditOrgOption options for editing an organization + pub fn new() -> EditOrgOption { + EditOrgOption { + description: None, + full_name: None, + location: None, + repo_admin_change_team_access: None, + visibility: None, + website: None, + } + } +} + +/// possible values are `public`, `limited` or `private` +#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)] +pub enum Visibility { + #[serde(rename = "public")] + Public, + #[serde(rename = "limited")] + Limited, + #[serde(rename = "private")] + Private, +} + +impl Default for Visibility { + fn default() -> Visibility { + Self::Public + } +} + diff --git a/crates/gitea_raw_client/src/models/edit_pull_request_option.rs b/crates/gitea_raw_client/src/models/edit_pull_request_option.rs new file mode 100644 index 0000000..28c154d --- /dev/null +++ b/crates/gitea_raw_client/src/models/edit_pull_request_option.rs @@ -0,0 +1,60 @@ +/* + * Gitea API. + * + * This documentation describes the Gitea API. + * + * The version of the OpenAPI document: 1.17.3 + * + * Generated by: https://openapi-generator.tech + */ + +/// EditPullRequestOption : EditPullRequestOption options when modify pull request + + + +#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)] +pub struct EditPullRequestOption { + #[serde(rename = "allow_maintainer_edit", skip_serializing_if = "Option::is_none")] + pub allow_maintainer_edit: Option, + #[serde(rename = "assignee", skip_serializing_if = "Option::is_none")] + pub assignee: Option, + #[serde(rename = "assignees", skip_serializing_if = "Option::is_none")] + pub assignees: Option>, + #[serde(rename = "base", skip_serializing_if = "Option::is_none")] + pub base: Option, + #[serde(rename = "body", skip_serializing_if = "Option::is_none")] + pub body: Option, + #[serde(rename = "due_date", skip_serializing_if = "Option::is_none")] + pub due_date: Option, + #[serde(rename = "labels", skip_serializing_if = "Option::is_none")] + pub labels: Option>, + #[serde(rename = "milestone", skip_serializing_if = "Option::is_none")] + pub milestone: Option, + #[serde(rename = "state", skip_serializing_if = "Option::is_none")] + pub state: Option, + #[serde(rename = "title", skip_serializing_if = "Option::is_none")] + pub title: Option, + #[serde(rename = "unset_due_date", skip_serializing_if = "Option::is_none")] + pub unset_due_date: Option, +} + +impl EditPullRequestOption { + /// EditPullRequestOption options when modify pull request + pub fn new() -> EditPullRequestOption { + EditPullRequestOption { + allow_maintainer_edit: None, + assignee: None, + assignees: None, + base: None, + body: None, + due_date: None, + labels: None, + milestone: None, + state: None, + title: None, + unset_due_date: None, + } + } +} + + diff --git a/crates/gitea_raw_client/src/models/edit_reaction_option.rs b/crates/gitea_raw_client/src/models/edit_reaction_option.rs new file mode 100644 index 0000000..01d2a52 --- /dev/null +++ b/crates/gitea_raw_client/src/models/edit_reaction_option.rs @@ -0,0 +1,30 @@ +/* + * Gitea API. + * + * This documentation describes the Gitea API. + * + * The version of the OpenAPI document: 1.17.3 + * + * Generated by: https://openapi-generator.tech + */ + +/// EditReactionOption : EditReactionOption contain the reaction type + + + +#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)] +pub struct EditReactionOption { + #[serde(rename = "content", skip_serializing_if = "Option::is_none")] + pub content: Option, +} + +impl EditReactionOption { + /// EditReactionOption contain the reaction type + pub fn new() -> EditReactionOption { + EditReactionOption { + content: None, + } + } +} + + diff --git a/crates/gitea_raw_client/src/models/edit_release_option.rs b/crates/gitea_raw_client/src/models/edit_release_option.rs new file mode 100644 index 0000000..373ce61 --- /dev/null +++ b/crates/gitea_raw_client/src/models/edit_release_option.rs @@ -0,0 +1,45 @@ +/* + * Gitea API. + * + * This documentation describes the Gitea API. + * + * The version of the OpenAPI document: 1.17.3 + * + * Generated by: https://openapi-generator.tech + */ + +/// EditReleaseOption : EditReleaseOption options when editing a release + + + +#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)] +pub struct EditReleaseOption { + #[serde(rename = "body", skip_serializing_if = "Option::is_none")] + pub body: Option, + #[serde(rename = "draft", skip_serializing_if = "Option::is_none")] + pub draft: Option, + #[serde(rename = "name", skip_serializing_if = "Option::is_none")] + pub name: Option, + #[serde(rename = "prerelease", skip_serializing_if = "Option::is_none")] + pub prerelease: Option, + #[serde(rename = "tag_name", skip_serializing_if = "Option::is_none")] + pub tag_name: Option, + #[serde(rename = "target_commitish", skip_serializing_if = "Option::is_none")] + pub target_commitish: Option, +} + +impl EditReleaseOption { + /// EditReleaseOption options when editing a release + pub fn new() -> EditReleaseOption { + EditReleaseOption { + body: None, + draft: None, + name: None, + prerelease: None, + tag_name: None, + target_commitish: None, + } + } +} + + diff --git a/crates/gitea_raw_client/src/models/edit_repo_option.rs b/crates/gitea_raw_client/src/models/edit_repo_option.rs new file mode 100644 index 0000000..5344fba --- /dev/null +++ b/crates/gitea_raw_client/src/models/edit_repo_option.rs @@ -0,0 +1,128 @@ +/* + * Gitea API. + * + * This documentation describes the Gitea API. + * + * The version of the OpenAPI document: 1.17.3 + * + * Generated by: https://openapi-generator.tech + */ + +/// EditRepoOption : EditRepoOption options when editing a repository's properties + + + +#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)] +pub struct EditRepoOption { + /// either `true` to allow mark pr as merged manually, or `false` to prevent it. `has_pull_requests` must be `true`. + #[serde(rename = "allow_manual_merge", skip_serializing_if = "Option::is_none")] + pub allow_manual_merge: Option, + /// either `true` to allow merging pull requests with a merge commit, or `false` to prevent merging pull requests with merge commits. `has_pull_requests` must be `true`. + #[serde(rename = "allow_merge_commits", skip_serializing_if = "Option::is_none")] + pub allow_merge_commits: Option, + /// either `true` to allow rebase-merging pull requests, or `false` to prevent rebase-merging. `has_pull_requests` must be `true`. + #[serde(rename = "allow_rebase", skip_serializing_if = "Option::is_none")] + pub allow_rebase: Option, + /// either `true` to allow rebase with explicit merge commits (--no-ff), or `false` to prevent rebase with explicit merge commits. `has_pull_requests` must be `true`. + #[serde(rename = "allow_rebase_explicit", skip_serializing_if = "Option::is_none")] + pub allow_rebase_explicit: Option, + /// either `true` to allow updating pull request branch by rebase, or `false` to prevent it. `has_pull_requests` must be `true`. + #[serde(rename = "allow_rebase_update", skip_serializing_if = "Option::is_none")] + pub allow_rebase_update: Option, + /// either `true` to allow squash-merging pull requests, or `false` to prevent squash-merging. `has_pull_requests` must be `true`. + #[serde(rename = "allow_squash_merge", skip_serializing_if = "Option::is_none")] + pub allow_squash_merge: Option, + /// set to `true` to archive this repository. + #[serde(rename = "archived", skip_serializing_if = "Option::is_none")] + pub archived: Option, + /// either `true` to enable AutodetectManualMerge, or `false` to prevent it. `has_pull_requests` must be `true`, Note: In some special cases, misjudgments can occur. + #[serde(rename = "autodetect_manual_merge", skip_serializing_if = "Option::is_none")] + pub autodetect_manual_merge: Option, + /// sets the default branch for this repository. + #[serde(rename = "default_branch", skip_serializing_if = "Option::is_none")] + pub default_branch: Option, + /// set to `true` to delete pr branch after merge by default + #[serde(rename = "default_delete_branch_after_merge", skip_serializing_if = "Option::is_none")] + pub default_delete_branch_after_merge: Option, + /// set to a merge style to be used by this repository: \"merge\", \"rebase\", \"rebase-merge\", or \"squash\". `has_pull_requests` must be `true`. + #[serde(rename = "default_merge_style", skip_serializing_if = "Option::is_none")] + pub default_merge_style: Option, + /// a short description of the repository. + #[serde(rename = "description", skip_serializing_if = "Option::is_none")] + pub description: Option, + /// enable prune - remove obsolete remote-tracking references + #[serde(rename = "enable_prune", skip_serializing_if = "Option::is_none")] + pub enable_prune: Option, + #[serde(rename = "external_tracker", skip_serializing_if = "Option::is_none")] + pub external_tracker: Option>, + #[serde(rename = "external_wiki", skip_serializing_if = "Option::is_none")] + pub external_wiki: Option>, + /// either `true` to enable issues for this repository or `false` to disable them. + #[serde(rename = "has_issues", skip_serializing_if = "Option::is_none")] + pub has_issues: Option, + /// either `true` to enable project unit, or `false` to disable them. + #[serde(rename = "has_projects", skip_serializing_if = "Option::is_none")] + pub has_projects: Option, + /// either `true` to allow pull requests, or `false` to prevent pull request. + #[serde(rename = "has_pull_requests", skip_serializing_if = "Option::is_none")] + pub has_pull_requests: Option, + /// either `true` to enable the wiki for this repository or `false` to disable it. + #[serde(rename = "has_wiki", skip_serializing_if = "Option::is_none")] + pub has_wiki: Option, + /// either `true` to ignore whitespace for conflicts, or `false` to not ignore whitespace. `has_pull_requests` must be `true`. + #[serde(rename = "ignore_whitespace_conflicts", skip_serializing_if = "Option::is_none")] + pub ignore_whitespace_conflicts: Option, + #[serde(rename = "internal_tracker", skip_serializing_if = "Option::is_none")] + pub internal_tracker: Option>, + /// set to a string like `8h30m0s` to set the mirror interval time + #[serde(rename = "mirror_interval", skip_serializing_if = "Option::is_none")] + pub mirror_interval: Option, + /// name of the repository + #[serde(rename = "name", skip_serializing_if = "Option::is_none")] + pub name: Option, + /// either `true` to make the repository private or `false` to make it public. Note: you will get a 422 error if the organization restricts changing repository visibility to organization owners and a non-owner tries to change the value of private. + #[serde(rename = "private", skip_serializing_if = "Option::is_none")] + pub private: Option, + /// either `true` to make this repository a template or `false` to make it a normal repository + #[serde(rename = "template", skip_serializing_if = "Option::is_none")] + pub template: Option, + /// a URL with more information about the repository. + #[serde(rename = "website", skip_serializing_if = "Option::is_none")] + pub website: Option, +} + +impl EditRepoOption { + /// EditRepoOption options when editing a repository's properties + pub fn new() -> EditRepoOption { + EditRepoOption { + allow_manual_merge: None, + allow_merge_commits: None, + allow_rebase: None, + allow_rebase_explicit: None, + allow_rebase_update: None, + allow_squash_merge: None, + archived: None, + autodetect_manual_merge: None, + default_branch: None, + default_delete_branch_after_merge: None, + default_merge_style: None, + description: None, + enable_prune: None, + external_tracker: None, + external_wiki: None, + has_issues: None, + has_projects: None, + has_pull_requests: None, + has_wiki: None, + ignore_whitespace_conflicts: None, + internal_tracker: None, + mirror_interval: None, + name: None, + private: None, + template: None, + website: None, + } + } +} + + diff --git a/crates/gitea_raw_client/src/models/edit_team_option.rs b/crates/gitea_raw_client/src/models/edit_team_option.rs new file mode 100644 index 0000000..dfe1e3c --- /dev/null +++ b/crates/gitea_raw_client/src/models/edit_team_option.rs @@ -0,0 +1,64 @@ +/* + * Gitea API. + * + * This documentation describes the Gitea API. + * + * The version of the OpenAPI document: 1.17.3 + * + * Generated by: https://openapi-generator.tech + */ + +/// EditTeamOption : EditTeamOption options for editing a team + + + +#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)] +pub struct EditTeamOption { + #[serde(rename = "can_create_org_repo", skip_serializing_if = "Option::is_none")] + pub can_create_org_repo: Option, + #[serde(rename = "description", skip_serializing_if = "Option::is_none")] + pub description: Option, + #[serde(rename = "includes_all_repositories", skip_serializing_if = "Option::is_none")] + pub includes_all_repositories: Option, + #[serde(rename = "name")] + pub name: String, + #[serde(rename = "permission", skip_serializing_if = "Option::is_none")] + pub permission: Option, + #[serde(rename = "units", skip_serializing_if = "Option::is_none")] + pub units: Option>, + #[serde(rename = "units_map", skip_serializing_if = "Option::is_none")] + pub units_map: Option<::std::collections::HashMap>, +} + +impl EditTeamOption { + /// EditTeamOption options for editing a team + pub fn new(name: String) -> EditTeamOption { + EditTeamOption { + can_create_org_repo: None, + description: None, + includes_all_repositories: None, + name, + permission: None, + units: None, + units_map: None, + } + } +} + +/// +#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)] +pub enum Permission { + #[serde(rename = "read")] + Read, + #[serde(rename = "write")] + Write, + #[serde(rename = "admin")] + Admin, +} + +impl Default for Permission { + fn default() -> Permission { + Self::Read + } +} + diff --git a/crates/gitea_raw_client/src/models/edit_user_option.rs b/crates/gitea_raw_client/src/models/edit_user_option.rs new file mode 100644 index 0000000..6103654 --- /dev/null +++ b/crates/gitea_raw_client/src/models/edit_user_option.rs @@ -0,0 +1,81 @@ +/* + * Gitea API. + * + * This documentation describes the Gitea API. + * + * The version of the OpenAPI document: 1.17.3 + * + * Generated by: https://openapi-generator.tech + */ + +/// EditUserOption : EditUserOption edit user options + + + +#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)] +pub struct EditUserOption { + #[serde(rename = "active", skip_serializing_if = "Option::is_none")] + pub active: Option, + #[serde(rename = "admin", skip_serializing_if = "Option::is_none")] + pub admin: Option, + #[serde(rename = "allow_create_organization", skip_serializing_if = "Option::is_none")] + pub allow_create_organization: Option, + #[serde(rename = "allow_git_hook", skip_serializing_if = "Option::is_none")] + pub allow_git_hook: Option, + #[serde(rename = "allow_import_local", skip_serializing_if = "Option::is_none")] + pub allow_import_local: Option, + #[serde(rename = "description", skip_serializing_if = "Option::is_none")] + pub description: Option, + #[serde(rename = "email", skip_serializing_if = "Option::is_none")] + pub email: Option, + #[serde(rename = "full_name", skip_serializing_if = "Option::is_none")] + pub full_name: Option, + #[serde(rename = "location", skip_serializing_if = "Option::is_none")] + pub location: Option, + #[serde(rename = "login_name")] + pub login_name: String, + #[serde(rename = "max_repo_creation", skip_serializing_if = "Option::is_none")] + pub max_repo_creation: Option, + #[serde(rename = "must_change_password", skip_serializing_if = "Option::is_none")] + pub must_change_password: Option, + #[serde(rename = "password", skip_serializing_if = "Option::is_none")] + pub password: Option, + #[serde(rename = "prohibit_login", skip_serializing_if = "Option::is_none")] + pub prohibit_login: Option, + #[serde(rename = "restricted", skip_serializing_if = "Option::is_none")] + pub restricted: Option, + #[serde(rename = "source_id")] + pub source_id: i64, + #[serde(rename = "visibility", skip_serializing_if = "Option::is_none")] + pub visibility: Option, + #[serde(rename = "website", skip_serializing_if = "Option::is_none")] + pub website: Option, +} + +impl EditUserOption { + /// EditUserOption edit user options + pub fn new(login_name: String, source_id: i64) -> EditUserOption { + EditUserOption { + active: None, + admin: None, + allow_create_organization: None, + allow_git_hook: None, + allow_import_local: None, + description: None, + email: None, + full_name: None, + location: None, + login_name, + max_repo_creation: None, + must_change_password: None, + password: None, + prohibit_login: None, + restricted: None, + source_id, + visibility: None, + website: None, + } + } +} + + diff --git a/crates/gitea_raw_client/src/models/email.rs b/crates/gitea_raw_client/src/models/email.rs new file mode 100644 index 0000000..4a77ad1 --- /dev/null +++ b/crates/gitea_raw_client/src/models/email.rs @@ -0,0 +1,36 @@ +/* + * Gitea API. + * + * This documentation describes the Gitea API. + * + * The version of the OpenAPI document: 1.17.3 + * + * Generated by: https://openapi-generator.tech + */ + +/// Email : Email an email address belonging to a user + + + +#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)] +pub struct Email { + #[serde(rename = "email", skip_serializing_if = "Option::is_none")] + pub email: Option, + #[serde(rename = "primary", skip_serializing_if = "Option::is_none")] + pub primary: Option, + #[serde(rename = "verified", skip_serializing_if = "Option::is_none")] + pub verified: Option, +} + +impl Email { + /// Email an email address belonging to a user + pub fn new() -> Email { + Email { + email: None, + primary: None, + verified: None, + } + } +} + + diff --git a/crates/gitea_raw_client/src/models/external_tracker.rs b/crates/gitea_raw_client/src/models/external_tracker.rs new file mode 100644 index 0000000..5edb791 --- /dev/null +++ b/crates/gitea_raw_client/src/models/external_tracker.rs @@ -0,0 +1,39 @@ +/* + * Gitea API. + * + * This documentation describes the Gitea API. + * + * The version of the OpenAPI document: 1.17.3 + * + * Generated by: https://openapi-generator.tech + */ + +/// ExternalTracker : ExternalTracker represents settings for external tracker + + + +#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)] +pub struct ExternalTracker { + /// External Issue Tracker URL Format. Use the placeholders {user}, {repo} and {index} for the username, repository name and issue index. + #[serde(rename = "external_tracker_format", skip_serializing_if = "Option::is_none")] + pub external_tracker_format: Option, + /// External Issue Tracker Number Format, either `numeric` or `alphanumeric` + #[serde(rename = "external_tracker_style", skip_serializing_if = "Option::is_none")] + pub external_tracker_style: Option, + /// URL of external issue tracker. + #[serde(rename = "external_tracker_url", skip_serializing_if = "Option::is_none")] + pub external_tracker_url: Option, +} + +impl ExternalTracker { + /// ExternalTracker represents settings for external tracker + pub fn new() -> ExternalTracker { + ExternalTracker { + external_tracker_format: None, + external_tracker_style: None, + external_tracker_url: None, + } + } +} + + diff --git a/crates/gitea_raw_client/src/models/external_wiki.rs b/crates/gitea_raw_client/src/models/external_wiki.rs new file mode 100644 index 0000000..de8716e --- /dev/null +++ b/crates/gitea_raw_client/src/models/external_wiki.rs @@ -0,0 +1,31 @@ +/* + * Gitea API. + * + * This documentation describes the Gitea API. + * + * The version of the OpenAPI document: 1.17.3 + * + * Generated by: https://openapi-generator.tech + */ + +/// ExternalWiki : ExternalWiki represents setting for external wiki + + + +#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)] +pub struct ExternalWiki { + /// URL of external wiki. + #[serde(rename = "external_wiki_url", skip_serializing_if = "Option::is_none")] + pub external_wiki_url: Option, +} + +impl ExternalWiki { + /// ExternalWiki represents setting for external wiki + pub fn new() -> ExternalWiki { + ExternalWiki { + external_wiki_url: None, + } + } +} + + diff --git a/crates/gitea_raw_client/src/models/file_commit_response.rs b/crates/gitea_raw_client/src/models/file_commit_response.rs new file mode 100644 index 0000000..0d06e02 --- /dev/null +++ b/crates/gitea_raw_client/src/models/file_commit_response.rs @@ -0,0 +1,52 @@ +/* + * Gitea API. + * + * This documentation describes the Gitea API. + * + * The version of the OpenAPI document: 1.17.3 + * + * Generated by: https://openapi-generator.tech + */ + + + + +#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)] +pub struct FileCommitResponse { + #[serde(rename = "author", skip_serializing_if = "Option::is_none")] + pub author: Option>, + #[serde(rename = "committer", skip_serializing_if = "Option::is_none")] + pub committer: Option>, + #[serde(rename = "created", skip_serializing_if = "Option::is_none")] + pub created: Option, + #[serde(rename = "html_url", skip_serializing_if = "Option::is_none")] + pub html_url: Option, + #[serde(rename = "message", skip_serializing_if = "Option::is_none")] + pub message: Option, + #[serde(rename = "parents", skip_serializing_if = "Option::is_none")] + pub parents: Option>, + #[serde(rename = "sha", skip_serializing_if = "Option::is_none")] + pub sha: Option, + #[serde(rename = "tree", skip_serializing_if = "Option::is_none")] + pub tree: Option>, + #[serde(rename = "url", skip_serializing_if = "Option::is_none")] + pub url: Option, +} + +impl FileCommitResponse { + pub fn new() -> FileCommitResponse { + FileCommitResponse { + author: None, + committer: None, + created: None, + html_url: None, + message: None, + parents: None, + sha: None, + tree: None, + url: None, + } + } +} + + diff --git a/crates/gitea_raw_client/src/models/file_delete_response.rs b/crates/gitea_raw_client/src/models/file_delete_response.rs new file mode 100644 index 0000000..a99dfa6 --- /dev/null +++ b/crates/gitea_raw_client/src/models/file_delete_response.rs @@ -0,0 +1,36 @@ +/* + * Gitea API. + * + * This documentation describes the Gitea API. + * + * The version of the OpenAPI document: 1.17.3 + * + * Generated by: https://openapi-generator.tech + */ + +/// FileDeleteResponse : FileDeleteResponse contains information about a repo's file that was deleted + + + +#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)] +pub struct FileDeleteResponse { + #[serde(rename = "commit", skip_serializing_if = "Option::is_none")] + pub commit: Option>, + #[serde(rename = "content", skip_serializing_if = "Option::is_none")] + pub content: Option, + #[serde(rename = "verification", skip_serializing_if = "Option::is_none")] + pub verification: Option>, +} + +impl FileDeleteResponse { + /// FileDeleteResponse contains information about a repo's file that was deleted + pub fn new() -> FileDeleteResponse { + FileDeleteResponse { + commit: None, + content: None, + verification: None, + } + } +} + + diff --git a/crates/gitea_raw_client/src/models/file_links_response.rs b/crates/gitea_raw_client/src/models/file_links_response.rs new file mode 100644 index 0000000..6a7bf0f --- /dev/null +++ b/crates/gitea_raw_client/src/models/file_links_response.rs @@ -0,0 +1,36 @@ +/* + * Gitea API. + * + * This documentation describes the Gitea API. + * + * The version of the OpenAPI document: 1.17.3 + * + * Generated by: https://openapi-generator.tech + */ + +/// FileLinksResponse : FileLinksResponse contains the links for a repo's file + + + +#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)] +pub struct FileLinksResponse { + #[serde(rename = "git", skip_serializing_if = "Option::is_none")] + pub git: Option, + #[serde(rename = "html", skip_serializing_if = "Option::is_none")] + pub html: Option, + #[serde(rename = "self", skip_serializing_if = "Option::is_none")] + pub param_self: Option, +} + +impl FileLinksResponse { + /// FileLinksResponse contains the links for a repo's file + pub fn new() -> FileLinksResponse { + FileLinksResponse { + git: None, + html: None, + param_self: None, + } + } +} + + diff --git a/crates/gitea_raw_client/src/models/file_response.rs b/crates/gitea_raw_client/src/models/file_response.rs new file mode 100644 index 0000000..7f4ab96 --- /dev/null +++ b/crates/gitea_raw_client/src/models/file_response.rs @@ -0,0 +1,36 @@ +/* + * Gitea API. + * + * This documentation describes the Gitea API. + * + * The version of the OpenAPI document: 1.17.3 + * + * Generated by: https://openapi-generator.tech + */ + +/// FileResponse : FileResponse contains information about a repo's file + + + +#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)] +pub struct FileResponse { + #[serde(rename = "commit", skip_serializing_if = "Option::is_none")] + pub commit: Option>, + #[serde(rename = "content", skip_serializing_if = "Option::is_none")] + pub content: Option>, + #[serde(rename = "verification", skip_serializing_if = "Option::is_none")] + pub verification: Option>, +} + +impl FileResponse { + /// FileResponse contains information about a repo's file + pub fn new() -> FileResponse { + FileResponse { + commit: None, + content: None, + verification: None, + } + } +} + + diff --git a/crates/gitea_raw_client/src/models/general_api_settings.rs b/crates/gitea_raw_client/src/models/general_api_settings.rs new file mode 100644 index 0000000..8c1300b --- /dev/null +++ b/crates/gitea_raw_client/src/models/general_api_settings.rs @@ -0,0 +1,39 @@ +/* + * Gitea API. + * + * This documentation describes the Gitea API. + * + * The version of the OpenAPI document: 1.17.3 + * + * Generated by: https://openapi-generator.tech + */ + +/// GeneralApiSettings : GeneralAPISettings contains global api settings exposed by it + + + +#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)] +pub struct GeneralApiSettings { + #[serde(rename = "default_git_trees_per_page", skip_serializing_if = "Option::is_none")] + pub default_git_trees_per_page: Option, + #[serde(rename = "default_max_blob_size", skip_serializing_if = "Option::is_none")] + pub default_max_blob_size: Option, + #[serde(rename = "default_paging_num", skip_serializing_if = "Option::is_none")] + pub default_paging_num: Option, + #[serde(rename = "max_response_items", skip_serializing_if = "Option::is_none")] + pub max_response_items: Option, +} + +impl GeneralApiSettings { + /// GeneralAPISettings contains global api settings exposed by it + pub fn new() -> GeneralApiSettings { + GeneralApiSettings { + default_git_trees_per_page: None, + default_max_blob_size: None, + default_paging_num: None, + max_response_items: None, + } + } +} + + diff --git a/crates/gitea_raw_client/src/models/general_attachment_settings.rs b/crates/gitea_raw_client/src/models/general_attachment_settings.rs new file mode 100644 index 0000000..cc3dcab --- /dev/null +++ b/crates/gitea_raw_client/src/models/general_attachment_settings.rs @@ -0,0 +1,39 @@ +/* + * Gitea API. + * + * This documentation describes the Gitea API. + * + * The version of the OpenAPI document: 1.17.3 + * + * Generated by: https://openapi-generator.tech + */ + +/// GeneralAttachmentSettings : GeneralAttachmentSettings contains global Attachment settings exposed by API + + + +#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)] +pub struct GeneralAttachmentSettings { + #[serde(rename = "allowed_types", skip_serializing_if = "Option::is_none")] + pub allowed_types: Option, + #[serde(rename = "enabled", skip_serializing_if = "Option::is_none")] + pub enabled: Option, + #[serde(rename = "max_files", skip_serializing_if = "Option::is_none")] + pub max_files: Option, + #[serde(rename = "max_size", skip_serializing_if = "Option::is_none")] + pub max_size: Option, +} + +impl GeneralAttachmentSettings { + /// GeneralAttachmentSettings contains global Attachment settings exposed by API + pub fn new() -> GeneralAttachmentSettings { + GeneralAttachmentSettings { + allowed_types: None, + enabled: None, + max_files: None, + max_size: None, + } + } +} + + diff --git a/crates/gitea_raw_client/src/models/general_repo_settings.rs b/crates/gitea_raw_client/src/models/general_repo_settings.rs new file mode 100644 index 0000000..cb5599f --- /dev/null +++ b/crates/gitea_raw_client/src/models/general_repo_settings.rs @@ -0,0 +1,45 @@ +/* + * Gitea API. + * + * This documentation describes the Gitea API. + * + * The version of the OpenAPI document: 1.17.3 + * + * Generated by: https://openapi-generator.tech + */ + +/// GeneralRepoSettings : GeneralRepoSettings contains global repository settings exposed by API + + + +#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)] +pub struct GeneralRepoSettings { + #[serde(rename = "http_git_disabled", skip_serializing_if = "Option::is_none")] + pub http_git_disabled: Option, + #[serde(rename = "lfs_disabled", skip_serializing_if = "Option::is_none")] + pub lfs_disabled: Option, + #[serde(rename = "migrations_disabled", skip_serializing_if = "Option::is_none")] + pub migrations_disabled: Option, + #[serde(rename = "mirrors_disabled", skip_serializing_if = "Option::is_none")] + pub mirrors_disabled: Option, + #[serde(rename = "stars_disabled", skip_serializing_if = "Option::is_none")] + pub stars_disabled: Option, + #[serde(rename = "time_tracking_disabled", skip_serializing_if = "Option::is_none")] + pub time_tracking_disabled: Option, +} + +impl GeneralRepoSettings { + /// GeneralRepoSettings contains global repository settings exposed by API + pub fn new() -> GeneralRepoSettings { + GeneralRepoSettings { + http_git_disabled: None, + lfs_disabled: None, + migrations_disabled: None, + mirrors_disabled: None, + stars_disabled: None, + time_tracking_disabled: None, + } + } +} + + diff --git a/crates/gitea_raw_client/src/models/general_ui_settings.rs b/crates/gitea_raw_client/src/models/general_ui_settings.rs new file mode 100644 index 0000000..6db75e1 --- /dev/null +++ b/crates/gitea_raw_client/src/models/general_ui_settings.rs @@ -0,0 +1,36 @@ +/* + * Gitea API. + * + * This documentation describes the Gitea API. + * + * The version of the OpenAPI document: 1.17.3 + * + * Generated by: https://openapi-generator.tech + */ + +/// GeneralUiSettings : GeneralUISettings contains global ui settings exposed by API + + + +#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)] +pub struct GeneralUiSettings { + #[serde(rename = "allowed_reactions", skip_serializing_if = "Option::is_none")] + pub allowed_reactions: Option>, + #[serde(rename = "custom_emojis", skip_serializing_if = "Option::is_none")] + pub custom_emojis: Option>, + #[serde(rename = "default_theme", skip_serializing_if = "Option::is_none")] + pub default_theme: Option, +} + +impl GeneralUiSettings { + /// GeneralUISettings contains global ui settings exposed by API + pub fn new() -> GeneralUiSettings { + GeneralUiSettings { + allowed_reactions: None, + custom_emojis: None, + default_theme: None, + } + } +} + + diff --git a/crates/gitea_raw_client/src/models/generate_repo_option.rs b/crates/gitea_raw_client/src/models/generate_repo_option.rs new file mode 100644 index 0000000..f55ac22 --- /dev/null +++ b/crates/gitea_raw_client/src/models/generate_repo_option.rs @@ -0,0 +1,71 @@ +/* + * Gitea API. + * + * This documentation describes the Gitea API. + * + * The version of the OpenAPI document: 1.17.3 + * + * Generated by: https://openapi-generator.tech + */ + +/// GenerateRepoOption : GenerateRepoOption options when creating repository using a template + + + +#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)] +pub struct GenerateRepoOption { + /// include avatar of the template repo + #[serde(rename = "avatar", skip_serializing_if = "Option::is_none")] + pub avatar: Option, + /// Default branch of the new repository + #[serde(rename = "default_branch", skip_serializing_if = "Option::is_none")] + pub default_branch: Option, + /// Description of the repository to create + #[serde(rename = "description", skip_serializing_if = "Option::is_none")] + pub description: Option, + /// include git content of default branch in template repo + #[serde(rename = "git_content", skip_serializing_if = "Option::is_none")] + pub git_content: Option, + /// include git hooks in template repo + #[serde(rename = "git_hooks", skip_serializing_if = "Option::is_none")] + pub git_hooks: Option, + /// include labels in template repo + #[serde(rename = "labels", skip_serializing_if = "Option::is_none")] + pub labels: Option, + /// Name of the repository to create + #[serde(rename = "name")] + pub name: String, + /// The organization or person who will own the new repository + #[serde(rename = "owner")] + pub owner: String, + /// Whether the repository is private + #[serde(rename = "private", skip_serializing_if = "Option::is_none")] + pub private: Option, + /// include topics in template repo + #[serde(rename = "topics", skip_serializing_if = "Option::is_none")] + pub topics: Option, + /// include webhooks in template repo + #[serde(rename = "webhooks", skip_serializing_if = "Option::is_none")] + pub webhooks: Option, +} + +impl GenerateRepoOption { + /// GenerateRepoOption options when creating repository using a template + pub fn new(name: String, owner: String) -> GenerateRepoOption { + GenerateRepoOption { + avatar: None, + default_branch: None, + description: None, + git_content: None, + git_hooks: None, + labels: None, + name, + owner, + private: None, + topics: None, + webhooks: None, + } + } +} + + diff --git a/crates/gitea_raw_client/src/models/git_blob_response.rs b/crates/gitea_raw_client/src/models/git_blob_response.rs new file mode 100644 index 0000000..98b5e52 --- /dev/null +++ b/crates/gitea_raw_client/src/models/git_blob_response.rs @@ -0,0 +1,42 @@ +/* + * Gitea API. + * + * This documentation describes the Gitea API. + * + * The version of the OpenAPI document: 1.17.3 + * + * Generated by: https://openapi-generator.tech + */ + +/// GitBlobResponse : GitBlobResponse represents a git blob + + + +#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)] +pub struct GitBlobResponse { + #[serde(rename = "content", skip_serializing_if = "Option::is_none")] + pub content: Option, + #[serde(rename = "encoding", skip_serializing_if = "Option::is_none")] + pub encoding: Option, + #[serde(rename = "sha", skip_serializing_if = "Option::is_none")] + pub sha: Option, + #[serde(rename = "size", skip_serializing_if = "Option::is_none")] + pub size: Option, + #[serde(rename = "url", skip_serializing_if = "Option::is_none")] + pub url: Option, +} + +impl GitBlobResponse { + /// GitBlobResponse represents a git blob + pub fn new() -> GitBlobResponse { + GitBlobResponse { + content: None, + encoding: None, + sha: None, + size: None, + url: None, + } + } +} + + diff --git a/crates/gitea_raw_client/src/models/git_entry.rs b/crates/gitea_raw_client/src/models/git_entry.rs new file mode 100644 index 0000000..174e284 --- /dev/null +++ b/crates/gitea_raw_client/src/models/git_entry.rs @@ -0,0 +1,45 @@ +/* + * Gitea API. + * + * This documentation describes the Gitea API. + * + * The version of the OpenAPI document: 1.17.3 + * + * Generated by: https://openapi-generator.tech + */ + +/// GitEntry : GitEntry represents a git tree + + + +#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)] +pub struct GitEntry { + #[serde(rename = "mode", skip_serializing_if = "Option::is_none")] + pub mode: Option, + #[serde(rename = "path", skip_serializing_if = "Option::is_none")] + pub path: Option, + #[serde(rename = "sha", skip_serializing_if = "Option::is_none")] + pub sha: Option, + #[serde(rename = "size", skip_serializing_if = "Option::is_none")] + pub size: Option, + #[serde(rename = "type", skip_serializing_if = "Option::is_none")] + pub r#type: Option, + #[serde(rename = "url", skip_serializing_if = "Option::is_none")] + pub url: Option, +} + +impl GitEntry { + /// GitEntry represents a git tree + pub fn new() -> GitEntry { + GitEntry { + mode: None, + path: None, + sha: None, + size: None, + r#type: None, + url: None, + } + } +} + + diff --git a/crates/gitea_raw_client/src/models/git_hook.rs b/crates/gitea_raw_client/src/models/git_hook.rs new file mode 100644 index 0000000..698d28d --- /dev/null +++ b/crates/gitea_raw_client/src/models/git_hook.rs @@ -0,0 +1,36 @@ +/* + * Gitea API. + * + * This documentation describes the Gitea API. + * + * The version of the OpenAPI document: 1.17.3 + * + * Generated by: https://openapi-generator.tech + */ + +/// GitHook : GitHook represents a Git repository hook + + + +#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)] +pub struct GitHook { + #[serde(rename = "content", skip_serializing_if = "Option::is_none")] + pub content: Option, + #[serde(rename = "is_active", skip_serializing_if = "Option::is_none")] + pub is_active: Option, + #[serde(rename = "name", skip_serializing_if = "Option::is_none")] + pub name: Option, +} + +impl GitHook { + /// GitHook represents a Git repository hook + pub fn new() -> GitHook { + GitHook { + content: None, + is_active: None, + name: None, + } + } +} + + diff --git a/crates/gitea_raw_client/src/models/git_object.rs b/crates/gitea_raw_client/src/models/git_object.rs new file mode 100644 index 0000000..7669443 --- /dev/null +++ b/crates/gitea_raw_client/src/models/git_object.rs @@ -0,0 +1,34 @@ +/* + * Gitea API. + * + * This documentation describes the Gitea API. + * + * The version of the OpenAPI document: 1.17.3 + * + * Generated by: https://openapi-generator.tech + */ + + + + +#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)] +pub struct GitObject { + #[serde(rename = "sha", skip_serializing_if = "Option::is_none")] + pub sha: Option, + #[serde(rename = "type", skip_serializing_if = "Option::is_none")] + pub r#type: Option, + #[serde(rename = "url", skip_serializing_if = "Option::is_none")] + pub url: Option, +} + +impl GitObject { + pub fn new() -> GitObject { + GitObject { + sha: None, + r#type: None, + url: None, + } + } +} + + diff --git a/crates/gitea_raw_client/src/models/git_tree_response.rs b/crates/gitea_raw_client/src/models/git_tree_response.rs new file mode 100644 index 0000000..532c9c8 --- /dev/null +++ b/crates/gitea_raw_client/src/models/git_tree_response.rs @@ -0,0 +1,45 @@ +/* + * Gitea API. + * + * This documentation describes the Gitea API. + * + * The version of the OpenAPI document: 1.17.3 + * + * Generated by: https://openapi-generator.tech + */ + +/// GitTreeResponse : GitTreeResponse returns a git tree + + + +#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)] +pub struct GitTreeResponse { + #[serde(rename = "page", skip_serializing_if = "Option::is_none")] + pub page: Option, + #[serde(rename = "sha", skip_serializing_if = "Option::is_none")] + pub sha: Option, + #[serde(rename = "total_count", skip_serializing_if = "Option::is_none")] + pub total_count: Option, + #[serde(rename = "tree", skip_serializing_if = "Option::is_none")] + pub tree: Option>, + #[serde(rename = "truncated", skip_serializing_if = "Option::is_none")] + pub truncated: Option, + #[serde(rename = "url", skip_serializing_if = "Option::is_none")] + pub url: Option, +} + +impl GitTreeResponse { + /// GitTreeResponse returns a git tree + pub fn new() -> GitTreeResponse { + GitTreeResponse { + page: None, + sha: None, + total_count: None, + tree: None, + truncated: None, + url: None, + } + } +} + + diff --git a/crates/gitea_raw_client/src/models/gpg_key.rs b/crates/gitea_raw_client/src/models/gpg_key.rs new file mode 100644 index 0000000..6b59ea8 --- /dev/null +++ b/crates/gitea_raw_client/src/models/gpg_key.rs @@ -0,0 +1,66 @@ +/* + * Gitea API. + * + * This documentation describes the Gitea API. + * + * The version of the OpenAPI document: 1.17.3 + * + * Generated by: https://openapi-generator.tech + */ + +/// GpgKey : GPGKey a user GPG key to sign commit and tag in repository + + + +#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)] +pub struct GpgKey { + #[serde(rename = "can_certify", skip_serializing_if = "Option::is_none")] + pub can_certify: Option, + #[serde(rename = "can_encrypt_comms", skip_serializing_if = "Option::is_none")] + pub can_encrypt_comms: Option, + #[serde(rename = "can_encrypt_storage", skip_serializing_if = "Option::is_none")] + pub can_encrypt_storage: Option, + #[serde(rename = "can_sign", skip_serializing_if = "Option::is_none")] + pub can_sign: Option, + #[serde(rename = "created_at", skip_serializing_if = "Option::is_none")] + pub created_at: Option, + #[serde(rename = "emails", skip_serializing_if = "Option::is_none")] + pub emails: Option>, + #[serde(rename = "expires_at", skip_serializing_if = "Option::is_none")] + pub expires_at: Option, + #[serde(rename = "id", skip_serializing_if = "Option::is_none")] + pub id: Option, + #[serde(rename = "key_id", skip_serializing_if = "Option::is_none")] + pub key_id: Option, + #[serde(rename = "primary_key_id", skip_serializing_if = "Option::is_none")] + pub primary_key_id: Option, + #[serde(rename = "public_key", skip_serializing_if = "Option::is_none")] + pub public_key: Option, + #[serde(rename = "subkeys", skip_serializing_if = "Option::is_none")] + pub subkeys: Option>, + #[serde(rename = "verified", skip_serializing_if = "Option::is_none")] + pub verified: Option, +} + +impl GpgKey { + /// GPGKey a user GPG key to sign commit and tag in repository + pub fn new() -> GpgKey { + GpgKey { + can_certify: None, + can_encrypt_comms: None, + can_encrypt_storage: None, + can_sign: None, + created_at: None, + emails: None, + expires_at: None, + id: None, + key_id: None, + primary_key_id: None, + public_key: None, + subkeys: None, + verified: None, + } + } +} + + diff --git a/crates/gitea_raw_client/src/models/gpg_key_email.rs b/crates/gitea_raw_client/src/models/gpg_key_email.rs new file mode 100644 index 0000000..cac4f30 --- /dev/null +++ b/crates/gitea_raw_client/src/models/gpg_key_email.rs @@ -0,0 +1,33 @@ +/* + * Gitea API. + * + * This documentation describes the Gitea API. + * + * The version of the OpenAPI document: 1.17.3 + * + * Generated by: https://openapi-generator.tech + */ + +/// GpgKeyEmail : GPGKeyEmail an email attached to a GPGKey + + + +#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)] +pub struct GpgKeyEmail { + #[serde(rename = "email", skip_serializing_if = "Option::is_none")] + pub email: Option, + #[serde(rename = "verified", skip_serializing_if = "Option::is_none")] + pub verified: Option, +} + +impl GpgKeyEmail { + /// GPGKeyEmail an email attached to a GPGKey + pub fn new() -> GpgKeyEmail { + GpgKeyEmail { + email: None, + verified: None, + } + } +} + + diff --git a/crates/gitea_raw_client/src/models/hook.rs b/crates/gitea_raw_client/src/models/hook.rs new file mode 100644 index 0000000..4581c89 --- /dev/null +++ b/crates/gitea_raw_client/src/models/hook.rs @@ -0,0 +1,48 @@ +/* + * Gitea API. + * + * This documentation describes the Gitea API. + * + * The version of the OpenAPI document: 1.17.3 + * + * Generated by: https://openapi-generator.tech + */ + +/// Hook : Hook a hook is a web hook when one repository changed + + + +#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)] +pub struct Hook { + #[serde(rename = "active", skip_serializing_if = "Option::is_none")] + pub active: Option, + #[serde(rename = "config", skip_serializing_if = "Option::is_none")] + pub config: Option<::std::collections::HashMap>, + #[serde(rename = "created_at", skip_serializing_if = "Option::is_none")] + pub created_at: Option, + #[serde(rename = "events", skip_serializing_if = "Option::is_none")] + pub events: Option>, + #[serde(rename = "id", skip_serializing_if = "Option::is_none")] + pub id: Option, + #[serde(rename = "type", skip_serializing_if = "Option::is_none")] + pub r#type: Option, + #[serde(rename = "updated_at", skip_serializing_if = "Option::is_none")] + pub updated_at: Option, +} + +impl Hook { + /// Hook a hook is a web hook when one repository changed + pub fn new() -> Hook { + Hook { + active: None, + config: None, + created_at: None, + events: None, + id: None, + r#type: None, + updated_at: None, + } + } +} + + diff --git a/crates/gitea_raw_client/src/models/identity.rs b/crates/gitea_raw_client/src/models/identity.rs new file mode 100644 index 0000000..154643e --- /dev/null +++ b/crates/gitea_raw_client/src/models/identity.rs @@ -0,0 +1,33 @@ +/* + * Gitea API. + * + * This documentation describes the Gitea API. + * + * The version of the OpenAPI document: 1.17.3 + * + * Generated by: https://openapi-generator.tech + */ + +/// Identity : Identity for a person's identity like an author or committer + + + +#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)] +pub struct Identity { + #[serde(rename = "email", skip_serializing_if = "Option::is_none")] + pub email: Option, + #[serde(rename = "name", skip_serializing_if = "Option::is_none")] + pub name: Option, +} + +impl Identity { + /// Identity for a person's identity like an author or committer + pub fn new() -> Identity { + Identity { + email: None, + name: None, + } + } +} + + diff --git a/crates/gitea_raw_client/src/models/internal_tracker.rs b/crates/gitea_raw_client/src/models/internal_tracker.rs new file mode 100644 index 0000000..b4faea7 --- /dev/null +++ b/crates/gitea_raw_client/src/models/internal_tracker.rs @@ -0,0 +1,39 @@ +/* + * Gitea API. + * + * This documentation describes the Gitea API. + * + * The version of the OpenAPI document: 1.17.3 + * + * Generated by: https://openapi-generator.tech + */ + +/// InternalTracker : InternalTracker represents settings for internal tracker + + + +#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)] +pub struct InternalTracker { + /// Let only contributors track time (Built-in issue tracker) + #[serde(rename = "allow_only_contributors_to_track_time", skip_serializing_if = "Option::is_none")] + pub allow_only_contributors_to_track_time: Option, + /// Enable dependencies for issues and pull requests (Built-in issue tracker) + #[serde(rename = "enable_issue_dependencies", skip_serializing_if = "Option::is_none")] + pub enable_issue_dependencies: Option, + /// Enable time tracking (Built-in issue tracker) + #[serde(rename = "enable_time_tracker", skip_serializing_if = "Option::is_none")] + pub enable_time_tracker: Option, +} + +impl InternalTracker { + /// InternalTracker represents settings for internal tracker + pub fn new() -> InternalTracker { + InternalTracker { + allow_only_contributors_to_track_time: None, + enable_issue_dependencies: None, + enable_time_tracker: None, + } + } +} + + diff --git a/crates/gitea_raw_client/src/models/issue.rs b/crates/gitea_raw_client/src/models/issue.rs new file mode 100644 index 0000000..f6a7ad0 --- /dev/null +++ b/crates/gitea_raw_client/src/models/issue.rs @@ -0,0 +1,97 @@ +/* + * Gitea API. + * + * This documentation describes the Gitea API. + * + * The version of the OpenAPI document: 1.17.3 + * + * Generated by: https://openapi-generator.tech + */ + +/// Issue : Issue represents an issue in a repository + + + +#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)] +pub struct Issue { + #[serde(rename = "assignee", skip_serializing_if = "Option::is_none")] + pub assignee: Option>, + #[serde(rename = "assignees", skip_serializing_if = "Option::is_none")] + pub assignees: Option>, + #[serde(rename = "body", skip_serializing_if = "Option::is_none")] + pub body: Option, + #[serde(rename = "closed_at", skip_serializing_if = "Option::is_none")] + pub closed_at: Option, + #[serde(rename = "comments", skip_serializing_if = "Option::is_none")] + pub comments: Option, + #[serde(rename = "created_at", skip_serializing_if = "Option::is_none")] + pub created_at: Option, + #[serde(rename = "due_date", skip_serializing_if = "Option::is_none")] + pub due_date: Option, + #[serde(rename = "html_url", skip_serializing_if = "Option::is_none")] + pub html_url: Option, + #[serde(rename = "id", skip_serializing_if = "Option::is_none")] + pub id: Option, + #[serde(rename = "is_locked", skip_serializing_if = "Option::is_none")] + pub is_locked: Option, + #[serde(rename = "labels", skip_serializing_if = "Option::is_none")] + pub labels: Option>, + #[serde(rename = "milestone", skip_serializing_if = "Option::is_none")] + pub milestone: Option>, + #[serde(rename = "number", skip_serializing_if = "Option::is_none")] + pub number: Option, + #[serde(rename = "original_author", skip_serializing_if = "Option::is_none")] + pub original_author: Option, + #[serde(rename = "original_author_id", skip_serializing_if = "Option::is_none")] + pub original_author_id: Option, + #[serde(rename = "pull_request", skip_serializing_if = "Option::is_none")] + pub pull_request: Option>, + #[serde(rename = "ref", skip_serializing_if = "Option::is_none")] + pub r#ref: Option, + #[serde(rename = "repository", skip_serializing_if = "Option::is_none")] + pub repository: Option>, + /// StateType issue state type + #[serde(rename = "state", skip_serializing_if = "Option::is_none")] + pub state: Option, + #[serde(rename = "title", skip_serializing_if = "Option::is_none")] + pub title: Option, + #[serde(rename = "updated_at", skip_serializing_if = "Option::is_none")] + pub updated_at: Option, + #[serde(rename = "url", skip_serializing_if = "Option::is_none")] + pub url: Option, + #[serde(rename = "user", skip_serializing_if = "Option::is_none")] + pub user: Option>, +} + +impl Issue { + /// Issue represents an issue in a repository + pub fn new() -> Issue { + Issue { + assignee: None, + assignees: None, + body: None, + closed_at: None, + comments: None, + created_at: None, + due_date: None, + html_url: None, + id: None, + is_locked: None, + labels: None, + milestone: None, + number: None, + original_author: None, + original_author_id: None, + pull_request: None, + r#ref: None, + repository: None, + state: None, + title: None, + updated_at: None, + url: None, + user: None, + } + } +} + + diff --git a/crates/gitea_raw_client/src/models/issue_deadline.rs b/crates/gitea_raw_client/src/models/issue_deadline.rs new file mode 100644 index 0000000..f3fbd4a --- /dev/null +++ b/crates/gitea_raw_client/src/models/issue_deadline.rs @@ -0,0 +1,30 @@ +/* + * Gitea API. + * + * This documentation describes the Gitea API. + * + * The version of the OpenAPI document: 1.17.3 + * + * Generated by: https://openapi-generator.tech + */ + +/// IssueDeadline : IssueDeadline represents an issue deadline + + + +#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)] +pub struct IssueDeadline { + #[serde(rename = "due_date", skip_serializing_if = "Option::is_none")] + pub due_date: Option, +} + +impl IssueDeadline { + /// IssueDeadline represents an issue deadline + pub fn new() -> IssueDeadline { + IssueDeadline { + due_date: None, + } + } +} + + diff --git a/crates/gitea_raw_client/src/models/issue_labels_option.rs b/crates/gitea_raw_client/src/models/issue_labels_option.rs new file mode 100644 index 0000000..e29ad26 --- /dev/null +++ b/crates/gitea_raw_client/src/models/issue_labels_option.rs @@ -0,0 +1,31 @@ +/* + * Gitea API. + * + * This documentation describes the Gitea API. + * + * The version of the OpenAPI document: 1.17.3 + * + * Generated by: https://openapi-generator.tech + */ + +/// IssueLabelsOption : IssueLabelsOption a collection of labels + + + +#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)] +pub struct IssueLabelsOption { + /// list of label IDs + #[serde(rename = "labels", skip_serializing_if = "Option::is_none")] + pub labels: Option>, +} + +impl IssueLabelsOption { + /// IssueLabelsOption a collection of labels + pub fn new() -> IssueLabelsOption { + IssueLabelsOption { + labels: None, + } + } +} + + diff --git a/crates/gitea_raw_client/src/models/issue_template.rs b/crates/gitea_raw_client/src/models/issue_template.rs new file mode 100644 index 0000000..cbf34c9 --- /dev/null +++ b/crates/gitea_raw_client/src/models/issue_template.rs @@ -0,0 +1,48 @@ +/* + * Gitea API. + * + * This documentation describes the Gitea API. + * + * The version of the OpenAPI document: 1.17.3 + * + * Generated by: https://openapi-generator.tech + */ + +/// IssueTemplate : IssueTemplate represents an issue template for a repository + + + +#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)] +pub struct IssueTemplate { + #[serde(rename = "about", skip_serializing_if = "Option::is_none")] + pub about: Option, + #[serde(rename = "content", skip_serializing_if = "Option::is_none")] + pub content: Option, + #[serde(rename = "file_name", skip_serializing_if = "Option::is_none")] + pub file_name: Option, + #[serde(rename = "labels", skip_serializing_if = "Option::is_none")] + pub labels: Option>, + #[serde(rename = "name", skip_serializing_if = "Option::is_none")] + pub name: Option, + #[serde(rename = "ref", skip_serializing_if = "Option::is_none")] + pub r#ref: Option, + #[serde(rename = "title", skip_serializing_if = "Option::is_none")] + pub title: Option, +} + +impl IssueTemplate { + /// IssueTemplate represents an issue template for a repository + pub fn new() -> IssueTemplate { + IssueTemplate { + about: None, + content: None, + file_name: None, + labels: None, + name: None, + r#ref: None, + title: None, + } + } +} + + diff --git a/crates/gitea_raw_client/src/models/label.rs b/crates/gitea_raw_client/src/models/label.rs new file mode 100644 index 0000000..50733ed --- /dev/null +++ b/crates/gitea_raw_client/src/models/label.rs @@ -0,0 +1,42 @@ +/* + * Gitea API. + * + * This documentation describes the Gitea API. + * + * The version of the OpenAPI document: 1.17.3 + * + * Generated by: https://openapi-generator.tech + */ + +/// Label : Label a label to an issue or a pr + + + +#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)] +pub struct Label { + #[serde(rename = "color", skip_serializing_if = "Option::is_none")] + pub color: Option, + #[serde(rename = "description", skip_serializing_if = "Option::is_none")] + pub description: Option, + #[serde(rename = "id", skip_serializing_if = "Option::is_none")] + pub id: Option, + #[serde(rename = "name", skip_serializing_if = "Option::is_none")] + pub name: Option, + #[serde(rename = "url", skip_serializing_if = "Option::is_none")] + pub url: Option, +} + +impl Label { + /// Label a label to an issue or a pr + pub fn new() -> Label { + Label { + color: None, + description: None, + id: None, + name: None, + url: None, + } + } +} + + diff --git a/crates/gitea_raw_client/src/models/markdown_option.rs b/crates/gitea_raw_client/src/models/markdown_option.rs new file mode 100644 index 0000000..a78a686 --- /dev/null +++ b/crates/gitea_raw_client/src/models/markdown_option.rs @@ -0,0 +1,43 @@ +/* + * Gitea API. + * + * This documentation describes the Gitea API. + * + * The version of the OpenAPI document: 1.17.3 + * + * Generated by: https://openapi-generator.tech + */ + +/// MarkdownOption : MarkdownOption markdown options + + + +#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)] +pub struct MarkdownOption { + /// Context to render in: body + #[serde(rename = "Context", skip_serializing_if = "Option::is_none")] + pub context: Option, + /// Mode to render in: body + #[serde(rename = "Mode", skip_serializing_if = "Option::is_none")] + pub mode: Option, + /// Text markdown to render in: body + #[serde(rename = "Text", skip_serializing_if = "Option::is_none")] + pub text: Option, + /// Is it a wiki page ? in: body + #[serde(rename = "Wiki", skip_serializing_if = "Option::is_none")] + pub wiki: Option, +} + +impl MarkdownOption { + /// MarkdownOption markdown options + pub fn new() -> MarkdownOption { + MarkdownOption { + context: None, + mode: None, + text: None, + wiki: None, + } + } +} + + diff --git a/crates/gitea_raw_client/src/models/merge_pull_request_option.rs b/crates/gitea_raw_client/src/models/merge_pull_request_option.rs new file mode 100644 index 0000000..3bea9a3 --- /dev/null +++ b/crates/gitea_raw_client/src/models/merge_pull_request_option.rs @@ -0,0 +1,71 @@ +/* + * Gitea API. + * + * This documentation describes the Gitea API. + * + * The version of the OpenAPI document: 1.17.3 + * + * Generated by: https://openapi-generator.tech + */ + +/// MergePullRequestOption : MergePullRequestForm form for merging Pull Request + + + +#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)] +pub struct MergePullRequestOption { + #[serde(rename = "Do")] + pub r#do: RHashDo, + #[serde(rename = "MergeCommitID", skip_serializing_if = "Option::is_none")] + pub merge_commit_id: Option, + #[serde(rename = "MergeMessageField", skip_serializing_if = "Option::is_none")] + pub merge_message_field: Option, + #[serde(rename = "MergeTitleField", skip_serializing_if = "Option::is_none")] + pub merge_title_field: Option, + #[serde(rename = "delete_branch_after_merge", skip_serializing_if = "Option::is_none")] + pub delete_branch_after_merge: Option, + #[serde(rename = "force_merge", skip_serializing_if = "Option::is_none")] + pub force_merge: Option, + #[serde(rename = "head_commit_id", skip_serializing_if = "Option::is_none")] + pub head_commit_id: Option, + #[serde(rename = "merge_when_checks_succeed", skip_serializing_if = "Option::is_none")] + pub merge_when_checks_succeed: Option, +} + +impl MergePullRequestOption { + /// MergePullRequestForm form for merging Pull Request + pub fn new(r#do: RHashDo) -> MergePullRequestOption { + MergePullRequestOption { + r#do, + merge_commit_id: None, + merge_message_field: None, + merge_title_field: None, + delete_branch_after_merge: None, + force_merge: None, + head_commit_id: None, + merge_when_checks_succeed: None, + } + } +} + +/// +#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)] +pub enum RHashDo { + #[serde(rename = "merge")] + Merge, + #[serde(rename = "rebase")] + Rebase, + #[serde(rename = "rebase-merge")] + RebaseMerge, + #[serde(rename = "squash")] + Squash, + #[serde(rename = "manually-merged")] + ManuallyMerged, +} + +impl Default for RHashDo { + fn default() -> RHashDo { + Self::Merge + } +} + diff --git a/crates/gitea_raw_client/src/models/migrate_repo_form.rs b/crates/gitea_raw_client/src/models/migrate_repo_form.rs new file mode 100644 index 0000000..c91ff15 --- /dev/null +++ b/crates/gitea_raw_client/src/models/migrate_repo_form.rs @@ -0,0 +1,85 @@ +/* + * Gitea API. + * + * This documentation describes the Gitea API. + * + * The version of the OpenAPI document: 1.17.3 + * + * Generated by: https://openapi-generator.tech + */ + +/// MigrateRepoForm : MigrateRepoForm form for migrating repository this is used to interact with web ui + + + +#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)] +pub struct MigrateRepoForm { + #[serde(rename = "auth_password", skip_serializing_if = "Option::is_none")] + pub auth_password: Option, + #[serde(rename = "auth_token", skip_serializing_if = "Option::is_none")] + pub auth_token: Option, + #[serde(rename = "auth_username", skip_serializing_if = "Option::is_none")] + pub auth_username: Option, + #[serde(rename = "clone_addr")] + pub clone_addr: String, + #[serde(rename = "description", skip_serializing_if = "Option::is_none")] + pub description: Option, + #[serde(rename = "issues", skip_serializing_if = "Option::is_none")] + pub issues: Option, + #[serde(rename = "labels", skip_serializing_if = "Option::is_none")] + pub labels: Option, + #[serde(rename = "lfs", skip_serializing_if = "Option::is_none")] + pub lfs: Option, + #[serde(rename = "lfs_endpoint", skip_serializing_if = "Option::is_none")] + pub lfs_endpoint: Option, + #[serde(rename = "milestones", skip_serializing_if = "Option::is_none")] + pub milestones: Option, + #[serde(rename = "mirror", skip_serializing_if = "Option::is_none")] + pub mirror: Option, + #[serde(rename = "mirror_interval", skip_serializing_if = "Option::is_none")] + pub mirror_interval: Option, + #[serde(rename = "private", skip_serializing_if = "Option::is_none")] + pub private: Option, + #[serde(rename = "pull_requests", skip_serializing_if = "Option::is_none")] + pub pull_requests: Option, + #[serde(rename = "releases", skip_serializing_if = "Option::is_none")] + pub releases: Option, + #[serde(rename = "repo_name")] + pub repo_name: String, + /// GitServiceType represents a git service + #[serde(rename = "service", skip_serializing_if = "Option::is_none")] + pub service: Option, + #[serde(rename = "uid")] + pub uid: i64, + #[serde(rename = "wiki", skip_serializing_if = "Option::is_none")] + pub wiki: Option, +} + +impl MigrateRepoForm { + /// MigrateRepoForm form for migrating repository this is used to interact with web ui + pub fn new(clone_addr: String, repo_name: String, uid: i64) -> MigrateRepoForm { + MigrateRepoForm { + auth_password: None, + auth_token: None, + auth_username: None, + clone_addr, + description: None, + issues: None, + labels: None, + lfs: None, + lfs_endpoint: None, + milestones: None, + mirror: None, + mirror_interval: None, + private: None, + pull_requests: None, + releases: None, + repo_name, + service: None, + uid, + wiki: None, + } + } +} + + diff --git a/crates/gitea_raw_client/src/models/migrate_repo_options.rs b/crates/gitea_raw_client/src/models/migrate_repo_options.rs new file mode 100644 index 0000000..f35c116 --- /dev/null +++ b/crates/gitea_raw_client/src/models/migrate_repo_options.rs @@ -0,0 +1,107 @@ +/* + * Gitea API. + * + * This documentation describes the Gitea API. + * + * The version of the OpenAPI document: 1.17.3 + * + * Generated by: https://openapi-generator.tech + */ + +/// MigrateRepoOptions : MigrateRepoOptions options for migrating repository's this is used to interact with api v1 + + + +#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)] +pub struct MigrateRepoOptions { + #[serde(rename = "auth_password", skip_serializing_if = "Option::is_none")] + pub auth_password: Option, + #[serde(rename = "auth_token", skip_serializing_if = "Option::is_none")] + pub auth_token: Option, + #[serde(rename = "auth_username", skip_serializing_if = "Option::is_none")] + pub auth_username: Option, + #[serde(rename = "clone_addr")] + pub clone_addr: String, + #[serde(rename = "description", skip_serializing_if = "Option::is_none")] + pub description: Option, + #[serde(rename = "issues", skip_serializing_if = "Option::is_none")] + pub issues: Option, + #[serde(rename = "labels", skip_serializing_if = "Option::is_none")] + pub labels: Option, + #[serde(rename = "lfs", skip_serializing_if = "Option::is_none")] + pub lfs: Option, + #[serde(rename = "lfs_endpoint", skip_serializing_if = "Option::is_none")] + pub lfs_endpoint: Option, + #[serde(rename = "milestones", skip_serializing_if = "Option::is_none")] + pub milestones: Option, + #[serde(rename = "mirror", skip_serializing_if = "Option::is_none")] + pub mirror: Option, + #[serde(rename = "mirror_interval", skip_serializing_if = "Option::is_none")] + pub mirror_interval: Option, + #[serde(rename = "private", skip_serializing_if = "Option::is_none")] + pub private: Option, + #[serde(rename = "pull_requests", skip_serializing_if = "Option::is_none")] + pub pull_requests: Option, + #[serde(rename = "releases", skip_serializing_if = "Option::is_none")] + pub releases: Option, + #[serde(rename = "repo_name")] + pub repo_name: String, + /// Name of User or Organisation who will own Repo after migration + #[serde(rename = "repo_owner", skip_serializing_if = "Option::is_none")] + pub repo_owner: Option, + #[serde(rename = "service", skip_serializing_if = "Option::is_none")] + pub service: Option, + /// deprecated (only for backwards compatibility) + #[serde(rename = "uid", skip_serializing_if = "Option::is_none")] + pub uid: Option, + #[serde(rename = "wiki", skip_serializing_if = "Option::is_none")] + pub wiki: Option, +} + +impl MigrateRepoOptions { + /// MigrateRepoOptions options for migrating repository's this is used to interact with api v1 + pub fn new(clone_addr: String, repo_name: String) -> MigrateRepoOptions { + MigrateRepoOptions { + auth_password: None, + auth_token: None, + auth_username: None, + clone_addr, + description: None, + issues: None, + labels: None, + lfs: None, + lfs_endpoint: None, + milestones: None, + mirror: None, + mirror_interval: None, + private: None, + pull_requests: None, + releases: None, + repo_name, + repo_owner: None, + service: None, + uid: None, + wiki: None, + } + } +} + +/// +#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)] +pub enum Service { + #[serde(rename = "git")] + Git, + #[serde(rename = "github")] + Github, + #[serde(rename = "gitea")] + Gitea, + #[serde(rename = "gitlab")] + Gitlab, +} + +impl Default for Service { + fn default() -> Service { + Self::Git + } +} + diff --git a/crates/gitea_raw_client/src/models/milestone.rs b/crates/gitea_raw_client/src/models/milestone.rs new file mode 100644 index 0000000..7e7efa9 --- /dev/null +++ b/crates/gitea_raw_client/src/models/milestone.rs @@ -0,0 +1,58 @@ +/* + * Gitea API. + * + * This documentation describes the Gitea API. + * + * The version of the OpenAPI document: 1.17.3 + * + * Generated by: https://openapi-generator.tech + */ + +/// Milestone : Milestone milestone is a collection of issues on one repository + + + +#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)] +pub struct Milestone { + #[serde(rename = "closed_at", skip_serializing_if = "Option::is_none")] + pub closed_at: Option, + #[serde(rename = "closed_issues", skip_serializing_if = "Option::is_none")] + pub closed_issues: Option, + #[serde(rename = "created_at", skip_serializing_if = "Option::is_none")] + pub created_at: Option, + #[serde(rename = "description", skip_serializing_if = "Option::is_none")] + pub description: Option, + #[serde(rename = "due_on", skip_serializing_if = "Option::is_none")] + pub due_on: Option, + #[serde(rename = "id", skip_serializing_if = "Option::is_none")] + pub id: Option, + #[serde(rename = "open_issues", skip_serializing_if = "Option::is_none")] + pub open_issues: Option, + /// StateType issue state type + #[serde(rename = "state", skip_serializing_if = "Option::is_none")] + pub state: Option, + #[serde(rename = "title", skip_serializing_if = "Option::is_none")] + pub title: Option, + #[serde(rename = "updated_at", skip_serializing_if = "Option::is_none")] + pub updated_at: Option, +} + +impl Milestone { + /// Milestone milestone is a collection of issues on one repository + pub fn new() -> Milestone { + Milestone { + closed_at: None, + closed_issues: None, + created_at: None, + description: None, + due_on: None, + id: None, + open_issues: None, + state: None, + title: None, + updated_at: None, + } + } +} + + diff --git a/crates/gitea_raw_client/src/models/mod.rs b/crates/gitea_raw_client/src/models/mod.rs new file mode 100644 index 0000000..1c8602b --- /dev/null +++ b/crates/gitea_raw_client/src/models/mod.rs @@ -0,0 +1,308 @@ +pub mod access_token; +pub use self::access_token::AccessToken; +pub mod add_collaborator_option; +pub use self::add_collaborator_option::AddCollaboratorOption; +pub mod add_time_option; +pub use self::add_time_option::AddTimeOption; +pub mod annotated_tag; +pub use self::annotated_tag::AnnotatedTag; +pub mod annotated_tag_object; +pub use self::annotated_tag_object::AnnotatedTagObject; +pub mod api_error; +pub use self::api_error::ApiError; +pub mod attachment; +pub use self::attachment::Attachment; +pub mod branch; +pub use self::branch::Branch; +pub mod branch_protection; +pub use self::branch_protection::BranchProtection; +pub mod combined_status; +pub use self::combined_status::CombinedStatus; +pub mod comment; +pub use self::comment::Comment; +pub mod commit; +pub use self::commit::Commit; +pub mod commit_affected_files; +pub use self::commit_affected_files::CommitAffectedFiles; +pub mod commit_date_options; +pub use self::commit_date_options::CommitDateOptions; +pub mod commit_meta; +pub use self::commit_meta::CommitMeta; +pub mod commit_stats; +pub use self::commit_stats::CommitStats; +pub mod commit_status; +pub use self::commit_status::CommitStatus; +pub mod commit_user; +pub use self::commit_user::CommitUser; +pub mod contents_response; +pub use self::contents_response::ContentsResponse; +pub mod create_access_token_option; +pub use self::create_access_token_option::CreateAccessTokenOption; +pub mod create_branch_protection_option; +pub use self::create_branch_protection_option::CreateBranchProtectionOption; +pub mod create_branch_repo_option; +pub use self::create_branch_repo_option::CreateBranchRepoOption; +pub mod create_email_option; +pub use self::create_email_option::CreateEmailOption; +pub mod create_file_options; +pub use self::create_file_options::CreateFileOptions; +pub mod create_fork_option; +pub use self::create_fork_option::CreateForkOption; +pub mod create_gpg_key_option; +pub use self::create_gpg_key_option::CreateGpgKeyOption; +pub mod create_hook_option; +pub use self::create_hook_option::CreateHookOption; +pub mod create_issue_comment_option; +pub use self::create_issue_comment_option::CreateIssueCommentOption; +pub mod create_issue_option; +pub use self::create_issue_option::CreateIssueOption; +pub mod create_key_option; +pub use self::create_key_option::CreateKeyOption; +pub mod create_label_option; +pub use self::create_label_option::CreateLabelOption; +pub mod create_milestone_option; +pub use self::create_milestone_option::CreateMilestoneOption; +pub mod create_o_auth2_application_options; +pub use self::create_o_auth2_application_options::CreateOAuth2ApplicationOptions; +pub mod create_org_option; +pub use self::create_org_option::CreateOrgOption; +pub mod create_pull_request_option; +pub use self::create_pull_request_option::CreatePullRequestOption; +pub mod create_pull_review_comment; +pub use self::create_pull_review_comment::CreatePullReviewComment; +pub mod create_pull_review_options; +pub use self::create_pull_review_options::CreatePullReviewOptions; +pub mod create_release_option; +pub use self::create_release_option::CreateReleaseOption; +pub mod create_repo_option; +pub use self::create_repo_option::CreateRepoOption; +pub mod create_status_option; +pub use self::create_status_option::CreateStatusOption; +pub mod create_tag_option; +pub use self::create_tag_option::CreateTagOption; +pub mod create_team_option; +pub use self::create_team_option::CreateTeamOption; +pub mod create_user_option; +pub use self::create_user_option::CreateUserOption; +pub mod create_wiki_page_options; +pub use self::create_wiki_page_options::CreateWikiPageOptions; +pub mod cron; +pub use self::cron::Cron; +pub mod delete_email_option; +pub use self::delete_email_option::DeleteEmailOption; +pub mod delete_file_options; +pub use self::delete_file_options::DeleteFileOptions; +pub mod deploy_key; +pub use self::deploy_key::DeployKey; +pub mod dismiss_pull_review_options; +pub use self::dismiss_pull_review_options::DismissPullReviewOptions; +pub mod edit_attachment_options; +pub use self::edit_attachment_options::EditAttachmentOptions; +pub mod edit_branch_protection_option; +pub use self::edit_branch_protection_option::EditBranchProtectionOption; +pub mod edit_deadline_option; +pub use self::edit_deadline_option::EditDeadlineOption; +pub mod edit_git_hook_option; +pub use self::edit_git_hook_option::EditGitHookOption; +pub mod edit_hook_option; +pub use self::edit_hook_option::EditHookOption; +pub mod edit_issue_comment_option; +pub use self::edit_issue_comment_option::EditIssueCommentOption; +pub mod edit_issue_option; +pub use self::edit_issue_option::EditIssueOption; +pub mod edit_label_option; +pub use self::edit_label_option::EditLabelOption; +pub mod edit_milestone_option; +pub use self::edit_milestone_option::EditMilestoneOption; +pub mod edit_org_option; +pub use self::edit_org_option::EditOrgOption; +pub mod edit_pull_request_option; +pub use self::edit_pull_request_option::EditPullRequestOption; +pub mod edit_reaction_option; +pub use self::edit_reaction_option::EditReactionOption; +pub mod edit_release_option; +pub use self::edit_release_option::EditReleaseOption; +pub mod edit_repo_option; +pub use self::edit_repo_option::EditRepoOption; +pub mod edit_team_option; +pub use self::edit_team_option::EditTeamOption; +pub mod edit_user_option; +pub use self::edit_user_option::EditUserOption; +pub mod email; +pub use self::email::Email; +pub mod external_tracker; +pub use self::external_tracker::ExternalTracker; +pub mod external_wiki; +pub use self::external_wiki::ExternalWiki; +pub mod file_commit_response; +pub use self::file_commit_response::FileCommitResponse; +pub mod file_delete_response; +pub use self::file_delete_response::FileDeleteResponse; +pub mod file_links_response; +pub use self::file_links_response::FileLinksResponse; +pub mod file_response; +pub use self::file_response::FileResponse; +pub mod general_api_settings; +pub use self::general_api_settings::GeneralApiSettings; +pub mod general_attachment_settings; +pub use self::general_attachment_settings::GeneralAttachmentSettings; +pub mod general_repo_settings; +pub use self::general_repo_settings::GeneralRepoSettings; +pub mod general_ui_settings; +pub use self::general_ui_settings::GeneralUiSettings; +pub mod generate_repo_option; +pub use self::generate_repo_option::GenerateRepoOption; +pub mod git_blob_response; +pub use self::git_blob_response::GitBlobResponse; +pub mod git_entry; +pub use self::git_entry::GitEntry; +pub mod git_hook; +pub use self::git_hook::GitHook; +pub mod git_object; +pub use self::git_object::GitObject; +pub mod git_tree_response; +pub use self::git_tree_response::GitTreeResponse; +pub mod gpg_key; +pub use self::gpg_key::GpgKey; +pub mod gpg_key_email; +pub use self::gpg_key_email::GpgKeyEmail; +pub mod hook; +pub use self::hook::Hook; +pub mod identity; +pub use self::identity::Identity; +pub mod internal_tracker; +pub use self::internal_tracker::InternalTracker; +pub mod issue; +pub use self::issue::Issue; +pub mod issue_deadline; +pub use self::issue_deadline::IssueDeadline; +pub mod issue_labels_option; +pub use self::issue_labels_option::IssueLabelsOption; +pub mod issue_template; +pub use self::issue_template::IssueTemplate; +pub mod label; +pub use self::label::Label; +pub mod markdown_option; +pub use self::markdown_option::MarkdownOption; +pub mod merge_pull_request_option; +pub use self::merge_pull_request_option::MergePullRequestOption; +pub mod migrate_repo_form; +pub use self::migrate_repo_form::MigrateRepoForm; +pub mod migrate_repo_options; +pub use self::migrate_repo_options::MigrateRepoOptions; +pub mod milestone; +pub use self::milestone::Milestone; +pub mod node_info; +pub use self::node_info::NodeInfo; +pub mod node_info_services; +pub use self::node_info_services::NodeInfoServices; +pub mod node_info_software; +pub use self::node_info_software::NodeInfoSoftware; +pub mod node_info_usage; +pub use self::node_info_usage::NodeInfoUsage; +pub mod node_info_usage_users; +pub use self::node_info_usage_users::NodeInfoUsageUsers; +pub mod note; +pub use self::note::Note; +pub mod notification_count; +pub use self::notification_count::NotificationCount; +pub mod notification_subject; +pub use self::notification_subject::NotificationSubject; +pub mod notification_thread; +pub use self::notification_thread::NotificationThread; +pub mod o_auth2_application; +pub use self::o_auth2_application::OAuth2Application; +pub mod organization; +pub use self::organization::Organization; +pub mod organization_permissions; +pub use self::organization_permissions::OrganizationPermissions; +pub mod package; +pub use self::package::Package; +pub mod package_file; +pub use self::package_file::PackageFile; +pub mod payload_commit; +pub use self::payload_commit::PayloadCommit; +pub mod payload_commit_verification; +pub use self::payload_commit_verification::PayloadCommitVerification; +pub mod payload_user; +pub use self::payload_user::PayloadUser; +pub mod permission; +pub use self::permission::Permission; +pub mod pr_branch_info; +pub use self::pr_branch_info::PrBranchInfo; +pub mod public_key; +pub use self::public_key::PublicKey; +pub mod pull_request; +pub use self::pull_request::PullRequest; +pub mod pull_request_meta; +pub use self::pull_request_meta::PullRequestMeta; +pub mod pull_review; +pub use self::pull_review::PullReview; +pub mod pull_review_comment; +pub use self::pull_review_comment::PullReviewComment; +pub mod pull_review_request_options; +pub use self::pull_review_request_options::PullReviewRequestOptions; +pub mod reaction; +pub use self::reaction::Reaction; +pub mod reference; +pub use self::reference::Reference; +pub mod release; +pub use self::release::Release; +pub mod repo_collaborator_permission; +pub use self::repo_collaborator_permission::RepoCollaboratorPermission; +pub mod repo_commit; +pub use self::repo_commit::RepoCommit; +pub mod repo_topic_options; +pub use self::repo_topic_options::RepoTopicOptions; +pub mod repo_transfer; +pub use self::repo_transfer::RepoTransfer; +pub mod repository; +pub use self::repository::Repository; +pub mod repository_meta; +pub use self::repository_meta::RepositoryMeta; +pub mod search_results; +pub use self::search_results::SearchResults; +pub mod server_version; +pub use self::server_version::ServerVersion; +pub mod stop_watch; +pub use self::stop_watch::StopWatch; +pub mod submit_pull_review_options; +pub use self::submit_pull_review_options::SubmitPullReviewOptions; +pub mod tag; +pub use self::tag::Tag; +pub mod team; +pub use self::team::Team; +pub mod team_search_200_response; +pub use self::team_search_200_response::TeamSearch200Response; +pub mod timeline_comment; +pub use self::timeline_comment::TimelineComment; +pub mod topic_name; +pub use self::topic_name::TopicName; +pub mod topic_response; +pub use self::topic_response::TopicResponse; +pub mod tracked_time; +pub use self::tracked_time::TrackedTime; +pub mod transfer_repo_option; +pub use self::transfer_repo_option::TransferRepoOption; +pub mod update_file_options; +pub use self::update_file_options::UpdateFileOptions; +pub mod user; +pub use self::user::User; +pub mod user_heatmap_data; +pub use self::user_heatmap_data::UserHeatmapData; +pub mod user_search_200_response; +pub use self::user_search_200_response::UserSearch200Response; +pub mod user_settings; +pub use self::user_settings::UserSettings; +pub mod user_settings_options; +pub use self::user_settings_options::UserSettingsOptions; +pub mod watch_info; +pub use self::watch_info::WatchInfo; +pub mod wiki_commit; +pub use self::wiki_commit::WikiCommit; +pub mod wiki_commit_list; +pub use self::wiki_commit_list::WikiCommitList; +pub mod wiki_page; +pub use self::wiki_page::WikiPage; +pub mod wiki_page_meta_data; +pub use self::wiki_page_meta_data::WikiPageMetaData; diff --git a/crates/gitea_raw_client/src/models/node_info.rs b/crates/gitea_raw_client/src/models/node_info.rs new file mode 100644 index 0000000..b9a7a0f --- /dev/null +++ b/crates/gitea_raw_client/src/models/node_info.rs @@ -0,0 +1,48 @@ +/* + * Gitea API. + * + * This documentation describes the Gitea API. + * + * The version of the OpenAPI document: 1.17.3 + * + * Generated by: https://openapi-generator.tech + */ + +/// NodeInfo : NodeInfo contains standardized way of exposing metadata about a server running one of the distributed social networks + + + +#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)] +pub struct NodeInfo { + #[serde(rename = "metadata", skip_serializing_if = "Option::is_none")] + pub metadata: Option, + #[serde(rename = "openRegistrations", skip_serializing_if = "Option::is_none")] + pub open_registrations: Option, + #[serde(rename = "protocols", skip_serializing_if = "Option::is_none")] + pub protocols: Option>, + #[serde(rename = "services", skip_serializing_if = "Option::is_none")] + pub services: Option>, + #[serde(rename = "software", skip_serializing_if = "Option::is_none")] + pub software: Option>, + #[serde(rename = "usage", skip_serializing_if = "Option::is_none")] + pub usage: Option>, + #[serde(rename = "version", skip_serializing_if = "Option::is_none")] + pub version: Option, +} + +impl NodeInfo { + /// NodeInfo contains standardized way of exposing metadata about a server running one of the distributed social networks + pub fn new() -> NodeInfo { + NodeInfo { + metadata: None, + open_registrations: None, + protocols: None, + services: None, + software: None, + usage: None, + version: None, + } + } +} + + diff --git a/crates/gitea_raw_client/src/models/node_info_services.rs b/crates/gitea_raw_client/src/models/node_info_services.rs new file mode 100644 index 0000000..d3f0f61 --- /dev/null +++ b/crates/gitea_raw_client/src/models/node_info_services.rs @@ -0,0 +1,33 @@ +/* + * Gitea API. + * + * This documentation describes the Gitea API. + * + * The version of the OpenAPI document: 1.17.3 + * + * Generated by: https://openapi-generator.tech + */ + +/// NodeInfoServices : NodeInfoServices contains the third party sites this server can connect to via their application API + + + +#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)] +pub struct NodeInfoServices { + #[serde(rename = "inbound", skip_serializing_if = "Option::is_none")] + pub inbound: Option>, + #[serde(rename = "outbound", skip_serializing_if = "Option::is_none")] + pub outbound: Option>, +} + +impl NodeInfoServices { + /// NodeInfoServices contains the third party sites this server can connect to via their application API + pub fn new() -> NodeInfoServices { + NodeInfoServices { + inbound: None, + outbound: None, + } + } +} + + diff --git a/crates/gitea_raw_client/src/models/node_info_software.rs b/crates/gitea_raw_client/src/models/node_info_software.rs new file mode 100644 index 0000000..fe718ee --- /dev/null +++ b/crates/gitea_raw_client/src/models/node_info_software.rs @@ -0,0 +1,39 @@ +/* + * Gitea API. + * + * This documentation describes the Gitea API. + * + * The version of the OpenAPI document: 1.17.3 + * + * Generated by: https://openapi-generator.tech + */ + +/// NodeInfoSoftware : NodeInfoSoftware contains Metadata about server software in use + + + +#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)] +pub struct NodeInfoSoftware { + #[serde(rename = "homepage", skip_serializing_if = "Option::is_none")] + pub homepage: Option, + #[serde(rename = "name", skip_serializing_if = "Option::is_none")] + pub name: Option, + #[serde(rename = "repository", skip_serializing_if = "Option::is_none")] + pub repository: Option, + #[serde(rename = "version", skip_serializing_if = "Option::is_none")] + pub version: Option, +} + +impl NodeInfoSoftware { + /// NodeInfoSoftware contains Metadata about server software in use + pub fn new() -> NodeInfoSoftware { + NodeInfoSoftware { + homepage: None, + name: None, + repository: None, + version: None, + } + } +} + + diff --git a/crates/gitea_raw_client/src/models/node_info_usage.rs b/crates/gitea_raw_client/src/models/node_info_usage.rs new file mode 100644 index 0000000..e0ba0e3 --- /dev/null +++ b/crates/gitea_raw_client/src/models/node_info_usage.rs @@ -0,0 +1,36 @@ +/* + * Gitea API. + * + * This documentation describes the Gitea API. + * + * The version of the OpenAPI document: 1.17.3 + * + * Generated by: https://openapi-generator.tech + */ + +/// NodeInfoUsage : NodeInfoUsage contains usage statistics for this server + + + +#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)] +pub struct NodeInfoUsage { + #[serde(rename = "localComments", skip_serializing_if = "Option::is_none")] + pub local_comments: Option, + #[serde(rename = "localPosts", skip_serializing_if = "Option::is_none")] + pub local_posts: Option, + #[serde(rename = "users", skip_serializing_if = "Option::is_none")] + pub users: Option>, +} + +impl NodeInfoUsage { + /// NodeInfoUsage contains usage statistics for this server + pub fn new() -> NodeInfoUsage { + NodeInfoUsage { + local_comments: None, + local_posts: None, + users: None, + } + } +} + + diff --git a/crates/gitea_raw_client/src/models/node_info_usage_users.rs b/crates/gitea_raw_client/src/models/node_info_usage_users.rs new file mode 100644 index 0000000..441552c --- /dev/null +++ b/crates/gitea_raw_client/src/models/node_info_usage_users.rs @@ -0,0 +1,36 @@ +/* + * Gitea API. + * + * This documentation describes the Gitea API. + * + * The version of the OpenAPI document: 1.17.3 + * + * Generated by: https://openapi-generator.tech + */ + +/// NodeInfoUsageUsers : NodeInfoUsageUsers contains statistics about the users of this server + + + +#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)] +pub struct NodeInfoUsageUsers { + #[serde(rename = "activeHalfyear", skip_serializing_if = "Option::is_none")] + pub active_halfyear: Option, + #[serde(rename = "activeMonth", skip_serializing_if = "Option::is_none")] + pub active_month: Option, + #[serde(rename = "total", skip_serializing_if = "Option::is_none")] + pub total: Option, +} + +impl NodeInfoUsageUsers { + /// NodeInfoUsageUsers contains statistics about the users of this server + pub fn new() -> NodeInfoUsageUsers { + NodeInfoUsageUsers { + active_halfyear: None, + active_month: None, + total: None, + } + } +} + + diff --git a/crates/gitea_raw_client/src/models/note.rs b/crates/gitea_raw_client/src/models/note.rs new file mode 100644 index 0000000..9f16f89 --- /dev/null +++ b/crates/gitea_raw_client/src/models/note.rs @@ -0,0 +1,33 @@ +/* + * Gitea API. + * + * This documentation describes the Gitea API. + * + * The version of the OpenAPI document: 1.17.3 + * + * Generated by: https://openapi-generator.tech + */ + +/// Note : Note contains information related to a git note + + + +#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)] +pub struct Note { + #[serde(rename = "commit", skip_serializing_if = "Option::is_none")] + pub commit: Option>, + #[serde(rename = "message", skip_serializing_if = "Option::is_none")] + pub message: Option, +} + +impl Note { + /// Note contains information related to a git note + pub fn new() -> Note { + Note { + commit: None, + message: None, + } + } +} + + diff --git a/crates/gitea_raw_client/src/models/notification_count.rs b/crates/gitea_raw_client/src/models/notification_count.rs new file mode 100644 index 0000000..2937950 --- /dev/null +++ b/crates/gitea_raw_client/src/models/notification_count.rs @@ -0,0 +1,30 @@ +/* + * Gitea API. + * + * This documentation describes the Gitea API. + * + * The version of the OpenAPI document: 1.17.3 + * + * Generated by: https://openapi-generator.tech + */ + +/// NotificationCount : NotificationCount number of unread notifications + + + +#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)] +pub struct NotificationCount { + #[serde(rename = "new", skip_serializing_if = "Option::is_none")] + pub new: Option, +} + +impl NotificationCount { + /// NotificationCount number of unread notifications + pub fn new() -> NotificationCount { + NotificationCount { + new: None, + } + } +} + + diff --git a/crates/gitea_raw_client/src/models/notification_subject.rs b/crates/gitea_raw_client/src/models/notification_subject.rs new file mode 100644 index 0000000..42d8c87 --- /dev/null +++ b/crates/gitea_raw_client/src/models/notification_subject.rs @@ -0,0 +1,50 @@ +/* + * Gitea API. + * + * This documentation describes the Gitea API. + * + * The version of the OpenAPI document: 1.17.3 + * + * Generated by: https://openapi-generator.tech + */ + +/// NotificationSubject : NotificationSubject contains the notification subject (Issue/Pull/Commit) + + + +#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)] +pub struct NotificationSubject { + #[serde(rename = "html_url", skip_serializing_if = "Option::is_none")] + pub html_url: Option, + #[serde(rename = "latest_comment_html_url", skip_serializing_if = "Option::is_none")] + pub latest_comment_html_url: Option, + #[serde(rename = "latest_comment_url", skip_serializing_if = "Option::is_none")] + pub latest_comment_url: Option, + /// StateType issue state type + #[serde(rename = "state", skip_serializing_if = "Option::is_none")] + pub state: Option, + #[serde(rename = "title", skip_serializing_if = "Option::is_none")] + pub title: Option, + /// NotifySubjectType represent type of notification subject + #[serde(rename = "type", skip_serializing_if = "Option::is_none")] + pub r#type: Option, + #[serde(rename = "url", skip_serializing_if = "Option::is_none")] + pub url: Option, +} + +impl NotificationSubject { + /// NotificationSubject contains the notification subject (Issue/Pull/Commit) + pub fn new() -> NotificationSubject { + NotificationSubject { + html_url: None, + latest_comment_html_url: None, + latest_comment_url: None, + state: None, + title: None, + r#type: None, + url: None, + } + } +} + + diff --git a/crates/gitea_raw_client/src/models/notification_thread.rs b/crates/gitea_raw_client/src/models/notification_thread.rs new file mode 100644 index 0000000..5aa62b6 --- /dev/null +++ b/crates/gitea_raw_client/src/models/notification_thread.rs @@ -0,0 +1,48 @@ +/* + * Gitea API. + * + * This documentation describes the Gitea API. + * + * The version of the OpenAPI document: 1.17.3 + * + * Generated by: https://openapi-generator.tech + */ + +/// NotificationThread : NotificationThread expose Notification on API + + + +#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)] +pub struct NotificationThread { + #[serde(rename = "id", skip_serializing_if = "Option::is_none")] + pub id: Option, + #[serde(rename = "pinned", skip_serializing_if = "Option::is_none")] + pub pinned: Option, + #[serde(rename = "repository", skip_serializing_if = "Option::is_none")] + pub repository: Option>, + #[serde(rename = "subject", skip_serializing_if = "Option::is_none")] + pub subject: Option>, + #[serde(rename = "unread", skip_serializing_if = "Option::is_none")] + pub unread: Option, + #[serde(rename = "updated_at", skip_serializing_if = "Option::is_none")] + pub updated_at: Option, + #[serde(rename = "url", skip_serializing_if = "Option::is_none")] + pub url: Option, +} + +impl NotificationThread { + /// NotificationThread expose Notification on API + pub fn new() -> NotificationThread { + NotificationThread { + id: None, + pinned: None, + repository: None, + subject: None, + unread: None, + updated_at: None, + url: None, + } + } +} + + diff --git a/crates/gitea_raw_client/src/models/o_auth2_application.rs b/crates/gitea_raw_client/src/models/o_auth2_application.rs new file mode 100644 index 0000000..13dbce3 --- /dev/null +++ b/crates/gitea_raw_client/src/models/o_auth2_application.rs @@ -0,0 +1,43 @@ +/* + * Gitea API. + * + * This documentation describes the Gitea API. + * + * The version of the OpenAPI document: 1.17.3 + * + * Generated by: https://openapi-generator.tech + */ + + + + +#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)] +pub struct OAuth2Application { + #[serde(rename = "client_id", skip_serializing_if = "Option::is_none")] + pub client_id: Option, + #[serde(rename = "client_secret", skip_serializing_if = "Option::is_none")] + pub client_secret: Option, + #[serde(rename = "created", skip_serializing_if = "Option::is_none")] + pub created: Option, + #[serde(rename = "id", skip_serializing_if = "Option::is_none")] + pub id: Option, + #[serde(rename = "name", skip_serializing_if = "Option::is_none")] + pub name: Option, + #[serde(rename = "redirect_uris", skip_serializing_if = "Option::is_none")] + pub redirect_uris: Option>, +} + +impl OAuth2Application { + pub fn new() -> OAuth2Application { + OAuth2Application { + client_id: None, + client_secret: None, + created: None, + id: None, + name: None, + redirect_uris: None, + } + } +} + + diff --git a/crates/gitea_raw_client/src/models/organization.rs b/crates/gitea_raw_client/src/models/organization.rs new file mode 100644 index 0000000..4961212 --- /dev/null +++ b/crates/gitea_raw_client/src/models/organization.rs @@ -0,0 +1,54 @@ +/* + * Gitea API. + * + * This documentation describes the Gitea API. + * + * The version of the OpenAPI document: 1.17.3 + * + * Generated by: https://openapi-generator.tech + */ + +/// Organization : Organization represents an organization + + + +#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)] +pub struct Organization { + #[serde(rename = "avatar_url", skip_serializing_if = "Option::is_none")] + pub avatar_url: Option, + #[serde(rename = "description", skip_serializing_if = "Option::is_none")] + pub description: Option, + #[serde(rename = "full_name", skip_serializing_if = "Option::is_none")] + pub full_name: Option, + #[serde(rename = "id", skip_serializing_if = "Option::is_none")] + pub id: Option, + #[serde(rename = "location", skip_serializing_if = "Option::is_none")] + pub location: Option, + #[serde(rename = "repo_admin_change_team_access", skip_serializing_if = "Option::is_none")] + pub repo_admin_change_team_access: Option, + #[serde(rename = "username", skip_serializing_if = "Option::is_none")] + pub username: Option, + #[serde(rename = "visibility", skip_serializing_if = "Option::is_none")] + pub visibility: Option, + #[serde(rename = "website", skip_serializing_if = "Option::is_none")] + pub website: Option, +} + +impl Organization { + /// Organization represents an organization + pub fn new() -> Organization { + Organization { + avatar_url: None, + description: None, + full_name: None, + id: None, + location: None, + repo_admin_change_team_access: None, + username: None, + visibility: None, + website: None, + } + } +} + + diff --git a/crates/gitea_raw_client/src/models/organization_permissions.rs b/crates/gitea_raw_client/src/models/organization_permissions.rs new file mode 100644 index 0000000..99fa3e6 --- /dev/null +++ b/crates/gitea_raw_client/src/models/organization_permissions.rs @@ -0,0 +1,42 @@ +/* + * Gitea API. + * + * This documentation describes the Gitea API. + * + * The version of the OpenAPI document: 1.17.3 + * + * Generated by: https://openapi-generator.tech + */ + +/// OrganizationPermissions : OrganizationPermissions list different users permissions on an organization + + + +#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)] +pub struct OrganizationPermissions { + #[serde(rename = "can_create_repository", skip_serializing_if = "Option::is_none")] + pub can_create_repository: Option, + #[serde(rename = "can_read", skip_serializing_if = "Option::is_none")] + pub can_read: Option, + #[serde(rename = "can_write", skip_serializing_if = "Option::is_none")] + pub can_write: Option, + #[serde(rename = "is_admin", skip_serializing_if = "Option::is_none")] + pub is_admin: Option, + #[serde(rename = "is_owner", skip_serializing_if = "Option::is_none")] + pub is_owner: Option, +} + +impl OrganizationPermissions { + /// OrganizationPermissions list different users permissions on an organization + pub fn new() -> OrganizationPermissions { + OrganizationPermissions { + can_create_repository: None, + can_read: None, + can_write: None, + is_admin: None, + is_owner: None, + } + } +} + + diff --git a/crates/gitea_raw_client/src/models/package.rs b/crates/gitea_raw_client/src/models/package.rs new file mode 100644 index 0000000..f8b762c --- /dev/null +++ b/crates/gitea_raw_client/src/models/package.rs @@ -0,0 +1,51 @@ +/* + * Gitea API. + * + * This documentation describes the Gitea API. + * + * The version of the OpenAPI document: 1.17.3 + * + * Generated by: https://openapi-generator.tech + */ + +/// Package : Package represents a package + + + +#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)] +pub struct Package { + #[serde(rename = "created_at", skip_serializing_if = "Option::is_none")] + pub created_at: Option, + #[serde(rename = "creator", skip_serializing_if = "Option::is_none")] + pub creator: Option>, + #[serde(rename = "id", skip_serializing_if = "Option::is_none")] + pub id: Option, + #[serde(rename = "name", skip_serializing_if = "Option::is_none")] + pub name: Option, + #[serde(rename = "owner", skip_serializing_if = "Option::is_none")] + pub owner: Option>, + #[serde(rename = "repository", skip_serializing_if = "Option::is_none")] + pub repository: Option>, + #[serde(rename = "type", skip_serializing_if = "Option::is_none")] + pub r#type: Option, + #[serde(rename = "version", skip_serializing_if = "Option::is_none")] + pub version: Option, +} + +impl Package { + /// Package represents a package + pub fn new() -> Package { + Package { + created_at: None, + creator: None, + id: None, + name: None, + owner: None, + repository: None, + r#type: None, + version: None, + } + } +} + + diff --git a/crates/gitea_raw_client/src/models/package_file.rs b/crates/gitea_raw_client/src/models/package_file.rs new file mode 100644 index 0000000..a2eace1 --- /dev/null +++ b/crates/gitea_raw_client/src/models/package_file.rs @@ -0,0 +1,48 @@ +/* + * Gitea API. + * + * This documentation describes the Gitea API. + * + * The version of the OpenAPI document: 1.17.3 + * + * Generated by: https://openapi-generator.tech + */ + +/// PackageFile : PackageFile represents a package file + + + +#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)] +pub struct PackageFile { + #[serde(rename = "Size", skip_serializing_if = "Option::is_none")] + pub size: Option, + #[serde(rename = "id", skip_serializing_if = "Option::is_none")] + pub id: Option, + #[serde(rename = "md5", skip_serializing_if = "Option::is_none")] + pub md5: Option, + #[serde(rename = "name", skip_serializing_if = "Option::is_none")] + pub name: Option, + #[serde(rename = "sha1", skip_serializing_if = "Option::is_none")] + pub sha1: Option, + #[serde(rename = "sha256", skip_serializing_if = "Option::is_none")] + pub sha256: Option, + #[serde(rename = "sha512", skip_serializing_if = "Option::is_none")] + pub sha512: Option, +} + +impl PackageFile { + /// PackageFile represents a package file + pub fn new() -> PackageFile { + PackageFile { + size: None, + id: None, + md5: None, + name: None, + sha1: None, + sha256: None, + sha512: None, + } + } +} + + diff --git a/crates/gitea_raw_client/src/models/payload_commit.rs b/crates/gitea_raw_client/src/models/payload_commit.rs new file mode 100644 index 0000000..526c2b3 --- /dev/null +++ b/crates/gitea_raw_client/src/models/payload_commit.rs @@ -0,0 +1,58 @@ +/* + * Gitea API. + * + * This documentation describes the Gitea API. + * + * The version of the OpenAPI document: 1.17.3 + * + * Generated by: https://openapi-generator.tech + */ + +/// PayloadCommit : PayloadCommit represents a commit + + + +#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)] +pub struct PayloadCommit { + #[serde(rename = "added", skip_serializing_if = "Option::is_none")] + pub added: Option>, + #[serde(rename = "author", skip_serializing_if = "Option::is_none")] + pub author: Option>, + #[serde(rename = "committer", skip_serializing_if = "Option::is_none")] + pub committer: Option>, + /// sha1 hash of the commit + #[serde(rename = "id", skip_serializing_if = "Option::is_none")] + pub id: Option, + #[serde(rename = "message", skip_serializing_if = "Option::is_none")] + pub message: Option, + #[serde(rename = "modified", skip_serializing_if = "Option::is_none")] + pub modified: Option>, + #[serde(rename = "removed", skip_serializing_if = "Option::is_none")] + pub removed: Option>, + #[serde(rename = "timestamp", skip_serializing_if = "Option::is_none")] + pub timestamp: Option, + #[serde(rename = "url", skip_serializing_if = "Option::is_none")] + pub url: Option, + #[serde(rename = "verification", skip_serializing_if = "Option::is_none")] + pub verification: Option>, +} + +impl PayloadCommit { + /// PayloadCommit represents a commit + pub fn new() -> PayloadCommit { + PayloadCommit { + added: None, + author: None, + committer: None, + id: None, + message: None, + modified: None, + removed: None, + timestamp: None, + url: None, + verification: None, + } + } +} + + diff --git a/crates/gitea_raw_client/src/models/payload_commit_verification.rs b/crates/gitea_raw_client/src/models/payload_commit_verification.rs new file mode 100644 index 0000000..84e7c21 --- /dev/null +++ b/crates/gitea_raw_client/src/models/payload_commit_verification.rs @@ -0,0 +1,42 @@ +/* + * Gitea API. + * + * This documentation describes the Gitea API. + * + * The version of the OpenAPI document: 1.17.3 + * + * Generated by: https://openapi-generator.tech + */ + +/// PayloadCommitVerification : PayloadCommitVerification represents the GPG verification of a commit + + + +#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)] +pub struct PayloadCommitVerification { + #[serde(rename = "payload", skip_serializing_if = "Option::is_none")] + pub payload: Option, + #[serde(rename = "reason", skip_serializing_if = "Option::is_none")] + pub reason: Option, + #[serde(rename = "signature", skip_serializing_if = "Option::is_none")] + pub signature: Option, + #[serde(rename = "signer", skip_serializing_if = "Option::is_none")] + pub signer: Option>, + #[serde(rename = "verified", skip_serializing_if = "Option::is_none")] + pub verified: Option, +} + +impl PayloadCommitVerification { + /// PayloadCommitVerification represents the GPG verification of a commit + pub fn new() -> PayloadCommitVerification { + PayloadCommitVerification { + payload: None, + reason: None, + signature: None, + signer: None, + verified: None, + } + } +} + + diff --git a/crates/gitea_raw_client/src/models/payload_user.rs b/crates/gitea_raw_client/src/models/payload_user.rs new file mode 100644 index 0000000..ec23814 --- /dev/null +++ b/crates/gitea_raw_client/src/models/payload_user.rs @@ -0,0 +1,37 @@ +/* + * Gitea API. + * + * This documentation describes the Gitea API. + * + * The version of the OpenAPI document: 1.17.3 + * + * Generated by: https://openapi-generator.tech + */ + +/// PayloadUser : PayloadUser represents the author or committer of a commit + + + +#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)] +pub struct PayloadUser { + #[serde(rename = "email", skip_serializing_if = "Option::is_none")] + pub email: Option, + /// Full name of the commit author + #[serde(rename = "name", skip_serializing_if = "Option::is_none")] + pub name: Option, + #[serde(rename = "username", skip_serializing_if = "Option::is_none")] + pub username: Option, +} + +impl PayloadUser { + /// PayloadUser represents the author or committer of a commit + pub fn new() -> PayloadUser { + PayloadUser { + email: None, + name: None, + username: None, + } + } +} + + diff --git a/crates/gitea_raw_client/src/models/permission.rs b/crates/gitea_raw_client/src/models/permission.rs new file mode 100644 index 0000000..2becf2e --- /dev/null +++ b/crates/gitea_raw_client/src/models/permission.rs @@ -0,0 +1,36 @@ +/* + * Gitea API. + * + * This documentation describes the Gitea API. + * + * The version of the OpenAPI document: 1.17.3 + * + * Generated by: https://openapi-generator.tech + */ + +/// Permission : Permission represents a set of permissions + + + +#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)] +pub struct Permission { + #[serde(rename = "admin", skip_serializing_if = "Option::is_none")] + pub admin: Option, + #[serde(rename = "pull", skip_serializing_if = "Option::is_none")] + pub pull: Option, + #[serde(rename = "push", skip_serializing_if = "Option::is_none")] + pub push: Option, +} + +impl Permission { + /// Permission represents a set of permissions + pub fn new() -> Permission { + Permission { + admin: None, + pull: None, + push: None, + } + } +} + + diff --git a/crates/gitea_raw_client/src/models/pr_branch_info.rs b/crates/gitea_raw_client/src/models/pr_branch_info.rs new file mode 100644 index 0000000..feb3536 --- /dev/null +++ b/crates/gitea_raw_client/src/models/pr_branch_info.rs @@ -0,0 +1,42 @@ +/* + * Gitea API. + * + * This documentation describes the Gitea API. + * + * The version of the OpenAPI document: 1.17.3 + * + * Generated by: https://openapi-generator.tech + */ + +/// PrBranchInfo : PRBranchInfo information about a branch + + + +#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)] +pub struct PrBranchInfo { + #[serde(rename = "label", skip_serializing_if = "Option::is_none")] + pub label: Option, + #[serde(rename = "ref", skip_serializing_if = "Option::is_none")] + pub r#ref: Option, + #[serde(rename = "repo", skip_serializing_if = "Option::is_none")] + pub repo: Option>, + #[serde(rename = "repo_id", skip_serializing_if = "Option::is_none")] + pub repo_id: Option, + #[serde(rename = "sha", skip_serializing_if = "Option::is_none")] + pub sha: Option, +} + +impl PrBranchInfo { + /// PRBranchInfo information about a branch + pub fn new() -> PrBranchInfo { + PrBranchInfo { + label: None, + r#ref: None, + repo: None, + repo_id: None, + sha: None, + } + } +} + + diff --git a/crates/gitea_raw_client/src/models/public_key.rs b/crates/gitea_raw_client/src/models/public_key.rs new file mode 100644 index 0000000..39c5f85 --- /dev/null +++ b/crates/gitea_raw_client/src/models/public_key.rs @@ -0,0 +1,54 @@ +/* + * Gitea API. + * + * This documentation describes the Gitea API. + * + * The version of the OpenAPI document: 1.17.3 + * + * Generated by: https://openapi-generator.tech + */ + +/// PublicKey : PublicKey publickey is a user key to push code to repository + + + +#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)] +pub struct PublicKey { + #[serde(rename = "created_at", skip_serializing_if = "Option::is_none")] + pub created_at: Option, + #[serde(rename = "fingerprint", skip_serializing_if = "Option::is_none")] + pub fingerprint: Option, + #[serde(rename = "id", skip_serializing_if = "Option::is_none")] + pub id: Option, + #[serde(rename = "key", skip_serializing_if = "Option::is_none")] + pub key: Option, + #[serde(rename = "key_type", skip_serializing_if = "Option::is_none")] + pub key_type: Option, + #[serde(rename = "read_only", skip_serializing_if = "Option::is_none")] + pub read_only: Option, + #[serde(rename = "title", skip_serializing_if = "Option::is_none")] + pub title: Option, + #[serde(rename = "url", skip_serializing_if = "Option::is_none")] + pub url: Option, + #[serde(rename = "user", skip_serializing_if = "Option::is_none")] + pub user: Option>, +} + +impl PublicKey { + /// PublicKey publickey is a user key to push code to repository + pub fn new() -> PublicKey { + PublicKey { + created_at: None, + fingerprint: None, + id: None, + key: None, + key_type: None, + read_only: None, + title: None, + url: None, + user: None, + } + } +} + + diff --git a/crates/gitea_raw_client/src/models/pull_request.rs b/crates/gitea_raw_client/src/models/pull_request.rs new file mode 100644 index 0000000..34edbbe --- /dev/null +++ b/crates/gitea_raw_client/src/models/pull_request.rs @@ -0,0 +1,115 @@ +/* + * Gitea API. + * + * This documentation describes the Gitea API. + * + * The version of the OpenAPI document: 1.17.3 + * + * Generated by: https://openapi-generator.tech + */ + +/// PullRequest : PullRequest represents a pull request + + + +#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)] +pub struct PullRequest { + #[serde(rename = "allow_maintainer_edit", skip_serializing_if = "Option::is_none")] + pub allow_maintainer_edit: Option, + #[serde(rename = "assignee", skip_serializing_if = "Option::is_none")] + pub assignee: Option>, + #[serde(rename = "assignees", skip_serializing_if = "Option::is_none")] + pub assignees: Option>, + #[serde(rename = "base", skip_serializing_if = "Option::is_none")] + pub base: Option>, + #[serde(rename = "body", skip_serializing_if = "Option::is_none")] + pub body: Option, + #[serde(rename = "closed_at", skip_serializing_if = "Option::is_none")] + pub closed_at: Option, + #[serde(rename = "comments", skip_serializing_if = "Option::is_none")] + pub comments: Option, + #[serde(rename = "created_at", skip_serializing_if = "Option::is_none")] + pub created_at: Option, + #[serde(rename = "diff_url", skip_serializing_if = "Option::is_none")] + pub diff_url: Option, + #[serde(rename = "due_date", skip_serializing_if = "Option::is_none")] + pub due_date: Option, + #[serde(rename = "head", skip_serializing_if = "Option::is_none")] + pub head: Option>, + #[serde(rename = "html_url", skip_serializing_if = "Option::is_none")] + pub html_url: Option, + #[serde(rename = "id", skip_serializing_if = "Option::is_none")] + pub id: Option, + #[serde(rename = "is_locked", skip_serializing_if = "Option::is_none")] + pub is_locked: Option, + #[serde(rename = "labels", skip_serializing_if = "Option::is_none")] + pub labels: Option>, + #[serde(rename = "merge_base", skip_serializing_if = "Option::is_none")] + pub merge_base: Option, + #[serde(rename = "merge_commit_sha", skip_serializing_if = "Option::is_none")] + pub merge_commit_sha: Option, + #[serde(rename = "mergeable", skip_serializing_if = "Option::is_none")] + pub mergeable: Option, + #[serde(rename = "merged", skip_serializing_if = "Option::is_none")] + pub merged: Option, + #[serde(rename = "merged_at", skip_serializing_if = "Option::is_none")] + pub merged_at: Option, + #[serde(rename = "merged_by", skip_serializing_if = "Option::is_none")] + pub merged_by: Option>, + #[serde(rename = "milestone", skip_serializing_if = "Option::is_none")] + pub milestone: Option>, + #[serde(rename = "number", skip_serializing_if = "Option::is_none")] + pub number: Option, + #[serde(rename = "patch_url", skip_serializing_if = "Option::is_none")] + pub patch_url: Option, + /// StateType issue state type + #[serde(rename = "state", skip_serializing_if = "Option::is_none")] + pub state: Option, + #[serde(rename = "title", skip_serializing_if = "Option::is_none")] + pub title: Option, + #[serde(rename = "updated_at", skip_serializing_if = "Option::is_none")] + pub updated_at: Option, + #[serde(rename = "url", skip_serializing_if = "Option::is_none")] + pub url: Option, + #[serde(rename = "user", skip_serializing_if = "Option::is_none")] + pub user: Option>, +} + +impl PullRequest { + /// PullRequest represents a pull request + pub fn new() -> PullRequest { + PullRequest { + allow_maintainer_edit: None, + assignee: None, + assignees: None, + base: None, + body: None, + closed_at: None, + comments: None, + created_at: None, + diff_url: None, + due_date: None, + head: None, + html_url: None, + id: None, + is_locked: None, + labels: None, + merge_base: None, + merge_commit_sha: None, + mergeable: None, + merged: None, + merged_at: None, + merged_by: None, + milestone: None, + number: None, + patch_url: None, + state: None, + title: None, + updated_at: None, + url: None, + user: None, + } + } +} + + diff --git a/crates/gitea_raw_client/src/models/pull_request_meta.rs b/crates/gitea_raw_client/src/models/pull_request_meta.rs new file mode 100644 index 0000000..fcf0384 --- /dev/null +++ b/crates/gitea_raw_client/src/models/pull_request_meta.rs @@ -0,0 +1,33 @@ +/* + * Gitea API. + * + * This documentation describes the Gitea API. + * + * The version of the OpenAPI document: 1.17.3 + * + * Generated by: https://openapi-generator.tech + */ + +/// PullRequestMeta : PullRequestMeta PR info if an issue is a PR + + + +#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)] +pub struct PullRequestMeta { + #[serde(rename = "merged", skip_serializing_if = "Option::is_none")] + pub merged: Option, + #[serde(rename = "merged_at", skip_serializing_if = "Option::is_none")] + pub merged_at: Option, +} + +impl PullRequestMeta { + /// PullRequestMeta PR info if an issue is a PR + pub fn new() -> PullRequestMeta { + PullRequestMeta { + merged: None, + merged_at: None, + } + } +} + + diff --git a/crates/gitea_raw_client/src/models/pull_review.rs b/crates/gitea_raw_client/src/models/pull_review.rs new file mode 100644 index 0000000..a14d27a --- /dev/null +++ b/crates/gitea_raw_client/src/models/pull_review.rs @@ -0,0 +1,67 @@ +/* + * Gitea API. + * + * This documentation describes the Gitea API. + * + * The version of the OpenAPI document: 1.17.3 + * + * Generated by: https://openapi-generator.tech + */ + +/// PullReview : PullReview represents a pull request review + + + +#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)] +pub struct PullReview { + #[serde(rename = "body", skip_serializing_if = "Option::is_none")] + pub body: Option, + #[serde(rename = "comments_count", skip_serializing_if = "Option::is_none")] + pub comments_count: Option, + #[serde(rename = "commit_id", skip_serializing_if = "Option::is_none")] + pub commit_id: Option, + #[serde(rename = "dismissed", skip_serializing_if = "Option::is_none")] + pub dismissed: Option, + #[serde(rename = "html_url", skip_serializing_if = "Option::is_none")] + pub html_url: Option, + #[serde(rename = "id", skip_serializing_if = "Option::is_none")] + pub id: Option, + #[serde(rename = "official", skip_serializing_if = "Option::is_none")] + pub official: Option, + #[serde(rename = "pull_request_url", skip_serializing_if = "Option::is_none")] + pub pull_request_url: Option, + #[serde(rename = "stale", skip_serializing_if = "Option::is_none")] + pub stale: Option, + /// ReviewStateType review state type + #[serde(rename = "state", skip_serializing_if = "Option::is_none")] + pub state: Option, + #[serde(rename = "submitted_at", skip_serializing_if = "Option::is_none")] + pub submitted_at: Option, + #[serde(rename = "team", skip_serializing_if = "Option::is_none")] + pub team: Option>, + #[serde(rename = "user", skip_serializing_if = "Option::is_none")] + pub user: Option>, +} + +impl PullReview { + /// PullReview represents a pull request review + pub fn new() -> PullReview { + PullReview { + body: None, + comments_count: None, + commit_id: None, + dismissed: None, + html_url: None, + id: None, + official: None, + pull_request_url: None, + stale: None, + state: None, + submitted_at: None, + team: None, + user: None, + } + } +} + + diff --git a/crates/gitea_raw_client/src/models/pull_review_comment.rs b/crates/gitea_raw_client/src/models/pull_review_comment.rs new file mode 100644 index 0000000..743be66 --- /dev/null +++ b/crates/gitea_raw_client/src/models/pull_review_comment.rs @@ -0,0 +1,72 @@ +/* + * Gitea API. + * + * This documentation describes the Gitea API. + * + * The version of the OpenAPI document: 1.17.3 + * + * Generated by: https://openapi-generator.tech + */ + +/// PullReviewComment : PullReviewComment represents a comment on a pull request review + + + +#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)] +pub struct PullReviewComment { + #[serde(rename = "body", skip_serializing_if = "Option::is_none")] + pub body: Option, + #[serde(rename = "commit_id", skip_serializing_if = "Option::is_none")] + pub commit_id: Option, + #[serde(rename = "created_at", skip_serializing_if = "Option::is_none")] + pub created_at: Option, + #[serde(rename = "diff_hunk", skip_serializing_if = "Option::is_none")] + pub diff_hunk: Option, + #[serde(rename = "html_url", skip_serializing_if = "Option::is_none")] + pub html_url: Option, + #[serde(rename = "id", skip_serializing_if = "Option::is_none")] + pub id: Option, + #[serde(rename = "original_commit_id", skip_serializing_if = "Option::is_none")] + pub original_commit_id: Option, + #[serde(rename = "original_position", skip_serializing_if = "Option::is_none")] + pub original_position: Option, + #[serde(rename = "path", skip_serializing_if = "Option::is_none")] + pub path: Option, + #[serde(rename = "position", skip_serializing_if = "Option::is_none")] + pub position: Option, + #[serde(rename = "pull_request_review_id", skip_serializing_if = "Option::is_none")] + pub pull_request_review_id: Option, + #[serde(rename = "pull_request_url", skip_serializing_if = "Option::is_none")] + pub pull_request_url: Option, + #[serde(rename = "resolver", skip_serializing_if = "Option::is_none")] + pub resolver: Option>, + #[serde(rename = "updated_at", skip_serializing_if = "Option::is_none")] + pub updated_at: Option, + #[serde(rename = "user", skip_serializing_if = "Option::is_none")] + pub user: Option>, +} + +impl PullReviewComment { + /// PullReviewComment represents a comment on a pull request review + pub fn new() -> PullReviewComment { + PullReviewComment { + body: None, + commit_id: None, + created_at: None, + diff_hunk: None, + html_url: None, + id: None, + original_commit_id: None, + original_position: None, + path: None, + position: None, + pull_request_review_id: None, + pull_request_url: None, + resolver: None, + updated_at: None, + user: None, + } + } +} + + diff --git a/crates/gitea_raw_client/src/models/pull_review_request_options.rs b/crates/gitea_raw_client/src/models/pull_review_request_options.rs new file mode 100644 index 0000000..298a6d3 --- /dev/null +++ b/crates/gitea_raw_client/src/models/pull_review_request_options.rs @@ -0,0 +1,33 @@ +/* + * Gitea API. + * + * This documentation describes the Gitea API. + * + * The version of the OpenAPI document: 1.17.3 + * + * Generated by: https://openapi-generator.tech + */ + +/// PullReviewRequestOptions : PullReviewRequestOptions are options to add or remove pull review requests + + + +#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)] +pub struct PullReviewRequestOptions { + #[serde(rename = "reviewers", skip_serializing_if = "Option::is_none")] + pub reviewers: Option>, + #[serde(rename = "team_reviewers", skip_serializing_if = "Option::is_none")] + pub team_reviewers: Option>, +} + +impl PullReviewRequestOptions { + /// PullReviewRequestOptions are options to add or remove pull review requests + pub fn new() -> PullReviewRequestOptions { + PullReviewRequestOptions { + reviewers: None, + team_reviewers: None, + } + } +} + + diff --git a/crates/gitea_raw_client/src/models/reaction.rs b/crates/gitea_raw_client/src/models/reaction.rs new file mode 100644 index 0000000..3d92e17 --- /dev/null +++ b/crates/gitea_raw_client/src/models/reaction.rs @@ -0,0 +1,36 @@ +/* + * Gitea API. + * + * This documentation describes the Gitea API. + * + * The version of the OpenAPI document: 1.17.3 + * + * Generated by: https://openapi-generator.tech + */ + +/// Reaction : Reaction contain one reaction + + + +#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)] +pub struct Reaction { + #[serde(rename = "content", skip_serializing_if = "Option::is_none")] + pub content: Option, + #[serde(rename = "created_at", skip_serializing_if = "Option::is_none")] + pub created_at: Option, + #[serde(rename = "user", skip_serializing_if = "Option::is_none")] + pub user: Option>, +} + +impl Reaction { + /// Reaction contain one reaction + pub fn new() -> Reaction { + Reaction { + content: None, + created_at: None, + user: None, + } + } +} + + diff --git a/crates/gitea_raw_client/src/models/reference.rs b/crates/gitea_raw_client/src/models/reference.rs new file mode 100644 index 0000000..c5af8e4 --- /dev/null +++ b/crates/gitea_raw_client/src/models/reference.rs @@ -0,0 +1,34 @@ +/* + * Gitea API. + * + * This documentation describes the Gitea API. + * + * The version of the OpenAPI document: 1.17.3 + * + * Generated by: https://openapi-generator.tech + */ + + + + +#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)] +pub struct Reference { + #[serde(rename = "object", skip_serializing_if = "Option::is_none")] + pub object: Option>, + #[serde(rename = "ref", skip_serializing_if = "Option::is_none")] + pub r#ref: Option, + #[serde(rename = "url", skip_serializing_if = "Option::is_none")] + pub url: Option, +} + +impl Reference { + pub fn new() -> Reference { + Reference { + object: None, + r#ref: None, + url: None, + } + } +} + + diff --git a/crates/gitea_raw_client/src/models/release.rs b/crates/gitea_raw_client/src/models/release.rs new file mode 100644 index 0000000..e9619c8 --- /dev/null +++ b/crates/gitea_raw_client/src/models/release.rs @@ -0,0 +1,72 @@ +/* + * Gitea API. + * + * This documentation describes the Gitea API. + * + * The version of the OpenAPI document: 1.17.3 + * + * Generated by: https://openapi-generator.tech + */ + +/// Release : Release represents a repository release + + + +#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)] +pub struct Release { + #[serde(rename = "assets", skip_serializing_if = "Option::is_none")] + pub assets: Option>, + #[serde(rename = "author", skip_serializing_if = "Option::is_none")] + pub author: Option>, + #[serde(rename = "body", skip_serializing_if = "Option::is_none")] + pub body: Option, + #[serde(rename = "created_at", skip_serializing_if = "Option::is_none")] + pub created_at: Option, + #[serde(rename = "draft", skip_serializing_if = "Option::is_none")] + pub draft: Option, + #[serde(rename = "html_url", skip_serializing_if = "Option::is_none")] + pub html_url: Option, + #[serde(rename = "id", skip_serializing_if = "Option::is_none")] + pub id: Option, + #[serde(rename = "name", skip_serializing_if = "Option::is_none")] + pub name: Option, + #[serde(rename = "prerelease", skip_serializing_if = "Option::is_none")] + pub prerelease: Option, + #[serde(rename = "published_at", skip_serializing_if = "Option::is_none")] + pub published_at: Option, + #[serde(rename = "tag_name", skip_serializing_if = "Option::is_none")] + pub tag_name: Option, + #[serde(rename = "tarball_url", skip_serializing_if = "Option::is_none")] + pub tarball_url: Option, + #[serde(rename = "target_commitish", skip_serializing_if = "Option::is_none")] + pub target_commitish: Option, + #[serde(rename = "url", skip_serializing_if = "Option::is_none")] + pub url: Option, + #[serde(rename = "zipball_url", skip_serializing_if = "Option::is_none")] + pub zipball_url: Option, +} + +impl Release { + /// Release represents a repository release + pub fn new() -> Release { + Release { + assets: None, + author: None, + body: None, + created_at: None, + draft: None, + html_url: None, + id: None, + name: None, + prerelease: None, + published_at: None, + tag_name: None, + tarball_url: None, + target_commitish: None, + url: None, + zipball_url: None, + } + } +} + + diff --git a/crates/gitea_raw_client/src/models/repo_collaborator_permission.rs b/crates/gitea_raw_client/src/models/repo_collaborator_permission.rs new file mode 100644 index 0000000..dfa4364 --- /dev/null +++ b/crates/gitea_raw_client/src/models/repo_collaborator_permission.rs @@ -0,0 +1,36 @@ +/* + * Gitea API. + * + * This documentation describes the Gitea API. + * + * The version of the OpenAPI document: 1.17.3 + * + * Generated by: https://openapi-generator.tech + */ + +/// RepoCollaboratorPermission : RepoCollaboratorPermission to get repository permission for a collaborator + + + +#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)] +pub struct RepoCollaboratorPermission { + #[serde(rename = "permission", skip_serializing_if = "Option::is_none")] + pub permission: Option, + #[serde(rename = "role_name", skip_serializing_if = "Option::is_none")] + pub role_name: Option, + #[serde(rename = "user", skip_serializing_if = "Option::is_none")] + pub user: Option>, +} + +impl RepoCollaboratorPermission { + /// RepoCollaboratorPermission to get repository permission for a collaborator + pub fn new() -> RepoCollaboratorPermission { + RepoCollaboratorPermission { + permission: None, + role_name: None, + user: None, + } + } +} + + diff --git a/crates/gitea_raw_client/src/models/repo_commit.rs b/crates/gitea_raw_client/src/models/repo_commit.rs new file mode 100644 index 0000000..82161b2 --- /dev/null +++ b/crates/gitea_raw_client/src/models/repo_commit.rs @@ -0,0 +1,43 @@ +/* + * Gitea API. + * + * This documentation describes the Gitea API. + * + * The version of the OpenAPI document: 1.17.3 + * + * Generated by: https://openapi-generator.tech + */ + + + + +#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)] +pub struct RepoCommit { + #[serde(rename = "author", skip_serializing_if = "Option::is_none")] + pub author: Option>, + #[serde(rename = "committer", skip_serializing_if = "Option::is_none")] + pub committer: Option>, + #[serde(rename = "message", skip_serializing_if = "Option::is_none")] + pub message: Option, + #[serde(rename = "tree", skip_serializing_if = "Option::is_none")] + pub tree: Option>, + #[serde(rename = "url", skip_serializing_if = "Option::is_none")] + pub url: Option, + #[serde(rename = "verification", skip_serializing_if = "Option::is_none")] + pub verification: Option>, +} + +impl RepoCommit { + pub fn new() -> RepoCommit { + RepoCommit { + author: None, + committer: None, + message: None, + tree: None, + url: None, + verification: None, + } + } +} + + diff --git a/crates/gitea_raw_client/src/models/repo_topic_options.rs b/crates/gitea_raw_client/src/models/repo_topic_options.rs new file mode 100644 index 0000000..4aa58de --- /dev/null +++ b/crates/gitea_raw_client/src/models/repo_topic_options.rs @@ -0,0 +1,31 @@ +/* + * Gitea API. + * + * This documentation describes the Gitea API. + * + * The version of the OpenAPI document: 1.17.3 + * + * Generated by: https://openapi-generator.tech + */ + +/// RepoTopicOptions : RepoTopicOptions a collection of repo topic names + + + +#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)] +pub struct RepoTopicOptions { + /// list of topic names + #[serde(rename = "topics", skip_serializing_if = "Option::is_none")] + pub topics: Option>, +} + +impl RepoTopicOptions { + /// RepoTopicOptions a collection of repo topic names + pub fn new() -> RepoTopicOptions { + RepoTopicOptions { + topics: None, + } + } +} + + diff --git a/crates/gitea_raw_client/src/models/repo_transfer.rs b/crates/gitea_raw_client/src/models/repo_transfer.rs new file mode 100644 index 0000000..5cf7b86 --- /dev/null +++ b/crates/gitea_raw_client/src/models/repo_transfer.rs @@ -0,0 +1,36 @@ +/* + * Gitea API. + * + * This documentation describes the Gitea API. + * + * The version of the OpenAPI document: 1.17.3 + * + * Generated by: https://openapi-generator.tech + */ + +/// RepoTransfer : RepoTransfer represents a pending repo transfer + + + +#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)] +pub struct RepoTransfer { + #[serde(rename = "doer", skip_serializing_if = "Option::is_none")] + pub doer: Option>, + #[serde(rename = "recipient", skip_serializing_if = "Option::is_none")] + pub recipient: Option>, + #[serde(rename = "teams", skip_serializing_if = "Option::is_none")] + pub teams: Option>, +} + +impl RepoTransfer { + /// RepoTransfer represents a pending repo transfer + pub fn new() -> RepoTransfer { + RepoTransfer { + doer: None, + recipient: None, + teams: None, + } + } +} + + diff --git a/crates/gitea_raw_client/src/models/repository.rs b/crates/gitea_raw_client/src/models/repository.rs new file mode 100644 index 0000000..25a9005 --- /dev/null +++ b/crates/gitea_raw_client/src/models/repository.rs @@ -0,0 +1,171 @@ +/* + * Gitea API. + * + * This documentation describes the Gitea API. + * + * The version of the OpenAPI document: 1.17.3 + * + * Generated by: https://openapi-generator.tech + */ + +/// Repository : Repository represents a repository + + + +#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)] +pub struct Repository { + #[serde(rename = "allow_merge_commits", skip_serializing_if = "Option::is_none")] + pub allow_merge_commits: Option, + #[serde(rename = "allow_rebase", skip_serializing_if = "Option::is_none")] + pub allow_rebase: Option, + #[serde(rename = "allow_rebase_explicit", skip_serializing_if = "Option::is_none")] + pub allow_rebase_explicit: Option, + #[serde(rename = "allow_squash_merge", skip_serializing_if = "Option::is_none")] + pub allow_squash_merge: Option, + #[serde(rename = "archived", skip_serializing_if = "Option::is_none")] + pub archived: Option, + #[serde(rename = "avatar_url", skip_serializing_if = "Option::is_none")] + pub avatar_url: Option, + #[serde(rename = "clone_url", skip_serializing_if = "Option::is_none")] + pub clone_url: Option, + #[serde(rename = "created_at", skip_serializing_if = "Option::is_none")] + pub created_at: Option, + #[serde(rename = "default_branch", skip_serializing_if = "Option::is_none")] + pub default_branch: Option, + #[serde(rename = "default_merge_style", skip_serializing_if = "Option::is_none")] + pub default_merge_style: Option, + #[serde(rename = "description", skip_serializing_if = "Option::is_none")] + pub description: Option, + #[serde(rename = "empty", skip_serializing_if = "Option::is_none")] + pub empty: Option, + #[serde(rename = "external_tracker", skip_serializing_if = "Option::is_none")] + pub external_tracker: Option>, + #[serde(rename = "external_wiki", skip_serializing_if = "Option::is_none")] + pub external_wiki: Option>, + #[serde(rename = "fork", skip_serializing_if = "Option::is_none")] + pub fork: Option, + #[serde(rename = "forks_count", skip_serializing_if = "Option::is_none")] + pub forks_count: Option, + #[serde(rename = "full_name", skip_serializing_if = "Option::is_none")] + pub full_name: Option, + #[serde(rename = "has_issues", skip_serializing_if = "Option::is_none")] + pub has_issues: Option, + #[serde(rename = "has_projects", skip_serializing_if = "Option::is_none")] + pub has_projects: Option, + #[serde(rename = "has_pull_requests", skip_serializing_if = "Option::is_none")] + pub has_pull_requests: Option, + #[serde(rename = "has_wiki", skip_serializing_if = "Option::is_none")] + pub has_wiki: Option, + #[serde(rename = "html_url", skip_serializing_if = "Option::is_none")] + pub html_url: Option, + #[serde(rename = "id", skip_serializing_if = "Option::is_none")] + pub id: Option, + #[serde(rename = "ignore_whitespace_conflicts", skip_serializing_if = "Option::is_none")] + pub ignore_whitespace_conflicts: Option, + #[serde(rename = "internal", skip_serializing_if = "Option::is_none")] + pub internal: Option, + #[serde(rename = "internal_tracker", skip_serializing_if = "Option::is_none")] + pub internal_tracker: Option>, + #[serde(rename = "language", skip_serializing_if = "Option::is_none")] + pub language: Option, + #[serde(rename = "languages_url", skip_serializing_if = "Option::is_none")] + pub languages_url: Option, + #[serde(rename = "mirror", skip_serializing_if = "Option::is_none")] + pub mirror: Option, + #[serde(rename = "mirror_interval", skip_serializing_if = "Option::is_none")] + pub mirror_interval: Option, + #[serde(rename = "mirror_updated", skip_serializing_if = "Option::is_none")] + pub mirror_updated: Option, + #[serde(rename = "name", skip_serializing_if = "Option::is_none")] + pub name: Option, + #[serde(rename = "open_issues_count", skip_serializing_if = "Option::is_none")] + pub open_issues_count: Option, + #[serde(rename = "open_pr_counter", skip_serializing_if = "Option::is_none")] + pub open_pr_counter: Option, + #[serde(rename = "original_url", skip_serializing_if = "Option::is_none")] + pub original_url: Option, + #[serde(rename = "owner", skip_serializing_if = "Option::is_none")] + pub owner: Option>, + #[serde(rename = "parent", skip_serializing_if = "Option::is_none")] + pub parent: Option>, + #[serde(rename = "permissions", skip_serializing_if = "Option::is_none")] + pub permissions: Option>, + #[serde(rename = "private", skip_serializing_if = "Option::is_none")] + pub private: Option, + #[serde(rename = "release_counter", skip_serializing_if = "Option::is_none")] + pub release_counter: Option, + #[serde(rename = "repo_transfer", skip_serializing_if = "Option::is_none")] + pub repo_transfer: Option>, + #[serde(rename = "size", skip_serializing_if = "Option::is_none")] + pub size: Option, + #[serde(rename = "ssh_url", skip_serializing_if = "Option::is_none")] + pub ssh_url: Option, + #[serde(rename = "stars_count", skip_serializing_if = "Option::is_none")] + pub stars_count: Option, + #[serde(rename = "template", skip_serializing_if = "Option::is_none")] + pub template: Option, + #[serde(rename = "updated_at", skip_serializing_if = "Option::is_none")] + pub updated_at: Option, + #[serde(rename = "watchers_count", skip_serializing_if = "Option::is_none")] + pub watchers_count: Option, + #[serde(rename = "website", skip_serializing_if = "Option::is_none")] + pub website: Option, +} + +impl Repository { + /// Repository represents a repository + pub fn new() -> Repository { + Repository { + allow_merge_commits: None, + allow_rebase: None, + allow_rebase_explicit: None, + allow_squash_merge: None, + archived: None, + avatar_url: None, + clone_url: None, + created_at: None, + default_branch: None, + default_merge_style: None, + description: None, + empty: None, + external_tracker: None, + external_wiki: None, + fork: None, + forks_count: None, + full_name: None, + has_issues: None, + has_projects: None, + has_pull_requests: None, + has_wiki: None, + html_url: None, + id: None, + ignore_whitespace_conflicts: None, + internal: None, + internal_tracker: None, + language: None, + languages_url: None, + mirror: None, + mirror_interval: None, + mirror_updated: None, + name: None, + open_issues_count: None, + open_pr_counter: None, + original_url: None, + owner: None, + parent: None, + permissions: None, + private: None, + release_counter: None, + repo_transfer: None, + size: None, + ssh_url: None, + stars_count: None, + template: None, + updated_at: None, + watchers_count: None, + website: None, + } + } +} + + diff --git a/crates/gitea_raw_client/src/models/repository_meta.rs b/crates/gitea_raw_client/src/models/repository_meta.rs new file mode 100644 index 0000000..dc4a129 --- /dev/null +++ b/crates/gitea_raw_client/src/models/repository_meta.rs @@ -0,0 +1,39 @@ +/* + * Gitea API. + * + * This documentation describes the Gitea API. + * + * The version of the OpenAPI document: 1.17.3 + * + * Generated by: https://openapi-generator.tech + */ + +/// RepositoryMeta : RepositoryMeta basic repository information + + + +#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)] +pub struct RepositoryMeta { + #[serde(rename = "full_name", skip_serializing_if = "Option::is_none")] + pub full_name: Option, + #[serde(rename = "id", skip_serializing_if = "Option::is_none")] + pub id: Option, + #[serde(rename = "name", skip_serializing_if = "Option::is_none")] + pub name: Option, + #[serde(rename = "owner", skip_serializing_if = "Option::is_none")] + pub owner: Option, +} + +impl RepositoryMeta { + /// RepositoryMeta basic repository information + pub fn new() -> RepositoryMeta { + RepositoryMeta { + full_name: None, + id: None, + name: None, + owner: None, + } + } +} + + diff --git a/crates/gitea_raw_client/src/models/search_results.rs b/crates/gitea_raw_client/src/models/search_results.rs new file mode 100644 index 0000000..f5341d0 --- /dev/null +++ b/crates/gitea_raw_client/src/models/search_results.rs @@ -0,0 +1,33 @@ +/* + * Gitea API. + * + * This documentation describes the Gitea API. + * + * The version of the OpenAPI document: 1.17.3 + * + * Generated by: https://openapi-generator.tech + */ + +/// SearchResults : SearchResults results of a successful search + + + +#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)] +pub struct SearchResults { + #[serde(rename = "data", skip_serializing_if = "Option::is_none")] + pub data: Option>, + #[serde(rename = "ok", skip_serializing_if = "Option::is_none")] + pub ok: Option, +} + +impl SearchResults { + /// SearchResults results of a successful search + pub fn new() -> SearchResults { + SearchResults { + data: None, + ok: None, + } + } +} + + diff --git a/crates/gitea_raw_client/src/models/server_version.rs b/crates/gitea_raw_client/src/models/server_version.rs new file mode 100644 index 0000000..b41197d --- /dev/null +++ b/crates/gitea_raw_client/src/models/server_version.rs @@ -0,0 +1,30 @@ +/* + * Gitea API. + * + * This documentation describes the Gitea API. + * + * The version of the OpenAPI document: 1.17.3 + * + * Generated by: https://openapi-generator.tech + */ + +/// ServerVersion : ServerVersion wraps the version of the server + + + +#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)] +pub struct ServerVersion { + #[serde(rename = "version", skip_serializing_if = "Option::is_none")] + pub version: Option, +} + +impl ServerVersion { + /// ServerVersion wraps the version of the server + pub fn new() -> ServerVersion { + ServerVersion { + version: None, + } + } +} + + diff --git a/crates/gitea_raw_client/src/models/stop_watch.rs b/crates/gitea_raw_client/src/models/stop_watch.rs new file mode 100644 index 0000000..18d823a --- /dev/null +++ b/crates/gitea_raw_client/src/models/stop_watch.rs @@ -0,0 +1,48 @@ +/* + * Gitea API. + * + * This documentation describes the Gitea API. + * + * The version of the OpenAPI document: 1.17.3 + * + * Generated by: https://openapi-generator.tech + */ + +/// StopWatch : StopWatch represent a running stopwatch + + + +#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)] +pub struct StopWatch { + #[serde(rename = "created", skip_serializing_if = "Option::is_none")] + pub created: Option, + #[serde(rename = "duration", skip_serializing_if = "Option::is_none")] + pub duration: Option, + #[serde(rename = "issue_index", skip_serializing_if = "Option::is_none")] + pub issue_index: Option, + #[serde(rename = "issue_title", skip_serializing_if = "Option::is_none")] + pub issue_title: Option, + #[serde(rename = "repo_name", skip_serializing_if = "Option::is_none")] + pub repo_name: Option, + #[serde(rename = "repo_owner_name", skip_serializing_if = "Option::is_none")] + pub repo_owner_name: Option, + #[serde(rename = "seconds", skip_serializing_if = "Option::is_none")] + pub seconds: Option, +} + +impl StopWatch { + /// StopWatch represent a running stopwatch + pub fn new() -> StopWatch { + StopWatch { + created: None, + duration: None, + issue_index: None, + issue_title: None, + repo_name: None, + repo_owner_name: None, + seconds: None, + } + } +} + + diff --git a/crates/gitea_raw_client/src/models/submit_pull_review_options.rs b/crates/gitea_raw_client/src/models/submit_pull_review_options.rs new file mode 100644 index 0000000..519165b --- /dev/null +++ b/crates/gitea_raw_client/src/models/submit_pull_review_options.rs @@ -0,0 +1,34 @@ +/* + * Gitea API. + * + * This documentation describes the Gitea API. + * + * The version of the OpenAPI document: 1.17.3 + * + * Generated by: https://openapi-generator.tech + */ + +/// SubmitPullReviewOptions : SubmitPullReviewOptions are options to submit a pending pull review + + + +#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)] +pub struct SubmitPullReviewOptions { + #[serde(rename = "body", skip_serializing_if = "Option::is_none")] + pub body: Option, + /// ReviewStateType review state type + #[serde(rename = "event", skip_serializing_if = "Option::is_none")] + pub event: Option, +} + +impl SubmitPullReviewOptions { + /// SubmitPullReviewOptions are options to submit a pending pull review + pub fn new() -> SubmitPullReviewOptions { + SubmitPullReviewOptions { + body: None, + event: None, + } + } +} + + diff --git a/crates/gitea_raw_client/src/models/tag.rs b/crates/gitea_raw_client/src/models/tag.rs new file mode 100644 index 0000000..d4cb896 --- /dev/null +++ b/crates/gitea_raw_client/src/models/tag.rs @@ -0,0 +1,45 @@ +/* + * Gitea API. + * + * This documentation describes the Gitea API. + * + * The version of the OpenAPI document: 1.17.3 + * + * Generated by: https://openapi-generator.tech + */ + +/// Tag : Tag represents a repository tag + + + +#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)] +pub struct Tag { + #[serde(rename = "commit", skip_serializing_if = "Option::is_none")] + pub commit: Option>, + #[serde(rename = "id", skip_serializing_if = "Option::is_none")] + pub id: Option, + #[serde(rename = "message", skip_serializing_if = "Option::is_none")] + pub message: Option, + #[serde(rename = "name", skip_serializing_if = "Option::is_none")] + pub name: Option, + #[serde(rename = "tarball_url", skip_serializing_if = "Option::is_none")] + pub tarball_url: Option, + #[serde(rename = "zipball_url", skip_serializing_if = "Option::is_none")] + pub zipball_url: Option, +} + +impl Tag { + /// Tag represents a repository tag + pub fn new() -> Tag { + Tag { + commit: None, + id: None, + message: None, + name: None, + tarball_url: None, + zipball_url: None, + } + } +} + + diff --git a/crates/gitea_raw_client/src/models/team.rs b/crates/gitea_raw_client/src/models/team.rs new file mode 100644 index 0000000..0e1ff4f --- /dev/null +++ b/crates/gitea_raw_client/src/models/team.rs @@ -0,0 +1,74 @@ +/* + * Gitea API. + * + * This documentation describes the Gitea API. + * + * The version of the OpenAPI document: 1.17.3 + * + * Generated by: https://openapi-generator.tech + */ + +/// Team : Team represents a team in an organization + + + +#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)] +pub struct Team { + #[serde(rename = "can_create_org_repo", skip_serializing_if = "Option::is_none")] + pub can_create_org_repo: Option, + #[serde(rename = "description", skip_serializing_if = "Option::is_none")] + pub description: Option, + #[serde(rename = "id", skip_serializing_if = "Option::is_none")] + pub id: Option, + #[serde(rename = "includes_all_repositories", skip_serializing_if = "Option::is_none")] + pub includes_all_repositories: Option, + #[serde(rename = "name", skip_serializing_if = "Option::is_none")] + pub name: Option, + #[serde(rename = "organization", skip_serializing_if = "Option::is_none")] + pub organization: Option>, + #[serde(rename = "permission", skip_serializing_if = "Option::is_none")] + pub permission: Option, + #[serde(rename = "units", skip_serializing_if = "Option::is_none")] + pub units: Option>, + #[serde(rename = "units_map", skip_serializing_if = "Option::is_none")] + pub units_map: Option<::std::collections::HashMap>, +} + +impl Team { + /// Team represents a team in an organization + pub fn new() -> Team { + Team { + can_create_org_repo: None, + description: None, + id: None, + includes_all_repositories: None, + name: None, + organization: None, + permission: None, + units: None, + units_map: None, + } + } +} + +/// +#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)] +pub enum Permission { + #[serde(rename = "none")] + None, + #[serde(rename = "read")] + Read, + #[serde(rename = "write")] + Write, + #[serde(rename = "admin")] + Admin, + #[serde(rename = "owner")] + Owner, +} + +impl Default for Permission { + fn default() -> Permission { + Self::None + } +} + diff --git a/crates/gitea_raw_client/src/models/team_search_200_response.rs b/crates/gitea_raw_client/src/models/team_search_200_response.rs new file mode 100644 index 0000000..bf1006a --- /dev/null +++ b/crates/gitea_raw_client/src/models/team_search_200_response.rs @@ -0,0 +1,31 @@ +/* + * Gitea API. + * + * This documentation describes the Gitea API. + * + * The version of the OpenAPI document: 1.17.3 + * + * Generated by: https://openapi-generator.tech + */ + + + + +#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)] +pub struct TeamSearch200Response { + #[serde(rename = "data", skip_serializing_if = "Option::is_none")] + pub data: Option>, + #[serde(rename = "ok", skip_serializing_if = "Option::is_none")] + pub ok: Option, +} + +impl TeamSearch200Response { + pub fn new() -> TeamSearch200Response { + TeamSearch200Response { + data: None, + ok: None, + } + } +} + + diff --git a/crates/gitea_raw_client/src/models/timeline_comment.rs b/crates/gitea_raw_client/src/models/timeline_comment.rs new file mode 100644 index 0000000..728e321 --- /dev/null +++ b/crates/gitea_raw_client/src/models/timeline_comment.rs @@ -0,0 +1,116 @@ +/* + * Gitea API. + * + * This documentation describes the Gitea API. + * + * The version of the OpenAPI document: 1.17.3 + * + * Generated by: https://openapi-generator.tech + */ + +/// TimelineComment : TimelineComment represents a timeline comment (comment of any type) on a commit or issue + + + +#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)] +pub struct TimelineComment { + #[serde(rename = "assignee", skip_serializing_if = "Option::is_none")] + pub assignee: Option>, + #[serde(rename = "assignee_team", skip_serializing_if = "Option::is_none")] + pub assignee_team: Option>, + #[serde(rename = "body", skip_serializing_if = "Option::is_none")] + pub body: Option, + #[serde(rename = "created_at", skip_serializing_if = "Option::is_none")] + pub created_at: Option, + #[serde(rename = "dependent_issue", skip_serializing_if = "Option::is_none")] + pub dependent_issue: Option>, + #[serde(rename = "html_url", skip_serializing_if = "Option::is_none")] + pub html_url: Option, + #[serde(rename = "id", skip_serializing_if = "Option::is_none")] + pub id: Option, + #[serde(rename = "issue_url", skip_serializing_if = "Option::is_none")] + pub issue_url: Option, + #[serde(rename = "label", skip_serializing_if = "Option::is_none")] + pub label: Option>, + #[serde(rename = "milestone", skip_serializing_if = "Option::is_none")] + pub milestone: Option>, + #[serde(rename = "new_ref", skip_serializing_if = "Option::is_none")] + pub new_ref: Option, + #[serde(rename = "new_title", skip_serializing_if = "Option::is_none")] + pub new_title: Option, + #[serde(rename = "old_milestone", skip_serializing_if = "Option::is_none")] + pub old_milestone: Option>, + #[serde(rename = "old_project_id", skip_serializing_if = "Option::is_none")] + pub old_project_id: Option, + #[serde(rename = "old_ref", skip_serializing_if = "Option::is_none")] + pub old_ref: Option, + #[serde(rename = "old_title", skip_serializing_if = "Option::is_none")] + pub old_title: Option, + #[serde(rename = "project_id", skip_serializing_if = "Option::is_none")] + pub project_id: Option, + #[serde(rename = "pull_request_url", skip_serializing_if = "Option::is_none")] + pub pull_request_url: Option, + #[serde(rename = "ref_action", skip_serializing_if = "Option::is_none")] + pub ref_action: Option, + #[serde(rename = "ref_comment", skip_serializing_if = "Option::is_none")] + pub ref_comment: Option>, + /// commit SHA where issue/PR was referenced + #[serde(rename = "ref_commit_sha", skip_serializing_if = "Option::is_none")] + pub ref_commit_sha: Option, + #[serde(rename = "ref_issue", skip_serializing_if = "Option::is_none")] + pub ref_issue: Option>, + /// whether the assignees were removed or added + #[serde(rename = "removed_assignee", skip_serializing_if = "Option::is_none")] + pub removed_assignee: Option, + #[serde(rename = "resolve_doer", skip_serializing_if = "Option::is_none")] + pub resolve_doer: Option>, + #[serde(rename = "review_id", skip_serializing_if = "Option::is_none")] + pub review_id: Option, + #[serde(rename = "tracked_time", skip_serializing_if = "Option::is_none")] + pub tracked_time: Option>, + #[serde(rename = "type", skip_serializing_if = "Option::is_none")] + pub r#type: Option, + #[serde(rename = "updated_at", skip_serializing_if = "Option::is_none")] + pub updated_at: Option, + #[serde(rename = "user", skip_serializing_if = "Option::is_none")] + pub user: Option>, +} + +impl TimelineComment { + /// TimelineComment represents a timeline comment (comment of any type) on a commit or issue + pub fn new() -> TimelineComment { + TimelineComment { + assignee: None, + assignee_team: None, + body: None, + created_at: None, + dependent_issue: None, + html_url: None, + id: None, + issue_url: None, + label: None, + milestone: None, + new_ref: None, + new_title: None, + old_milestone: None, + old_project_id: None, + old_ref: None, + old_title: None, + project_id: None, + pull_request_url: None, + ref_action: None, + ref_comment: None, + ref_commit_sha: None, + ref_issue: None, + removed_assignee: None, + resolve_doer: None, + review_id: None, + tracked_time: None, + r#type: None, + updated_at: None, + user: None, + } + } +} + + diff --git a/crates/gitea_raw_client/src/models/topic_name.rs b/crates/gitea_raw_client/src/models/topic_name.rs new file mode 100644 index 0000000..945fa93 --- /dev/null +++ b/crates/gitea_raw_client/src/models/topic_name.rs @@ -0,0 +1,30 @@ +/* + * Gitea API. + * + * This documentation describes the Gitea API. + * + * The version of the OpenAPI document: 1.17.3 + * + * Generated by: https://openapi-generator.tech + */ + +/// TopicName : TopicName a list of repo topic names + + + +#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)] +pub struct TopicName { + #[serde(rename = "topics", skip_serializing_if = "Option::is_none")] + pub topics: Option>, +} + +impl TopicName { + /// TopicName a list of repo topic names + pub fn new() -> TopicName { + TopicName { + topics: None, + } + } +} + + diff --git a/crates/gitea_raw_client/src/models/topic_response.rs b/crates/gitea_raw_client/src/models/topic_response.rs new file mode 100644 index 0000000..70b19f5 --- /dev/null +++ b/crates/gitea_raw_client/src/models/topic_response.rs @@ -0,0 +1,42 @@ +/* + * Gitea API. + * + * This documentation describes the Gitea API. + * + * The version of the OpenAPI document: 1.17.3 + * + * Generated by: https://openapi-generator.tech + */ + +/// TopicResponse : TopicResponse for returning topics + + + +#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)] +pub struct TopicResponse { + #[serde(rename = "created", skip_serializing_if = "Option::is_none")] + pub created: Option, + #[serde(rename = "id", skip_serializing_if = "Option::is_none")] + pub id: Option, + #[serde(rename = "repo_count", skip_serializing_if = "Option::is_none")] + pub repo_count: Option, + #[serde(rename = "topic_name", skip_serializing_if = "Option::is_none")] + pub topic_name: Option, + #[serde(rename = "updated", skip_serializing_if = "Option::is_none")] + pub updated: Option, +} + +impl TopicResponse { + /// TopicResponse for returning topics + pub fn new() -> TopicResponse { + TopicResponse { + created: None, + id: None, + repo_count: None, + topic_name: None, + updated: None, + } + } +} + + diff --git a/crates/gitea_raw_client/src/models/tracked_time.rs b/crates/gitea_raw_client/src/models/tracked_time.rs new file mode 100644 index 0000000..d39e1c1 --- /dev/null +++ b/crates/gitea_raw_client/src/models/tracked_time.rs @@ -0,0 +1,51 @@ +/* + * Gitea API. + * + * This documentation describes the Gitea API. + * + * The version of the OpenAPI document: 1.17.3 + * + * Generated by: https://openapi-generator.tech + */ + +/// TrackedTime : TrackedTime worked time for an issue / pr + + + +#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)] +pub struct TrackedTime { + #[serde(rename = "created", skip_serializing_if = "Option::is_none")] + pub created: Option, + #[serde(rename = "id", skip_serializing_if = "Option::is_none")] + pub id: Option, + #[serde(rename = "issue", skip_serializing_if = "Option::is_none")] + pub issue: Option>, + /// deprecated (only for backwards compatibility) + #[serde(rename = "issue_id", skip_serializing_if = "Option::is_none")] + pub issue_id: Option, + /// Time in seconds + #[serde(rename = "time", skip_serializing_if = "Option::is_none")] + pub time: Option, + /// deprecated (only for backwards compatibility) + #[serde(rename = "user_id", skip_serializing_if = "Option::is_none")] + pub user_id: Option, + #[serde(rename = "user_name", skip_serializing_if = "Option::is_none")] + pub user_name: Option, +} + +impl TrackedTime { + /// TrackedTime worked time for an issue / pr + pub fn new() -> TrackedTime { + TrackedTime { + created: None, + id: None, + issue: None, + issue_id: None, + time: None, + user_id: None, + user_name: None, + } + } +} + + diff --git a/crates/gitea_raw_client/src/models/transfer_repo_option.rs b/crates/gitea_raw_client/src/models/transfer_repo_option.rs new file mode 100644 index 0000000..e9af6ce --- /dev/null +++ b/crates/gitea_raw_client/src/models/transfer_repo_option.rs @@ -0,0 +1,34 @@ +/* + * Gitea API. + * + * This documentation describes the Gitea API. + * + * The version of the OpenAPI document: 1.17.3 + * + * Generated by: https://openapi-generator.tech + */ + +/// TransferRepoOption : TransferRepoOption options when transfer a repository's ownership + + + +#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)] +pub struct TransferRepoOption { + #[serde(rename = "new_owner")] + pub new_owner: String, + /// ID of the team or teams to add to the repository. Teams can only be added to organization-owned repositories. + #[serde(rename = "team_ids", skip_serializing_if = "Option::is_none")] + pub team_ids: Option>, +} + +impl TransferRepoOption { + /// TransferRepoOption options when transfer a repository's ownership + pub fn new(new_owner: String) -> TransferRepoOption { + TransferRepoOption { + new_owner, + team_ids: None, + } + } +} + + diff --git a/crates/gitea_raw_client/src/models/update_file_options.rs b/crates/gitea_raw_client/src/models/update_file_options.rs new file mode 100644 index 0000000..34e71bd --- /dev/null +++ b/crates/gitea_raw_client/src/models/update_file_options.rs @@ -0,0 +1,64 @@ +/* + * Gitea API. + * + * This documentation describes the Gitea API. + * + * The version of the OpenAPI document: 1.17.3 + * + * Generated by: https://openapi-generator.tech + */ + +/// UpdateFileOptions : UpdateFileOptions options for updating files Note: `author` and `committer` are optional (if only one is given, it will be used for the other, otherwise the authenticated user will be used) + + + +#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)] +pub struct UpdateFileOptions { + #[serde(rename = "author", skip_serializing_if = "Option::is_none")] + pub author: Option>, + /// branch (optional) to base this file from. if not given, the default branch is used + #[serde(rename = "branch", skip_serializing_if = "Option::is_none")] + pub branch: Option, + #[serde(rename = "committer", skip_serializing_if = "Option::is_none")] + pub committer: Option>, + /// content must be base64 encoded + #[serde(rename = "content")] + pub content: String, + #[serde(rename = "dates", skip_serializing_if = "Option::is_none")] + pub dates: Option>, + /// from_path (optional) is the path of the original file which will be moved/renamed to the path in the URL + #[serde(rename = "from_path", skip_serializing_if = "Option::is_none")] + pub from_path: Option, + /// message (optional) for the commit of this file. if not supplied, a default message will be used + #[serde(rename = "message", skip_serializing_if = "Option::is_none")] + pub message: Option, + /// new_branch (optional) will make a new branch from `branch` before creating the file + #[serde(rename = "new_branch", skip_serializing_if = "Option::is_none")] + pub new_branch: Option, + /// sha is the SHA for the file that already exists + #[serde(rename = "sha")] + pub sha: String, + /// Add a Signed-off-by trailer by the committer at the end of the commit log message. + #[serde(rename = "signoff", skip_serializing_if = "Option::is_none")] + pub signoff: Option, +} + +impl UpdateFileOptions { + /// UpdateFileOptions options for updating files Note: `author` and `committer` are optional (if only one is given, it will be used for the other, otherwise the authenticated user will be used) + pub fn new(content: String, sha: String) -> UpdateFileOptions { + UpdateFileOptions { + author: None, + branch: None, + committer: None, + content, + dates: None, + from_path: None, + message: None, + new_branch: None, + sha, + signoff: None, + } + } +} + + diff --git a/crates/gitea_raw_client/src/models/user.rs b/crates/gitea_raw_client/src/models/user.rs new file mode 100644 index 0000000..cd86949 --- /dev/null +++ b/crates/gitea_raw_client/src/models/user.rs @@ -0,0 +1,98 @@ +/* + * Gitea API. + * + * This documentation describes the Gitea API. + * + * The version of the OpenAPI document: 1.17.3 + * + * Generated by: https://openapi-generator.tech + */ + +/// User : User represents a user + + + +#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)] +pub struct User { + /// Is user active + #[serde(rename = "active", skip_serializing_if = "Option::is_none")] + pub active: Option, + /// URL to the user's avatar + #[serde(rename = "avatar_url", skip_serializing_if = "Option::is_none")] + pub avatar_url: Option, + #[serde(rename = "created", skip_serializing_if = "Option::is_none")] + pub created: Option, + /// the user's description + #[serde(rename = "description", skip_serializing_if = "Option::is_none")] + pub description: Option, + #[serde(rename = "email", skip_serializing_if = "Option::is_none")] + pub email: Option, + /// user counts + #[serde(rename = "followers_count", skip_serializing_if = "Option::is_none")] + pub followers_count: Option, + #[serde(rename = "following_count", skip_serializing_if = "Option::is_none")] + pub following_count: Option, + /// the user's full name + #[serde(rename = "full_name", skip_serializing_if = "Option::is_none")] + pub full_name: Option, + /// the user's id + #[serde(rename = "id", skip_serializing_if = "Option::is_none")] + pub id: Option, + /// Is the user an administrator + #[serde(rename = "is_admin", skip_serializing_if = "Option::is_none")] + pub is_admin: Option, + /// User locale + #[serde(rename = "language", skip_serializing_if = "Option::is_none")] + pub language: Option, + #[serde(rename = "last_login", skip_serializing_if = "Option::is_none")] + pub last_login: Option, + /// the user's location + #[serde(rename = "location", skip_serializing_if = "Option::is_none")] + pub location: Option, + /// the user's username + #[serde(rename = "login", skip_serializing_if = "Option::is_none")] + pub login: Option, + /// Is user login prohibited + #[serde(rename = "prohibit_login", skip_serializing_if = "Option::is_none")] + pub prohibit_login: Option, + /// Is user restricted + #[serde(rename = "restricted", skip_serializing_if = "Option::is_none")] + pub restricted: Option, + #[serde(rename = "starred_repos_count", skip_serializing_if = "Option::is_none")] + pub starred_repos_count: Option, + /// User visibility level option: public, limited, private + #[serde(rename = "visibility", skip_serializing_if = "Option::is_none")] + pub visibility: Option, + /// the user's website + #[serde(rename = "website", skip_serializing_if = "Option::is_none")] + pub website: Option, +} + +impl User { + /// User represents a user + pub fn new() -> User { + User { + active: None, + avatar_url: None, + created: None, + description: None, + email: None, + followers_count: None, + following_count: None, + full_name: None, + id: None, + is_admin: None, + language: None, + last_login: None, + location: None, + login: None, + prohibit_login: None, + restricted: None, + starred_repos_count: None, + visibility: None, + website: None, + } + } +} + + diff --git a/crates/gitea_raw_client/src/models/user_heatmap_data.rs b/crates/gitea_raw_client/src/models/user_heatmap_data.rs new file mode 100644 index 0000000..9a937df --- /dev/null +++ b/crates/gitea_raw_client/src/models/user_heatmap_data.rs @@ -0,0 +1,34 @@ +/* + * Gitea API. + * + * This documentation describes the Gitea API. + * + * The version of the OpenAPI document: 1.17.3 + * + * Generated by: https://openapi-generator.tech + */ + +/// UserHeatmapData : UserHeatmapData represents the data needed to create a heatmap + + + +#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)] +pub struct UserHeatmapData { + #[serde(rename = "contributions", skip_serializing_if = "Option::is_none")] + pub contributions: Option, + /// TimeStamp defines a timestamp + #[serde(rename = "timestamp", skip_serializing_if = "Option::is_none")] + pub timestamp: Option, +} + +impl UserHeatmapData { + /// UserHeatmapData represents the data needed to create a heatmap + pub fn new() -> UserHeatmapData { + UserHeatmapData { + contributions: None, + timestamp: None, + } + } +} + + diff --git a/crates/gitea_raw_client/src/models/user_search_200_response.rs b/crates/gitea_raw_client/src/models/user_search_200_response.rs new file mode 100644 index 0000000..b1a0c48 --- /dev/null +++ b/crates/gitea_raw_client/src/models/user_search_200_response.rs @@ -0,0 +1,31 @@ +/* + * Gitea API. + * + * This documentation describes the Gitea API. + * + * The version of the OpenAPI document: 1.17.3 + * + * Generated by: https://openapi-generator.tech + */ + + + + +#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)] +pub struct UserSearch200Response { + #[serde(rename = "data", skip_serializing_if = "Option::is_none")] + pub data: Option>, + #[serde(rename = "ok", skip_serializing_if = "Option::is_none")] + pub ok: Option, +} + +impl UserSearch200Response { + pub fn new() -> UserSearch200Response { + UserSearch200Response { + data: None, + ok: None, + } + } +} + + diff --git a/crates/gitea_raw_client/src/models/user_settings.rs b/crates/gitea_raw_client/src/models/user_settings.rs new file mode 100644 index 0000000..6c93c14 --- /dev/null +++ b/crates/gitea_raw_client/src/models/user_settings.rs @@ -0,0 +1,55 @@ +/* + * Gitea API. + * + * This documentation describes the Gitea API. + * + * The version of the OpenAPI document: 1.17.3 + * + * Generated by: https://openapi-generator.tech + */ + +/// UserSettings : UserSettings represents user settings + + + +#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)] +pub struct UserSettings { + #[serde(rename = "description", skip_serializing_if = "Option::is_none")] + pub description: Option, + #[serde(rename = "diff_view_style", skip_serializing_if = "Option::is_none")] + pub diff_view_style: Option, + #[serde(rename = "full_name", skip_serializing_if = "Option::is_none")] + pub full_name: Option, + #[serde(rename = "hide_activity", skip_serializing_if = "Option::is_none")] + pub hide_activity: Option, + /// Privacy + #[serde(rename = "hide_email", skip_serializing_if = "Option::is_none")] + pub hide_email: Option, + #[serde(rename = "language", skip_serializing_if = "Option::is_none")] + pub language: Option, + #[serde(rename = "location", skip_serializing_if = "Option::is_none")] + pub location: Option, + #[serde(rename = "theme", skip_serializing_if = "Option::is_none")] + pub theme: Option, + #[serde(rename = "website", skip_serializing_if = "Option::is_none")] + pub website: Option, +} + +impl UserSettings { + /// UserSettings represents user settings + pub fn new() -> UserSettings { + UserSettings { + description: None, + diff_view_style: None, + full_name: None, + hide_activity: None, + hide_email: None, + language: None, + location: None, + theme: None, + website: None, + } + } +} + + diff --git a/crates/gitea_raw_client/src/models/user_settings_options.rs b/crates/gitea_raw_client/src/models/user_settings_options.rs new file mode 100644 index 0000000..2aec77c --- /dev/null +++ b/crates/gitea_raw_client/src/models/user_settings_options.rs @@ -0,0 +1,55 @@ +/* + * Gitea API. + * + * This documentation describes the Gitea API. + * + * The version of the OpenAPI document: 1.17.3 + * + * Generated by: https://openapi-generator.tech + */ + +/// UserSettingsOptions : UserSettingsOptions represents options to change user settings + + + +#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)] +pub struct UserSettingsOptions { + #[serde(rename = "description", skip_serializing_if = "Option::is_none")] + pub description: Option, + #[serde(rename = "diff_view_style", skip_serializing_if = "Option::is_none")] + pub diff_view_style: Option, + #[serde(rename = "full_name", skip_serializing_if = "Option::is_none")] + pub full_name: Option, + #[serde(rename = "hide_activity", skip_serializing_if = "Option::is_none")] + pub hide_activity: Option, + /// Privacy + #[serde(rename = "hide_email", skip_serializing_if = "Option::is_none")] + pub hide_email: Option, + #[serde(rename = "language", skip_serializing_if = "Option::is_none")] + pub language: Option, + #[serde(rename = "location", skip_serializing_if = "Option::is_none")] + pub location: Option, + #[serde(rename = "theme", skip_serializing_if = "Option::is_none")] + pub theme: Option, + #[serde(rename = "website", skip_serializing_if = "Option::is_none")] + pub website: Option, +} + +impl UserSettingsOptions { + /// UserSettingsOptions represents options to change user settings + pub fn new() -> UserSettingsOptions { + UserSettingsOptions { + description: None, + diff_view_style: None, + full_name: None, + hide_activity: None, + hide_email: None, + language: None, + location: None, + theme: None, + website: None, + } + } +} + + diff --git a/crates/gitea_raw_client/src/models/watch_info.rs b/crates/gitea_raw_client/src/models/watch_info.rs new file mode 100644 index 0000000..90f971e --- /dev/null +++ b/crates/gitea_raw_client/src/models/watch_info.rs @@ -0,0 +1,45 @@ +/* + * Gitea API. + * + * This documentation describes the Gitea API. + * + * The version of the OpenAPI document: 1.17.3 + * + * Generated by: https://openapi-generator.tech + */ + +/// WatchInfo : WatchInfo represents an API watch status of one repository + + + +#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)] +pub struct WatchInfo { + #[serde(rename = "created_at", skip_serializing_if = "Option::is_none")] + pub created_at: Option, + #[serde(rename = "ignored", skip_serializing_if = "Option::is_none")] + pub ignored: Option, + #[serde(rename = "reason", skip_serializing_if = "Option::is_none")] + pub reason: Option, + #[serde(rename = "repository_url", skip_serializing_if = "Option::is_none")] + pub repository_url: Option, + #[serde(rename = "subscribed", skip_serializing_if = "Option::is_none")] + pub subscribed: Option, + #[serde(rename = "url", skip_serializing_if = "Option::is_none")] + pub url: Option, +} + +impl WatchInfo { + /// WatchInfo represents an API watch status of one repository + pub fn new() -> WatchInfo { + WatchInfo { + created_at: None, + ignored: None, + reason: None, + repository_url: None, + subscribed: None, + url: None, + } + } +} + + diff --git a/crates/gitea_raw_client/src/models/wiki_commit.rs b/crates/gitea_raw_client/src/models/wiki_commit.rs new file mode 100644 index 0000000..cd01a7b --- /dev/null +++ b/crates/gitea_raw_client/src/models/wiki_commit.rs @@ -0,0 +1,39 @@ +/* + * Gitea API. + * + * This documentation describes the Gitea API. + * + * The version of the OpenAPI document: 1.17.3 + * + * Generated by: https://openapi-generator.tech + */ + +/// WikiCommit : WikiCommit page commit/revision + + + +#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)] +pub struct WikiCommit { + #[serde(rename = "author", skip_serializing_if = "Option::is_none")] + pub author: Option>, + #[serde(rename = "commiter", skip_serializing_if = "Option::is_none")] + pub commiter: Option>, + #[serde(rename = "message", skip_serializing_if = "Option::is_none")] + pub message: Option, + #[serde(rename = "sha", skip_serializing_if = "Option::is_none")] + pub sha: Option, +} + +impl WikiCommit { + /// WikiCommit page commit/revision + pub fn new() -> WikiCommit { + WikiCommit { + author: None, + commiter: None, + message: None, + sha: None, + } + } +} + + diff --git a/crates/gitea_raw_client/src/models/wiki_commit_list.rs b/crates/gitea_raw_client/src/models/wiki_commit_list.rs new file mode 100644 index 0000000..53faf77 --- /dev/null +++ b/crates/gitea_raw_client/src/models/wiki_commit_list.rs @@ -0,0 +1,33 @@ +/* + * Gitea API. + * + * This documentation describes the Gitea API. + * + * The version of the OpenAPI document: 1.17.3 + * + * Generated by: https://openapi-generator.tech + */ + +/// WikiCommitList : WikiCommitList commit/revision list + + + +#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)] +pub struct WikiCommitList { + #[serde(rename = "commits", skip_serializing_if = "Option::is_none")] + pub commits: Option>, + #[serde(rename = "count", skip_serializing_if = "Option::is_none")] + pub count: Option, +} + +impl WikiCommitList { + /// WikiCommitList commit/revision list + pub fn new() -> WikiCommitList { + WikiCommitList { + commits: None, + count: None, + } + } +} + + diff --git a/crates/gitea_raw_client/src/models/wiki_page.rs b/crates/gitea_raw_client/src/models/wiki_page.rs new file mode 100644 index 0000000..a8b803f --- /dev/null +++ b/crates/gitea_raw_client/src/models/wiki_page.rs @@ -0,0 +1,52 @@ +/* + * Gitea API. + * + * This documentation describes the Gitea API. + * + * The version of the OpenAPI document: 1.17.3 + * + * Generated by: https://openapi-generator.tech + */ + +/// WikiPage : WikiPage a wiki page + + + +#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)] +pub struct WikiPage { + #[serde(rename = "commit_count", skip_serializing_if = "Option::is_none")] + pub commit_count: Option, + /// Page content, base64 encoded + #[serde(rename = "content_base64", skip_serializing_if = "Option::is_none")] + pub content_base64: Option, + #[serde(rename = "footer", skip_serializing_if = "Option::is_none")] + pub footer: Option, + #[serde(rename = "html_url", skip_serializing_if = "Option::is_none")] + pub html_url: Option, + #[serde(rename = "last_commit", skip_serializing_if = "Option::is_none")] + pub last_commit: Option>, + #[serde(rename = "sidebar", skip_serializing_if = "Option::is_none")] + pub sidebar: Option, + #[serde(rename = "sub_url", skip_serializing_if = "Option::is_none")] + pub sub_url: Option, + #[serde(rename = "title", skip_serializing_if = "Option::is_none")] + pub title: Option, +} + +impl WikiPage { + /// WikiPage a wiki page + pub fn new() -> WikiPage { + WikiPage { + commit_count: None, + content_base64: None, + footer: None, + html_url: None, + last_commit: None, + sidebar: None, + sub_url: None, + title: None, + } + } +} + + diff --git a/crates/gitea_raw_client/src/models/wiki_page_meta_data.rs b/crates/gitea_raw_client/src/models/wiki_page_meta_data.rs new file mode 100644 index 0000000..5746c58 --- /dev/null +++ b/crates/gitea_raw_client/src/models/wiki_page_meta_data.rs @@ -0,0 +1,39 @@ +/* + * Gitea API. + * + * This documentation describes the Gitea API. + * + * The version of the OpenAPI document: 1.17.3 + * + * Generated by: https://openapi-generator.tech + */ + +/// WikiPageMetaData : WikiPageMetaData wiki page meta information + + + +#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)] +pub struct WikiPageMetaData { + #[serde(rename = "html_url", skip_serializing_if = "Option::is_none")] + pub html_url: Option, + #[serde(rename = "last_commit", skip_serializing_if = "Option::is_none")] + pub last_commit: Option>, + #[serde(rename = "sub_url", skip_serializing_if = "Option::is_none")] + pub sub_url: Option, + #[serde(rename = "title", skip_serializing_if = "Option::is_none")] + pub title: Option, +} + +impl WikiPageMetaData { + /// WikiPageMetaData wiki page meta information + pub fn new() -> WikiPageMetaData { + WikiPageMetaData { + html_url: None, + last_commit: None, + sub_url: None, + title: None, + } + } +} + +