diff --git a/.drone.yml b/.drone.yml index 44c6321..11c8957 100755 --- a/.drone.yml +++ b/.drone.yml @@ -1,9 +1,5 @@ - -kind: pipeline -type: docker -name: "test" -steps: - - name: test - image: harbor.front.kjuulh.io/docker-proxy/library/bash:latest - commands: - - echo 'Run tests' +kind: template +load: bust_rustbin_default_template.yaml +name: octopush +data: + binName: octopush diff --git a/.gitignore b/.gitignore index dddecf9..33117ee 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,4 @@ +/target .cuddle/ +target/ .env diff --git a/CONFIGURATION_SERVER.md b/CONFIGURATION_SERVER.md deleted file mode 100644 index 04d5c69..0000000 --- a/CONFIGURATION_SERVER.md +++ /dev/null @@ -1 +0,0 @@ -# Configuration server diff --git a/Cargo.lock b/Cargo.lock new file mode 100644 index 0000000..730d0ec --- /dev/null +++ b/Cargo.lock @@ -0,0 +1,1590 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +version = 3 + +[[package]] +name = "ansi_term" +version = "0.12.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d52a9bb7ec0cf484c551830a7ce27bd20d67eac647e1befb56b0be4ee39a55d2" +dependencies = [ + "winapi", +] + +[[package]] +name = "async-trait" +version = "0.1.58" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1e805d94e6b5001b651426cf4cd446b1ab5f319d27bab5c644f61de0a804360c" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "atty" +version = "0.2.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d9b39be18770d11421cdb1b9947a45dd3f37e93092cbf377614828a319d5fee8" +dependencies = [ + "hermit-abi", + "libc", + "winapi", +] + +[[package]] +name = "autocfg" +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" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ec8a7b6a70fde80372154c65702f00a0f56f3e1c36abbc6c440484be248856db" + +[[package]] +name = "cc" +version = "1.0.73" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2fff2a6927b3bb87f9595d67196a70493f627687a71d87a0d692242c33f58c11" +dependencies = [ + "jobserver", +] + +[[package]] +name = "cfg-if" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" + +[[package]] +name = "clap" +version = "2.34.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a0610544180c38b88101fecf2dd634b174a62eef6946f84dfc6a7127512b381c" +dependencies = [ + "ansi_term", + "atty", + "bitflags", + "strsim 0.8.0", + "textwrap", + "unicode-width", + "vec_map", +] + +[[package]] +name = "clap" +version = "4.0.18" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "335867764ed2de42325fafe6d18b8af74ba97ee0c590fa016f157535b42ab04b" +dependencies = [ + "atty", + "bitflags", + "clap_lex", + "strsim 0.10.0", + "termcolor", +] + +[[package]] +name = "clap_lex" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0d4198f73e42b4936b35b5bb248d81d2b595ecb170da0bac7655c54eedfa8da8" +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 = "dotenv" +version = "0.15.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "77c90badedccf4105eca100756a0b1289e191f6fcbdadd3cee1d2f614f97da8f" +dependencies = [ + "clap 2.34.0", +] + +[[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" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4c2b6b5a29c02cdc822728b7d7b8ae1bab3e3b05d44522770ddd49722eeac7eb" +dependencies = [ + "indenter", + "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" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a9c384f161156f5260c24a097c56119f9be8c798586aecc13afbcbe7b7e26bf8" +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" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c05aeb6a22b8f62540c194aac980f2115af067bfe15a0734d7277a768d396b31" +dependencies = [ + "cfg-if", + "libc", + "wasi", +] + +[[package]] +name = "git2" +version = "0.15.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2994bee4a3a6a51eb90c218523be382fd7ea09b16380b9312e9dbe955ff7c7d1" +dependencies = [ + "bitflags", + "libc", + "libgit2-sys", + "log", + "openssl-probe", + "openssl-sys", + "url", +] + +[[package]] +name = "gitea_client" +version = "0.1.0" +dependencies = [ + "async-trait", + "gitea_raw_client", + "reqwest", +] + +[[package]] +name = "gitea_raw_client" +version = "1.17.3" +dependencies = [ + "reqwest", + "serde", + "serde_derive", + "serde_json", + "url", + "uuid", +] + +[[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" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8a9ee70c43aaf417c914396645a0fa852624801b24ebb7ae78fe8272889ac888" + +[[package]] +name = "hermit-abi" +version = "0.1.19" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "62b467343b94ba476dcb2500d242dadbb39557df889310ac77c5d99100aaac33" +dependencies = [ + "libc", +] + +[[package]] +name = "hex" +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" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e14ddfc70884202db2244c223200c204c2bda1bc6e0998d11b5e024d657209e6" +dependencies = [ + "unicode-bidi", + "unicode-normalization", +] + +[[package]] +name = "indenter" +version = "0.3.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ce23b50ad8242c51a442f3ff322d56b02f08852c77e4c0b4d3fd684abc89c683" + +[[package]] +name = "indexmap" +version = "1.9.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1885e79c1fc4b10f0e172c475f458b7f7b93061064d98c3293e98c5ba0c8b399" +dependencies = [ + "autocfg", + "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" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4217ad341ebadf8d8e724e264f13e593e0648f5b3e94b3896a5df283be015ecc" + +[[package]] +name = "jobserver" +version = "0.1.25" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "068b1ee6743e4d11fb9c6a1e6064b3693a1b600e7f5f5988047d98b3dc9fb90b" +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" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646" + +[[package]] +name = "libc" +version = "0.2.136" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "55edcf6c0bb319052dea84732cf99db461780fd5e8d3eb46ab6ff312ab31f197" + +[[package]] +name = "libgit2-sys" +version = "0.14.0+1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "47a00859c70c8a4f7218e6d1cc32875c4b55f6799445b842b0d8ed5e4c3d959b" +dependencies = [ + "cc", + "libc", + "libssh2-sys", + "libz-sys", + "openssl-sys", + "pkg-config", +] + +[[package]] +name = "libssh2-sys" +version = "0.2.23" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b094a36eb4b8b8c8a7b4b8ae43b2944502be3e59cd87687595cf6b0a71b3f4ca" +dependencies = [ + "cc", + "libc", + "libz-sys", + "openssl-sys", + "pkg-config", + "vcpkg", +] + +[[package]] +name = "libz-sys" +version = "1.1.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9702761c3935f8cc2f101793272e202c72b99da8f4224a19ddcf1279a6450bbf" +dependencies = [ + "cc", + "libc", + "pkg-config", + "vcpkg", +] + +[[package]] +name = "lock_api" +version = "0.4.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "435011366fe56583b16cf956f9df0095b405b82d76425bc8981c0e22e60ec4df" +dependencies = [ + "autocfg", + "scopeguard", +] + +[[package]] +name = "log" +version = "0.4.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "abb12e687cfb44aa40f41fc3978ef76448f9b6038cad6aef4259d3c095a2382e" +dependencies = [ + "cfg-if", +] + +[[package]] +name = "matchers" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8263075bb86c5a1b1427b5ae862e8889656f126e9f77c484496e8b47cf5c5558" +dependencies = [ + "regex-automata", +] + +[[package]] +name = "memchr" +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" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e5d732bc30207a6423068df043e3d02e0735b155ad7ce1a6f76fe2baa5b158de" +dependencies = [ + "libc", + "log", + "wasi", + "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]] +name = "nu-ansi-term" +version = "0.46.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "77a8165726e8236064dbb45459242600304b42a5ea24ee2948e18e023bf7ba84" +dependencies = [ + "overload", + "winapi", +] + +[[package]] +name = "num_cpus" +version = "1.13.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "19e64526ebdee182341572e50e9ad03965aa510cd94427a4549448f285e957a1" +dependencies = [ + "hermit-abi", + "libc", +] + +[[package]] +name = "octopush" +version = "0.1.0" +dependencies = [ + "dotenv", + "eyre", + "octopush_cli", + "tokio", + "tracing", + "tracing-subscriber", +] + +[[package]] +name = "octopush_cli" +version = "0.1.0" +dependencies = [ + "clap 4.0.18", + "eyre", + "octopush_core", + "octopush_infra", + "tokio", + "tracing", +] + +[[package]] +name = "octopush_core" +version = "0.1.0" +dependencies = [ + "async-trait", + "eyre", + "git2", + "gitea_client", + "hex", + "rand", + "serde", + "serde_yaml", + "tokio", + "tracing", +] + +[[package]] +name = "octopush_infra" +version = "0.1.0" +dependencies = [ + "eyre", + "octopush_core", + "tracing", +] + +[[package]] +name = "once_cell" +version = "1.15.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e82dad04139b71a90c080c8463fe0dc7902db5192d939bd0950f074d014339e1" + +[[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" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ff011a302c396a5197692431fc1948019154afc178baf7d8e37367442a4601cf" + +[[package]] +name = "openssl-sys" +version = "0.9.78" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "07d5c8cb6e57b3a3612064d7b18b117912b4ce70955c2504d4b741c9e244b132" +dependencies = [ + "autocfg", + "cc", + "libc", + "pkg-config", + "vcpkg", +] + +[[package]] +name = "os_str_bytes" +version = "6.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9ff7415e9ae3fff1225851df9e0d9e4e5479f947619774677a63572e55e80eff" + +[[package]] +name = "overload" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b15813163c1d831bf4a13c3610c05c0d03b39feb07f7e09fa234dac9b15aaf39" + +[[package]] +name = "parking_lot" +version = "0.12.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3742b2c103b9f06bc9fff0a37ff4912935851bee6d36f3c02bcc755bcfec228f" +dependencies = [ + "lock_api", + "parking_lot_core", +] + +[[package]] +name = "parking_lot_core" +version = "0.9.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4dc9e0dc2adc1c69d09143aff38d3d30c5c3f0df0dad82e6d25547af174ebec0" +dependencies = [ + "cfg-if", + "libc", + "redox_syscall", + "smallvec", + "windows-sys 0.42.0", +] + +[[package]] +name = "percent-encoding" +version = "2.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "478c572c3d73181ff3c2539045f6eb99e5491218eae919370993b890cdbdd98e" + +[[package]] +name = "pin-project-lite" +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" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1df8c4ec4b0627e53bdf214615ad287367e482558cf84b109250b37464dc03ae" + +[[package]] +name = "ppv-lite86" +version = "0.2.16" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "eb9f9e6e233e5c4a35559a617bf40a4ec447db2e84c20b55a6f83167b7e57872" + +[[package]] +name = "proc-macro2" +version = "1.0.47" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5ea3d908b0e36316caf9e9e2c4625cdde190a7e6f440d794667ed17a1855e725" +dependencies = [ + "unicode-ident", +] + +[[package]] +name = "quote" +version = "1.0.21" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bbe448f377a7d6961e30f5955f9b8d106c3f5e449d493ee1b125c1d43c2b5179" +dependencies = [ + "proc-macro2", +] + +[[package]] +name = "rand" +version = "0.8.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "34af8d1a0e25924bc5b7c43c079c942339d8f0a8b57c39049bef581b46327404" +dependencies = [ + "libc", + "rand_chacha", + "rand_core", +] + +[[package]] +name = "rand_chacha" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e6c10a63a0fa32252be49d21e7709d4d4baf8d231c2dbce1eaa8141b9b127d88" +dependencies = [ + "ppv-lite86", + "rand_core", +] + +[[package]] +name = "rand_core" +version = "0.6.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ec0be4795e2f6a28069bec0b5ff3e2ac9bafc99e6a9a7dc3547996c5c816922c" +dependencies = [ + "getrandom", +] + +[[package]] +name = "redox_syscall" +version = "0.2.16" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fb5a58c1855b4b6819d59012155603f0b22ad30cad752600aadfcb695265519a" +dependencies = [ + "bitflags", +] + +[[package]] +name = "regex" +version = "1.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e076559ef8e241f2ae3479e36f97bd5741c0330689e217ad51ce2c76808b868a" +dependencies = [ + "regex-syntax", +] + +[[package]] +name = "regex-automata" +version = "0.1.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6c230d73fb8d8c1b9c0b3135c5142a8acee3a0558fb8db5cf1cb65f8d7862132" +dependencies = [ + "regex-syntax", +] + +[[package]] +name = "regex-syntax" +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" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d193d69bae983fc11a79df82342761dfbf28a99fc8d203dca4c3c1b590948965" +dependencies = [ + "serde_derive", +] + +[[package]] +name = "serde_derive" +version = "1.0.147" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4f1d362ca8fc9c3e3a7484440752472d68a6caa98f1ab81d99b5dfe517cec852" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "serde_json" +version = "1.0.88" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8e8b3801309262e8184d9687fb697586833e939767aea0dda89f5a8e650e8bd7" +dependencies = [ + "itoa", + "ryu", + "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" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6d232d893b10de3eb7258ff01974d6ee20663d8e833263c99409d4b13a0209da" +dependencies = [ + "indexmap", + "itoa", + "ryu", + "serde", + "unsafe-libyaml", +] + +[[package]] +name = "sharded-slab" +version = "0.1.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "900fba806f70c630b0a382d0d825e17a0f19fcd059a2ade1ff237bcddf446b31" +dependencies = [ + "lazy_static", +] + +[[package]] +name = "signal-hook-registry" +version = "1.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e51e73328dc4ac0c7ccbda3a494dfa03df1de2f46018127f60c693f2648455b0" +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" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a507befe795404456341dfab10cef66ead4c041f62b8b11bbb92bffe5d0953e0" + +[[package]] +name = "socket2" +version = "0.4.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "02e2d2db9033d13a1567121ddd7a095ee144db4e1ca1b1bda3419bc0da294ebd" +dependencies = [ + "libc", + "winapi", +] + +[[package]] +name = "strsim" +version = "0.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8ea5119cdb4c55b55d432abb513a0429384878c15dde60cc77b1c99de1a95a6a" + +[[package]] +name = "strsim" +version = "0.10.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "73473c0e59e6d5812c5dfe2a064a6444949f089e20eec9a2e5506596494e4623" + +[[package]] +name = "syn" +version = "1.0.103" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a864042229133ada95abf3b54fdc62ef5ccabe9515b64717bcb9a1919e59445d" +dependencies = [ + "proc-macro2", + "quote", + "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" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bab24d30b911b2376f3a13cc2cd443142f0c81dda04c118693e35b3835757755" +dependencies = [ + "winapi-util", +] + +[[package]] +name = "textwrap" +version = "0.11.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d326610f408c7a4eb6f51c37c330e496b08506c9457c9d34287ecc38809fb060" +dependencies = [ + "unicode-width", +] + +[[package]] +name = "thread_local" +version = "1.1.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5516c27b78311c50bf42c071425c560ac799b11c30b31f87e3081965fe5e0180" +dependencies = [ + "once_cell", +] + +[[package]] +name = "tinyvec" +version = "1.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "87cc5ceb3875bb20c2890005a4e226a4651264a5c75edb2421b52861a0a0cb50" +dependencies = [ + "tinyvec_macros", +] + +[[package]] +name = "tinyvec_macros" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cda74da7e1a664f795bb1f8a87ec406fb89a02522cf6e50620d016add6dbbf5c" + +[[package]] +name = "tokio" +version = "1.21.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a9e03c497dc955702ba729190dc4aac6f2a0ce97f913e5b1b5912fc5039d9099" +dependencies = [ + "autocfg", + "bytes", + "libc", + "memchr", + "mio", + "num_cpus", + "parking_lot", + "pin-project-lite", + "signal-hook-registry", + "socket2", + "tokio-macros", + "winapi", +] + +[[package]] +name = "tokio-macros" +version = "1.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9724f9a975fb987ef7a3cd9be0350edcbe130698af5b8f7a631e23d42d052484" +dependencies = [ + "proc-macro2", + "quote", + "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" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8ce8c33a8d48bd45d624a6e523445fd21ec13d3653cd51f681abf67418f54eb8" +dependencies = [ + "cfg-if", + "log", + "pin-project-lite", + "tracing-attributes", + "tracing-core", +] + +[[package]] +name = "tracing-attributes" +version = "0.1.23" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4017f8f45139870ca7e672686113917c71c7a6e02d4924eda67186083c03081a" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "tracing-core" +version = "0.1.30" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "24eb03ba0eab1fd845050058ce5e616558e8f8d8fca633e6b163fe25c797213a" +dependencies = [ + "once_cell", + "valuable", +] + +[[package]] +name = "tracing-log" +version = "0.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "78ddad33d2d10b1ed7eb9d1f518a5674713876e97e5bb9b7345a7984fbb4f922" +dependencies = [ + "lazy_static", + "log", + "tracing-core", +] + +[[package]] +name = "tracing-serde" +version = "0.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bc6b213177105856957181934e4920de57730fc69bf42c37ee5bb664d406d9e1" +dependencies = [ + "serde", + "tracing-core", +] + +[[package]] +name = "tracing-subscriber" +version = "0.3.16" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a6176eae26dd70d0c919749377897b54a9276bd7061339665dd68777926b5a70" +dependencies = [ + "matchers", + "nu-ansi-term", + "once_cell", + "regex", + "serde", + "serde_json", + "sharded-slab", + "smallvec", + "thread_local", + "tracing", + "tracing-core", + "tracing-log", + "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" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "099b7128301d285f79ddd55b9a83d5e6b9e97c92e0ea0daebee7263e932de992" + +[[package]] +name = "unicode-ident" +version = "1.0.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6ceab39d59e4c9499d4e5a8ee0e2735b891bb7308ac83dfb4e80cad195c9f6f3" + +[[package]] +name = "unicode-normalization" +version = "0.1.22" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5c5713f0fc4b5db668a2ac63cdb7bb4469d8c9fed047b1d0292cc7b0ce2ba921" +dependencies = [ + "tinyvec", +] + +[[package]] +name = "unicode-width" +version = "0.1.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c0edd1e5b14653f783770bce4a4dabb4a5108a5370a5f5d8cfe8710c361f6c8b" + +[[package]] +name = "unsafe-libyaml" +version = "0.2.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c1e5fa573d8ac5f1a856f8d7be41d390ee973daf97c806b2c1a465e4e1406e68" + +[[package]] +name = "url" +version = "2.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0d68c799ae75762b8c3fe375feb6600ef5602c883c5d21eb51c09f22b83c4643" +dependencies = [ + "form_urlencoded", + "idna", + "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" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "830b7e5d4d90034032940e4ace0d9a9a057e7a45cd94e6c007832e39edb82f6d" + +[[package]] +name = "vcpkg" +version = "0.2.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "accd4ea62f7bb7a82fe23066fb0957d48ef677f6eeb8215f372f52e48bb32426" + +[[package]] +name = "vec_map" +version = "0.8.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f1bddf1187be692e79c5ffeab891132dfb0f236ed36a43c7ed39f1165ee20191" + +[[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" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5c839a674fcd7a98952e593242ea400abe93992746761e38641405d28b00f419" +dependencies = [ + "winapi-i686-pc-windows-gnu", + "winapi-x86_64-pc-windows-gnu", +] + +[[package]] +name = "winapi-i686-pc-windows-gnu" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6" + +[[package]] +name = "winapi-util" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "70ec6ce85bb158151cae5e5c87f95a8e97d2c0c4b001223f33a334e3ce5de178" +dependencies = [ + "winapi", +] + +[[package]] +name = "winapi-x86_64-pc-windows-gnu" +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" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5a3e1820f08b8513f676f7ab6c1f99ff312fb97b553d30ff4dd86f9f15728aa7" +dependencies = [ + "windows_aarch64_gnullvm", + "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 0.42.0", +] + +[[package]] +name = "windows_aarch64_gnullvm" +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" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bf7b1b21b5362cbc318f686150e5bcea75ecedc74dd157d874d754a2ca44b0ed" + +[[package]] +name = "windows_x86_64_gnullvm" +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 new file mode 100644 index 0000000..e8d46f3 --- /dev/null +++ b/Cargo.toml @@ -0,0 +1,31 @@ +[package] +name = "octopush" +version = "0.1.0" +edition = "2021" + +# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html + +[workspace] +members = [ + "crates/octopush_cli", + "crates/octopush_infra", + "crates/octopush_core", + "crates/gitea_raw_client", + "crates/gitea_client", +] + +[workspace.dependencies] +eyre = { version = "0.6.8" } +async-trait = "0.1.58" +tokio = { version = "1.21.2", features = ["full", "test-util"] } +tracing = { version = "0.1.37", features = ["log"] } + +[dependencies] +octopush_cli = { path = "crates/octopush_cli" } + +eyre = { workspace = true } +tokio = { workspace = true } +tracing = { workspace = true } + +tracing-subscriber = { version = "0.3.16", features = ["json", "env-filter"] } +dotenv = { version = "0.15.0", features = ["clap", "cli"] } diff --git a/README.md b/README.md index 10ea947..65f05dc 100644 --- a/README.md +++ b/README.md @@ -34,10 +34,10 @@ Refer to [roadmap.md](roadmap.md) ## Installation -Octopush comes in two modes. Client or Client -> Server. Octopush can stand alone as -a client, for smaller and less secure changes. However, for organisations, it -may be useful to use Octopush in server mode, which supports more features, and -has extra security built in. +Octopush comes in two modes. Client or Client -> Server. Octopush can stand +alone as a client, for smaller and less secure changes. However, for +organisations, it may be useful to use Octopush in server mode, which supports +more features, and has extra security built in. ### Client (CLI) @@ -182,8 +182,8 @@ To run the script use octopush process --path "write-a-readme" ``` -This will cause the octopush process to automatically apply the action on the repo -and open a pr. +This will cause the octopush process to automatically apply the action on the +repo and open a pr. ### Query repositories @@ -212,8 +212,8 @@ to help test locally, as well as not cause serious issues. The server configuration is pretty much the same, except the command would look like so: `octopush server process --path "write-a-readme" --apply`. Octopush will try to infer as much as possible, but it may be needed to apply some extra flags to -specify upstream repositories and such. Octopush will also help you setup keys and -such on the first run, using `octopush setup` or `octopush server setup`. +specify upstream repositories and such. Octopush will also help you setup keys +and such on the first run, using `octopush setup` or `octopush server setup`. ## Contributing diff --git a/_examples/actions/add_releaserc/octopush.yml b/_examples/actions/add_releaserc/octopush.yml index d90c930..34d455a 100644 --- a/_examples/actions/add_releaserc/octopush.yml +++ b/_examples/actions/add_releaserc/octopush.yml @@ -1,4 +1,4 @@ -apiVersion: git.front.kjuulh.io/kjuulh/octopush/blob/main/schema/v1 +apiVersion: action name: write-a-readme select: repositories: diff --git a/_examples/actions/write_a_readme/dist/bin b/_examples/actions/write_a_readme/dist/bin new file mode 100755 index 0000000..a562e14 Binary files /dev/null and b/_examples/actions/write_a_readme/dist/bin differ diff --git a/_examples/actions/write_a_readme/main b/_examples/actions/write_a_readme/main new file mode 100755 index 0000000..9ac7386 Binary files /dev/null and b/_examples/actions/write_a_readme/main differ diff --git a/_examples/actions/write_a_readme/main.go b/_examples/actions/write_a_readme/main.go index 5c24133..8326ca8 100644 --- a/_examples/actions/write_a_readme/main.go +++ b/_examples/actions/write_a_readme/main.go @@ -1,12 +1,38 @@ package main -import "github.com/bitfield/script" +import ( + "os" + + "github.com/bitfield/script" +) func main() { _, err := script. Echo("# Readme"). WriteFile("README.md") + if err != nil { panic(err) } + println("ran stuff") + entries, err := os.ReadDir(".") + if err != nil { + panic(err) + } + for _, entry := range entries { + if !entry.IsDir() { + file, err := os.ReadFile(entry.Name()) + if err != nil { + panic(err) + } + println(string(file)) + } + } + + wd, err := os.Getwd() + if err != nil { + panic(err) + } + + println(wd) } diff --git a/_examples/actions/write_a_readme/octopush.yml b/_examples/actions/write_a_readme/octopush.yml index a4bf81e..9d7a62e 100644 --- a/_examples/actions/write_a_readme/octopush.yml +++ b/_examples/actions/write_a_readme/octopush.yml @@ -1,11 +1,26 @@ -apiVersion: git.front.kjuulh.io/kjuulh/octopush/blob/main/schema/v1 +apiVersion: action name: write-a-readme select: - repositories: - - git@git.front.kjuulh.io:kjuulh/octopush-test.git - # providers: - # - gitea: https://git.front.kjuulh.io - # organisation: "cibus" -actions: - - type: go - entry: "main.go" + # github: + # repositories: + # - kjuulh/octopush-test + # push: + # pull-request: + # name: "write a readme" + + # gitea: + # repositories: + # - kjuulh/octopush-test + # push: + # pull-request: + # name: "write a readme" + + git: + repositories: + - git@git.front.kjuulh.io:kjuulh/octopush-test.git + push: + branch: + name: "write a readme" +action: + type: go + entry: "main.go" diff --git a/assets/octopush.png b/assets/octopush.png deleted file mode 100644 index 9d1c499..0000000 Binary files a/assets/octopush.png and /dev/null differ diff --git a/assets/octopush.svg b/assets/octopush.svg deleted file mode 100644 index 8812c64..0000000 --- a/assets/octopush.svg +++ /dev/null @@ -1,10 +0,0 @@ - - - - - - - - - - diff --git a/cmd/octopush/commands/process.go b/cmd/octopush/commands/process.go deleted file mode 100644 index dcfa8ba..0000000 --- a/cmd/octopush/commands/process.go +++ /dev/null @@ -1,61 +0,0 @@ -package commands - -import ( - "context" - "time" - - "git.front.kjuulh.io/kjuulh/octopush/internal/cli" - "git.front.kjuulh.io/kjuulh/octopush/internal/commands" - "github.com/spf13/cobra" - "go.uber.org/zap" -) - -func CreateOctopushProcessCmd(logger *zap.Logger) *cobra.Command { - - var ( - actionsRepo string - branch string - path string - ) - cmd := &cobra.Command{ - Use: "process", - RunE: func(cmd *cobra.Command, args []string) error { - if err := cmd.ParseFlags(args); err != nil { - return err - } - - ctx := cmd.Context() - - deps, cleanupFunc, err := cli.Start(ctx, logger) - if err != nil { - return err - } - - defer func() { - ctx, _ = context.WithTimeout(ctx, time.Second*5) - if err := cleanupFunc(ctx); err != nil { - panic(err) - } - }() - - err = commands. - NewProcessRepos(logger, deps). - Process(ctx, actionsRepo, branch, path) - if err != nil { - return err - } - - return nil - }, - } - - pf := cmd.PersistentFlags() - - pf.StringVar(&actionsRepo, "actions-repo", "", "actions repo is the location of your actions, not where to apply the actions themselves, that should be self contained") - cmd.MarkPersistentFlagRequired("actions-repo") - pf.StringVar(&branch, "branch", "main", "which branch to look for actions in, will default to main") - pf.StringVar(&path, "path", "", "the location of the path inside the repository") - cmd.MarkPersistentFlagRequired("path") - - return cmd -} diff --git a/cmd/octopush/commands/root.go b/cmd/octopush/commands/root.go deleted file mode 100644 index 3a6654f..0000000 --- a/cmd/octopush/commands/root.go +++ /dev/null @@ -1,18 +0,0 @@ -package commands - -import ( - "git.front.kjuulh.io/kjuulh/octopush/cmd/octopush/commands/server" - "github.com/spf13/cobra" - "go.uber.org/zap" -) - -func CreateOctopushCmd(logger *zap.Logger) *cobra.Command { - cmd := &cobra.Command{ - Use: "octopush", - } - - cmd.AddCommand(CreateOctopushProcessCmd(logger)) - cmd.AddCommand(server.CreateOctopushServerCmd(logger)) - - return cmd -} diff --git a/cmd/octopush/commands/server/process.go b/cmd/octopush/commands/server/process.go deleted file mode 100644 index 04f2041..0000000 --- a/cmd/octopush/commands/server/process.go +++ /dev/null @@ -1,73 +0,0 @@ -package server - -import ( - "bytes" - "encoding/json" - "net/http" - - "github.com/spf13/cobra" -) - -func CreateOctopushProcessCmd() *cobra.Command { - - var ( - actionsRepo string - branch string - path string - ) - cmd := &cobra.Command{ - Use: "process", - RunE: func(cmd *cobra.Command, args []string) error { - if err := cmd.ParseFlags(args); err != nil { - return err - } - - client := http.Client{} - - var buf bytes.Buffer - err := json.NewEncoder(&buf). - Encode(struct { - Repository string `json:"repository"` - Branch string `json:"branch"` - Path string `json:"path"` - }{ - Repository: actionsRepo, - Branch: branch, - Path: path, - }) - if err != nil { - panic(err) - } - - req, err := http.NewRequestWithContext( - cmd.Context(), - http.MethodPost, - "http://localhost:3000/commands/processRepos", - &buf, - ) - if err != nil { - panic(err) - } - - resp, err := client.Do(req) - if err != nil { - panic(err) - } - if resp.StatusCode >= 300 { - panic(resp.Status) - } - - return nil - }, - } - - pf := cmd.PersistentFlags() - - pf.StringVar(&actionsRepo, "actions-repo", "", "actions repo is the location of your actions, not where to apply the actions themselves, that should be self contained") - cmd.MarkPersistentFlagRequired("actions-repo") - pf.StringVar(&branch, "branch", "main", "which branch to look for actions in, will default to main") - pf.StringVar(&path, "path", "", "the location of the path inside the repository") - cmd.MarkPersistentFlagRequired("path") - - return cmd -} diff --git a/cmd/octopush/commands/server/server.go b/cmd/octopush/commands/server/server.go deleted file mode 100644 index 90287a6..0000000 --- a/cmd/octopush/commands/server/server.go +++ /dev/null @@ -1,16 +0,0 @@ -package server - -import ( - "github.com/spf13/cobra" - "go.uber.org/zap" -) - -func CreateOctopushServerCmd(logger *zap.Logger) *cobra.Command { - cmd := &cobra.Command{ - Use: "server", - } - - cmd.AddCommand(CreateOctopushProcessCmd()) - - return cmd -} diff --git a/cmd/octopush/octopush.go b/cmd/octopush/octopush.go deleted file mode 100644 index f75223c..0000000 --- a/cmd/octopush/octopush.go +++ /dev/null @@ -1,28 +0,0 @@ -package main - -import ( - "os" - - "git.front.kjuulh.io/kjuulh/octopush/cmd/octopush/commands" - "git.front.kjuulh.io/kjuulh/octopush/internal/logger" - "go.uber.org/zap" -) - -func main() { - logger, err := logger.New() - if err != nil { - panic(err) - } - _ = logger.Sync() - - zap.ReplaceGlobals(logger) - - Execute(logger) -} - -func Execute(logger *zap.Logger) { - err := commands.CreateOctopushCmd(logger).Execute() - if err != nil { - os.Exit(1) - } -} diff --git a/cmd/server/commands/root.go b/cmd/server/commands/root.go deleted file mode 100644 index 379f24e..0000000 --- a/cmd/server/commands/root.go +++ /dev/null @@ -1,16 +0,0 @@ -package commands - -import ( - "github.com/spf13/cobra" - "go.uber.org/zap" -) - -func CreateServerCmd(logger *zap.Logger) *cobra.Command { - cmd := &cobra.Command{ - Use: "octopushserver", - } - - cmd.AddCommand(NewStartServerCommand(logger)) - - return cmd -} diff --git a/cmd/server/commands/start.go b/cmd/server/commands/start.go deleted file mode 100644 index 7849f57..0000000 --- a/cmd/server/commands/start.go +++ /dev/null @@ -1,19 +0,0 @@ -package commands - -import ( - "git.front.kjuulh.io/kjuulh/octopush/internal/server" - "github.com/spf13/cobra" - "go.uber.org/zap" -) - -func NewStartServerCommand(logger *zap.Logger) *cobra.Command { - cmd := &cobra.Command{ - Use: "start", - Short: "Start the octopush server", - RunE: func(cmd *cobra.Command, args []string) error { - return server.Start(logger) - }, - } - - return cmd -} diff --git a/cmd/server/server.go b/cmd/server/server.go deleted file mode 100644 index f050505..0000000 --- a/cmd/server/server.go +++ /dev/null @@ -1,29 +0,0 @@ -package main - -import ( - "os" - - "git.front.kjuulh.io/kjuulh/octopush/cmd/server/commands" - "git.front.kjuulh.io/kjuulh/octopush/internal/logger" - "go.uber.org/zap" -) - -func main() { - logger, err := logger.New() - if err != nil { - panic(err) - } - _ = logger.Sync() - - zap.ReplaceGlobals(logger) - - Execute(logger) -} - -func Execute(logger *zap.Logger) { - err := commands.CreateServerCmd(logger).Execute() - if err != nil { - logger.Error("execution failed", zap.Error(err)) - os.Exit(1) - } -} diff --git a/crates/gitea_client/Cargo.toml b/crates/gitea_client/Cargo.toml new file mode 100644 index 0000000..2b8c3a2 --- /dev/null +++ b/crates/gitea_client/Cargo.toml @@ -0,0 +1,13 @@ +[package] +name = "gitea_client" +version = "0.1.0" +edition = "2021" + +# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html + +[dependencies] +gitea_raw_client = { path = "../gitea_raw_client" } + +async-trait = { workspace = true } + +reqwest = "0.11.13" diff --git a/crates/gitea_client/src/apis/defaults/mod.rs b/crates/gitea_client/src/apis/defaults/mod.rs new file mode 100644 index 0000000..bb787f4 --- /dev/null +++ b/crates/gitea_client/src/apis/defaults/mod.rs @@ -0,0 +1 @@ +pub mod repository; diff --git a/crates/gitea_client/src/apis/defaults/repository.rs b/crates/gitea_client/src/apis/defaults/repository.rs new file mode 100644 index 0000000..49b32a1 --- /dev/null +++ b/crates/gitea_client/src/apis/defaults/repository.rs @@ -0,0 +1,1115 @@ +use std::sync::Arc; + +use async_trait::async_trait; +use gitea_raw_client::{ + apis::{configuration::Configuration, repository_api::*, Error}, + models, +}; + +use crate::apis::repository::Repository; + +pub struct DefaultRepository { + conf: Arc, +} + +impl DefaultRepository { + pub fn new(conf: Arc) -> Self { + Self { conf } + } +} + +#[allow(dead_code, unused_variables)] +#[async_trait] +impl Repository for DefaultRepository { + async fn accept_transfer( + &self, + owner: &str, + repo: &str, + ) -> Result> { + todo!("not implemented") + } + async fn create_current_user_repo( + &self, + body: Option, + ) -> Result> { + todo!("not implemented") + } + async fn create_fork( + &self, + owner: &str, + repo: &str, + body: Option, + ) -> Result> { + todo!("not implemented") + } + async fn generate_repo( + &self, + template_owner: &str, + template_repo: &str, + body: Option, + ) -> Result> { + todo!("not implemented") + } + async fn get_annotated_tag( + &self, + owner: &str, + repo: &str, + sha: &str, + ) -> Result> { + todo!("not implemented") + } + async fn get_blob( + &self, + owner: &str, + repo: &str, + sha: &str, + ) -> Result> { + todo!("not implemented") + } + async fn get_tree( + &self, + owner: &str, + repo: &str, + sha: &str, + recursive: Option, + page: Option, + per_page: Option, + ) -> Result> { + todo!("not implemented") + } + async fn list_forks( + &self, + owner: &str, + repo: &str, + page: Option, + limit: Option, + ) -> Result, Error> { + todo!("not implemented") + } + async fn reject_transfer( + &self, + owner: &str, + repo: &str, + ) -> Result> { + todo!("not implemented") + } + async fn add_collaborator( + &self, + owner: &str, + repo: &str, + collaborator: &str, + body: Option, + ) -> Result<(), Error> { + todo!("not implemented") + } + async fn add_team( + &self, + owner: &str, + repo: &str, + team: &str, + ) -> Result<(), Error> { + todo!("not implemented") + } + async fn add_topic( + &self, + owner: &str, + repo: &str, + topic: &str, + ) -> Result<(), Error> { + todo!("not implemented") + } + async fn apply_diff_patch( + &self, + owner: &str, + repo: &str, + body: models::UpdateFileOptions, + ) -> Result> { + todo!("not implemented") + } + async fn cancel_scheduled_auto_merge( + &self, + owner: &str, + repo: &str, + index: i64, + ) -> Result<(), Error> { + todo!("not implemented") + } + async fn check_collaborator( + &self, + owner: &str, + repo: &str, + collaborator: &str, + ) -> Result<(), Error> { + todo!("not implemented") + } + async fn check_team( + &self, + owner: &str, + repo: &str, + team: &str, + ) -> Result> { + todo!("not implemented") + } + async fn create_branch( + &self, + owner: &str, + repo: &str, + body: Option, + ) -> Result> { + todo!("not implemented") + } + async fn create_branch_protection( + &self, + owner: &str, + repo: &str, + body: Option, + ) -> Result> { + todo!("not implemented") + } + async fn create_file( + &self, + owner: &str, + repo: &str, + filepath: &str, + body: models::CreateFileOptions, + ) -> Result> { + todo!("not implemented") + } + async fn create_hook( + &self, + owner: &str, + repo: &str, + body: Option, + ) -> Result> { + todo!("not implemented") + } + async fn create_key( + &self, + owner: &str, + repo: &str, + body: Option, + ) -> Result> { + todo!("not implemented") + } + async fn create_pull_request( + &self, + owner: &str, + repo: &str, + body: Option, + ) -> Result> { + gitea_raw_client::apis::repository_api::repo_create_pull_request( + &self.conf, owner, repo, body, + ) + .await + } + async fn create_pull_review( + &self, + owner: &str, + repo: &str, + index: i64, + body: models::CreatePullReviewOptions, + ) -> Result> { + todo!("not implemented") + } + async fn create_pull_review_requests( + &self, + owner: &str, + repo: &str, + index: i64, + body: models::PullReviewRequestOptions, + ) -> Result, Error> { + todo!("not implemented") + } + async fn create_release( + &self, + owner: &str, + repo: &str, + body: Option, + ) -> Result> { + todo!("not implemented") + } + async fn create_release_attachment( + &self, + owner: &str, + repo: &str, + id: i64, + attachment: std::path::PathBuf, + name: Option<&str>, + ) -> Result> { + todo!("not implemented") + } + async fn create_status( + &self, + owner: &str, + repo: &str, + sha: &str, + body: Option, + ) -> Result> { + todo!("not implemented") + } + async fn create_tag( + &self, + owner: &str, + repo: &str, + body: Option, + ) -> Result> { + todo!("not implemented") + } + async fn create_wiki_page( + &self, + owner: &str, + repo: &str, + body: Option, + ) -> Result> { + todo!("not implemented") + } + async fn delete(&self, owner: &str, repo: &str) -> Result<(), Error> { + todo!("not implemented") + } + async fn delete_branch( + &self, + owner: &str, + repo: &str, + branch: &str, + ) -> Result<(), Error> { + todo!("not implemented") + } + async fn delete_branch_protection( + &self, + owner: &str, + repo: &str, + name: &str, + ) -> Result<(), Error> { + todo!("not implemented") + } + async fn delete_collaborator( + &self, + owner: &str, + repo: &str, + collaborator: &str, + ) -> Result<(), Error> { + todo!("not implemented") + } + async fn delete_file( + &self, + owner: &str, + repo: &str, + filepath: &str, + body: models::DeleteFileOptions, + ) -> Result> { + todo!("not implemented") + } + async fn delete_git_hook( + &self, + owner: &str, + repo: &str, + id: &str, + ) -> Result<(), Error> { + todo!("not implemented") + } + async fn delete_hook( + &self, + owner: &str, + repo: &str, + id: i64, + ) -> Result<(), Error> { + todo!("not implemented") + } + async fn delete_key( + &self, + owner: &str, + repo: &str, + id: i64, + ) -> Result<(), Error> { + todo!("not implemented") + } + async fn delete_pull_review( + &self, + owner: &str, + repo: &str, + index: i64, + id: i64, + ) -> Result<(), Error> { + todo!("not implemented") + } + async fn delete_pull_review_requests( + &self, + owner: &str, + repo: &str, + index: i64, + body: models::PullReviewRequestOptions, + ) -> Result<(), Error> { + todo!("not implemented") + } + async fn delete_release( + &self, + owner: &str, + repo: &str, + id: i64, + ) -> Result<(), Error> { + todo!("not implemented") + } + async fn delete_release_attachment( + &self, + owner: &str, + repo: &str, + id: i64, + attachment_id: i64, + ) -> Result<(), Error> { + todo!("not implemented") + } + async fn delete_release_by_tag( + &self, + owner: &str, + repo: &str, + tag: &str, + ) -> Result<(), Error> { + todo!("not implemented") + } + async fn delete_tag( + &self, + owner: &str, + repo: &str, + tag: &str, + ) -> Result<(), Error> { + todo!("not implemented") + } + async fn delete_team( + &self, + owner: &str, + repo: &str, + team: &str, + ) -> Result<(), Error> { + todo!("not implemented") + } + async fn delete_topic( + &self, + owner: &str, + repo: &str, + topic: &str, + ) -> Result<(), Error> { + todo!("not implemented") + } + async fn delete_wiki_page( + &self, + owner: &str, + repo: &str, + page_name: &str, + ) -> Result<(), Error> { + todo!("not implemented") + } + async fn dismiss_pull_review( + &self, + owner: &str, + repo: &str, + index: i64, + id: i64, + body: models::DismissPullReviewOptions, + ) -> Result> { + todo!("not implemented") + } + async fn download_commit_diff_or_patch( + &self, + owner: &str, + repo: &str, + sha: &str, + diff_type: &str, + ) -> Result> { + todo!("not implemented") + } + async fn download_pull_diff_or_patch( + &self, + owner: &str, + repo: &str, + index: i64, + diff_type: &str, + binary: Option, + ) -> Result> { + todo!("not implemented") + } + async fn edit( + &self, + owner: &str, + repo: &str, + body: Option, + ) -> Result> { + todo!("not implemented") + } + async fn edit_branch_protection( + &self, + owner: &str, + repo: &str, + name: &str, + body: Option, + ) -> Result> { + todo!("not implemented") + } + async fn edit_git_hook( + &self, + owner: &str, + repo: &str, + id: &str, + body: Option, + ) -> Result> { + todo!("not implemented") + } + async fn edit_hook( + &self, + owner: &str, + repo: &str, + id: i64, + body: Option, + ) -> Result> { + todo!("not implemented") + } + async fn edit_pull_request( + &self, + owner: &str, + repo: &str, + index: i64, + body: Option, + ) -> Result> { + todo!("not implemented") + } + async fn edit_release( + &self, + owner: &str, + repo: &str, + id: i64, + body: Option, + ) -> Result> { + todo!("not implemented") + } + async fn edit_release_attachment( + &self, + owner: &str, + repo: &str, + id: i64, + attachment_id: i64, + body: Option, + ) -> Result> { + todo!("not implemented") + } + async fn edit_wiki_page( + &self, + owner: &str, + repo: &str, + page_name: &str, + body: Option, + ) -> Result> { + todo!("not implemented") + } + async fn get( + &self, + owner: &str, + repo: &str, + ) -> Result> { + gitea_raw_client::apis::repository_api::repo_get(&self.conf, owner, repo).await + } + async fn get_all_commits( + &self, + owner: &str, + repo: &str, + sha: Option<&str>, + path: Option<&str>, + page: Option, + limit: Option, + ) -> Result, Error> { + todo!("not implemented") + } + async fn get_archive( + &self, + owner: &str, + repo: &str, + archive: &str, + ) -> Result<(), Error> { + todo!("not implemented") + } + async fn get_assignees( + &self, + owner: &str, + repo: &str, + ) -> Result, Error> { + todo!("not implemented") + } + async fn get_branch( + &self, + owner: &str, + repo: &str, + branch: &str, + ) -> Result> { + todo!("not implemented") + } + async fn get_branch_protection( + &self, + owner: &str, + repo: &str, + name: &str, + ) -> Result> { + todo!("not implemented") + } + async fn get_by_id(&self, id: i64) -> Result> { + todo!("not implemented") + } + async fn get_combined_status_by_ref( + &self, + owner: &str, + repo: &str, + r#ref: &str, + page: Option, + limit: Option, + ) -> Result> { + todo!("not implemented") + } + async fn get_contents( + &self, + owner: &str, + repo: &str, + filepath: &str, + r#ref: Option<&str>, + ) -> Result> { + todo!("not implemented") + } + async fn get_contents_list( + &self, + owner: &str, + repo: &str, + r#ref: Option<&str>, + ) -> Result, Error> { + todo!("not implemented") + } + async fn get_editor_config( + &self, + owner: &str, + repo: &str, + filepath: &str, + r#ref: Option<&str>, + ) -> Result<(), Error> { + todo!("not implemented") + } + async fn get_git_hook( + &self, + owner: &str, + repo: &str, + id: &str, + ) -> Result> { + todo!("not implemented") + } + async fn get_hook( + &self, + owner: &str, + repo: &str, + id: i64, + ) -> Result> { + todo!("not implemented") + } + async fn get_issue_templates( + &self, + owner: &str, + repo: &str, + ) -> Result, Error> { + todo!("not implemented") + } + async fn get_key( + &self, + owner: &str, + repo: &str, + id: i64, + ) -> Result> { + todo!("not implemented") + } + async fn get_languages( + &self, + owner: &str, + repo: &str, + ) -> Result<::std::collections::HashMap, Error> { + todo!("not implemented") + } + async fn get_note( + &self, + owner: &str, + repo: &str, + sha: &str, + ) -> Result> { + todo!("not implemented") + } + async fn get_pull_request( + &self, + owner: &str, + repo: &str, + index: i64, + ) -> Result> { + todo!("not implemented") + } + async fn get_pull_request_commits( + &self, + owner: &str, + repo: &str, + index: i64, + page: Option, + limit: Option, + ) -> Result, Error> { + todo!("not implemented") + } + async fn get_pull_review( + &self, + owner: &str, + repo: &str, + index: i64, + id: i64, + ) -> Result> { + todo!("not implemented") + } + async fn get_pull_review_comments( + &self, + owner: &str, + repo: &str, + index: i64, + id: i64, + ) -> Result, Error> { + todo!("not implemented") + } + async fn get_raw_file( + &self, + owner: &str, + repo: &str, + filepath: &str, + r#ref: Option<&str>, + ) -> Result<(), Error> { + todo!("not implemented") + } + async fn get_raw_file_or_lfs( + &self, + owner: &str, + repo: &str, + filepath: &str, + r#ref: Option<&str>, + ) -> Result<(), Error> { + todo!("not implemented") + } + async fn get_release( + &self, + owner: &str, + repo: &str, + id: i64, + ) -> Result> { + todo!("not implemented") + } + async fn get_release_attachment( + &self, + owner: &str, + repo: &str, + id: i64, + attachment_id: i64, + ) -> Result> { + todo!("not implemented") + } + async fn get_release_by_tag( + &self, + owner: &str, + repo: &str, + tag: &str, + ) -> Result> { + todo!("not implemented") + } + async fn get_repo_permissions( + &self, + owner: &str, + repo: &str, + collaborator: &str, + ) -> Result> { + todo!("not implemented") + } + async fn get_reviewers( + &self, + owner: &str, + repo: &str, + ) -> Result, Error> { + todo!("not implemented") + } + async fn get_single_commit( + &self, + owner: &str, + repo: &str, + sha: &str, + ) -> Result> { + todo!("not implemented") + } + async fn get_tag( + &self, + owner: &str, + repo: &str, + tag: &str, + ) -> Result> { + todo!("not implemented") + } + async fn get_wiki_page( + &self, + owner: &str, + repo: &str, + page_name: &str, + ) -> Result> { + todo!("not implemented") + } + async fn get_wiki_page_revisions( + &self, + owner: &str, + repo: &str, + page_name: &str, + page: Option, + ) -> Result> { + todo!("not implemented") + } + async fn get_wiki_pages( + &self, + owner: &str, + repo: &str, + page: Option, + limit: Option, + ) -> Result, Error> { + todo!("not implemented") + } + async fn list_all_git_refs( + &self, + owner: &str, + repo: &str, + ) -> Result, Error> { + todo!("not implemented") + } + async fn list_branch_protection( + &self, + owner: &str, + repo: &str, + ) -> Result, Error> { + todo!("not implemented") + } + async fn list_branches( + &self, + owner: &str, + repo: &str, + page: Option, + limit: Option, + ) -> Result, Error> { + todo!("not implemented") + } + async fn list_collaborators( + &self, + owner: &str, + repo: &str, + page: Option, + limit: Option, + ) -> Result, Error> { + todo!("not implemented") + } + async fn list_git_hooks( + &self, + owner: &str, + repo: &str, + ) -> Result, Error> { + todo!("not implemented") + } + async fn list_git_refs( + &self, + owner: &str, + repo: &str, + r#ref: &str, + ) -> Result, Error> { + todo!("not implemented") + } + async fn list_hooks( + &self, + owner: &str, + repo: &str, + page: Option, + limit: Option, + ) -> Result, Error> { + todo!("not implemented") + } + async fn list_keys( + &self, + owner: &str, + repo: &str, + key_id: Option, + fingerprint: Option<&str>, + page: Option, + limit: Option, + ) -> Result, Error> { + todo!("not implemented") + } + async fn list_pull_requests( + &self, + owner: &str, + repo: &str, + state: Option<&str>, + sort: Option<&str>, + milestone: Option, + labels: Option>, + page: Option, + limit: Option, + ) -> Result, Error> { + todo!("not implemented") + } + async fn list_pull_reviews( + &self, + owner: &str, + repo: &str, + index: i64, + page: Option, + limit: Option, + ) -> Result, Error> { + todo!("not implemented") + } + async fn list_release_attachments( + &self, + owner: &str, + repo: &str, + id: i64, + ) -> Result, Error> { + todo!("not implemented") + } + async fn list_releases( + &self, + owner: &str, + repo: &str, + draft: Option, + pre_release: Option, + per_page: Option, + page: Option, + limit: Option, + ) -> Result, Error> { + todo!("not implemented") + } + async fn list_stargazers( + &self, + owner: &str, + repo: &str, + page: Option, + limit: Option, + ) -> Result, Error> { + todo!("not implemented") + } + async fn list_statuses( + &self, + owner: &str, + repo: &str, + sha: &str, + sort: Option<&str>, + state: Option<&str>, + page: Option, + limit: Option, + ) -> Result, Error> { + todo!("not implemented") + } + async fn list_statuses_by_ref( + &self, + owner: &str, + repo: &str, + r#ref: &str, + sort: Option<&str>, + state: Option<&str>, + page: Option, + limit: Option, + ) -> Result, Error> { + todo!("not implemented") + } + async fn list_subscribers( + &self, + owner: &str, + repo: &str, + page: Option, + limit: Option, + ) -> Result, Error> { + todo!("not implemented") + } + async fn list_tags( + &self, + owner: &str, + repo: &str, + page: Option, + limit: Option, + ) -> Result, Error> { + todo!("not implemented") + } + async fn list_teams( + &self, + owner: &str, + repo: &str, + ) -> Result, Error> { + todo!("not implemented") + } + async fn list_topics( + &self, + owner: &str, + repo: &str, + page: Option, + limit: Option, + ) -> Result> { + todo!("not implemented") + } + async fn merge_pull_request( + &self, + owner: &str, + repo: &str, + index: i64, + body: Option, + ) -> Result<(), Error> { + todo!("not implemented") + } + async fn migrate( + &self, + body: Option, + ) -> Result> { + todo!("not implemented") + } + async fn mirror_sync(&self, owner: &str, repo: &str) -> Result<(), Error> { + todo!("not implemented") + } + async fn pull_request_is_merged( + &self, + owner: &str, + repo: &str, + index: i64, + ) -> Result<(), Error> { + todo!("not implemented") + } + async fn search( + &self, + 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> { + todo!("not implemented") + } + async fn signing_key( + &self, + owner: &str, + repo: &str, + ) -> Result> { + todo!("not implemented") + } + async fn submit_pull_review( + &self, + owner: &str, + repo: &str, + index: i64, + id: i64, + body: models::SubmitPullReviewOptions, + ) -> Result> { + todo!("not implemented") + } + async fn test_hook( + &self, + owner: &str, + repo: &str, + id: i64, + r#ref: Option<&str>, + ) -> Result<(), Error> { + todo!("not implemented") + } + async fn tracked_times( + &self, + owner: &str, + repo: &str, + user: Option<&str>, + since: Option, + before: Option, + page: Option, + limit: Option, + ) -> Result, Error> { + todo!("not implemented") + } + async fn transfer( + &self, + owner: &str, + repo: &str, + body: models::TransferRepoOption, + ) -> Result> { + todo!("not implemented") + } + async fn un_dismiss_pull_review( + &self, + owner: &str, + repo: &str, + index: i64, + id: i64, + ) -> Result> { + todo!("not implemented") + } + async fn update_file( + &self, + owner: &str, + repo: &str, + filepath: &str, + body: models::UpdateFileOptions, + ) -> Result> { + todo!("not implemented") + } + async fn update_pull_request( + &self, + owner: &str, + repo: &str, + index: i64, + style: Option<&str>, + ) -> Result<(), Error> { + todo!("not implemented") + } + async fn update_topics( + &self, + owner: &str, + repo: &str, + body: Option, + ) -> Result<(), Error> { + todo!("not implemented") + } + async fn topic_search( + &self, + q: &str, + page: Option, + limit: Option, + ) -> Result, Error> { + todo!("not implemented") + } + async fn user_current_check_subscription( + &self, + owner: &str, + repo: &str, + ) -> Result> { + todo!("not implemented") + } + async fn user_current_delete_subscription( + &self, + owner: &str, + repo: &str, + ) -> Result<(), Error> { + todo!("not implemented") + } + async fn user_current_put_subscription( + &self, + owner: &str, + repo: &str, + ) -> Result> { + todo!("not implemented") + } + async fn user_tracked_times( + &self, + owner: &str, + repo: &str, + user: &str, + ) -> Result, Error> { + todo!("not implemented") + } +} diff --git a/crates/gitea_client/src/apis/mod.rs b/crates/gitea_client/src/apis/mod.rs new file mode 100644 index 0000000..4e31914 --- /dev/null +++ b/crates/gitea_client/src/apis/mod.rs @@ -0,0 +1,2 @@ +pub mod defaults; +pub mod repository; diff --git a/crates/gitea_client/src/apis/repository.rs b/crates/gitea_client/src/apis/repository.rs new file mode 100644 index 0000000..34a5c64 --- /dev/null +++ b/crates/gitea_client/src/apis/repository.rs @@ -0,0 +1,841 @@ +use std::sync::Arc; + +use async_trait::async_trait; +use gitea_raw_client::{apis::Error, models}; + +pub use gitea_raw_client::apis::repository_api::*; + +#[async_trait] +pub trait Repository { + async fn accept_transfer( + &self, + owner: &str, + repo: &str, + ) -> Result>; + async fn create_current_user_repo( + &self, + body: Option, + ) -> Result>; + async fn create_fork( + &self, + owner: &str, + repo: &str, + body: Option, + ) -> Result>; + async fn generate_repo( + &self, + template_owner: &str, + template_repo: &str, + body: Option, + ) -> Result>; + async fn get_annotated_tag( + &self, + owner: &str, + repo: &str, + sha: &str, + ) -> Result>; + async fn get_blob( + &self, + owner: &str, + repo: &str, + sha: &str, + ) -> Result>; + async fn get_tree( + &self, + owner: &str, + repo: &str, + sha: &str, + recursive: Option, + page: Option, + per_page: Option, + ) -> Result>; + async fn list_forks( + &self, + owner: &str, + repo: &str, + page: Option, + limit: Option, + ) -> Result, Error>; + async fn reject_transfer( + &self, + owner: &str, + repo: &str, + ) -> Result>; + async fn add_collaborator( + &self, + owner: &str, + repo: &str, + collaborator: &str, + body: Option, + ) -> Result<(), Error>; + async fn add_team( + &self, + owner: &str, + repo: &str, + team: &str, + ) -> Result<(), Error>; + async fn add_topic( + &self, + owner: &str, + repo: &str, + topic: &str, + ) -> Result<(), Error>; + async fn apply_diff_patch( + &self, + owner: &str, + repo: &str, + body: models::UpdateFileOptions, + ) -> Result>; + async fn cancel_scheduled_auto_merge( + &self, + owner: &str, + repo: &str, + index: i64, + ) -> Result<(), Error>; + async fn check_collaborator( + &self, + owner: &str, + repo: &str, + collaborator: &str, + ) -> Result<(), Error>; + async fn check_team( + &self, + owner: &str, + repo: &str, + team: &str, + ) -> Result>; + async fn create_branch( + &self, + owner: &str, + repo: &str, + body: Option, + ) -> Result>; + async fn create_branch_protection( + &self, + owner: &str, + repo: &str, + body: Option, + ) -> Result>; + async fn create_file( + &self, + owner: &str, + repo: &str, + filepath: &str, + body: models::CreateFileOptions, + ) -> Result>; + async fn create_hook( + &self, + owner: &str, + repo: &str, + body: Option, + ) -> Result>; + async fn create_key( + &self, + owner: &str, + repo: &str, + body: Option, + ) -> Result>; + async fn create_pull_request( + &self, + owner: &str, + repo: &str, + body: Option, + ) -> Result>; + async fn create_pull_review( + &self, + owner: &str, + repo: &str, + index: i64, + body: models::CreatePullReviewOptions, + ) -> Result>; + async fn create_pull_review_requests( + &self, + owner: &str, + repo: &str, + index: i64, + body: models::PullReviewRequestOptions, + ) -> Result, Error>; + async fn create_release( + &self, + owner: &str, + repo: &str, + body: Option, + ) -> Result>; + async fn create_release_attachment( + &self, + owner: &str, + repo: &str, + id: i64, + attachment: std::path::PathBuf, + name: Option<&str>, + ) -> Result>; + async fn create_status( + &self, + owner: &str, + repo: &str, + sha: &str, + body: Option, + ) -> Result>; + async fn create_tag( + &self, + owner: &str, + repo: &str, + body: Option, + ) -> Result>; + async fn create_wiki_page( + &self, + owner: &str, + repo: &str, + body: Option, + ) -> Result>; + async fn delete(&self, owner: &str, repo: &str) -> Result<(), Error>; + async fn delete_branch( + &self, + owner: &str, + repo: &str, + branch: &str, + ) -> Result<(), Error>; + async fn delete_branch_protection( + &self, + owner: &str, + repo: &str, + name: &str, + ) -> Result<(), Error>; + async fn delete_collaborator( + &self, + owner: &str, + repo: &str, + collaborator: &str, + ) -> Result<(), Error>; + async fn delete_file( + &self, + owner: &str, + repo: &str, + filepath: &str, + body: models::DeleteFileOptions, + ) -> Result>; + async fn delete_git_hook( + &self, + owner: &str, + repo: &str, + id: &str, + ) -> Result<(), Error>; + async fn delete_hook( + &self, + owner: &str, + repo: &str, + id: i64, + ) -> Result<(), Error>; + async fn delete_key( + &self, + owner: &str, + repo: &str, + id: i64, + ) -> Result<(), Error>; + async fn delete_pull_review( + &self, + owner: &str, + repo: &str, + index: i64, + id: i64, + ) -> Result<(), Error>; + async fn delete_pull_review_requests( + &self, + owner: &str, + repo: &str, + index: i64, + body: models::PullReviewRequestOptions, + ) -> Result<(), Error>; + async fn delete_release( + &self, + owner: &str, + repo: &str, + id: i64, + ) -> Result<(), Error>; + async fn delete_release_attachment( + &self, + owner: &str, + repo: &str, + id: i64, + attachment_id: i64, + ) -> Result<(), Error>; + async fn delete_release_by_tag( + &self, + owner: &str, + repo: &str, + tag: &str, + ) -> Result<(), Error>; + async fn delete_tag( + &self, + owner: &str, + repo: &str, + tag: &str, + ) -> Result<(), Error>; + async fn delete_team( + &self, + owner: &str, + repo: &str, + team: &str, + ) -> Result<(), Error>; + async fn delete_topic( + &self, + owner: &str, + repo: &str, + topic: &str, + ) -> Result<(), Error>; + async fn delete_wiki_page( + &self, + owner: &str, + repo: &str, + page_name: &str, + ) -> Result<(), Error>; + async fn dismiss_pull_review( + &self, + owner: &str, + repo: &str, + index: i64, + id: i64, + body: models::DismissPullReviewOptions, + ) -> Result>; + async fn download_commit_diff_or_patch( + &self, + owner: &str, + repo: &str, + sha: &str, + diff_type: &str, + ) -> Result>; + async fn download_pull_diff_or_patch( + &self, + owner: &str, + repo: &str, + index: i64, + diff_type: &str, + binary: Option, + ) -> Result>; + async fn edit( + &self, + owner: &str, + repo: &str, + body: Option, + ) -> Result>; + async fn edit_branch_protection( + &self, + owner: &str, + repo: &str, + name: &str, + body: Option, + ) -> Result>; + async fn edit_git_hook( + &self, + owner: &str, + repo: &str, + id: &str, + body: Option, + ) -> Result>; + async fn edit_hook( + &self, + owner: &str, + repo: &str, + id: i64, + body: Option, + ) -> Result>; + async fn edit_pull_request( + &self, + owner: &str, + repo: &str, + index: i64, + body: Option, + ) -> Result>; + async fn edit_release( + &self, + owner: &str, + repo: &str, + id: i64, + body: Option, + ) -> Result>; + async fn edit_release_attachment( + &self, + owner: &str, + repo: &str, + id: i64, + attachment_id: i64, + body: Option, + ) -> Result>; + async fn edit_wiki_page( + &self, + owner: &str, + repo: &str, + page_name: &str, + body: Option, + ) -> Result>; + async fn get(&self, owner: &str, repo: &str) + -> Result>; + async fn get_all_commits( + &self, + owner: &str, + repo: &str, + sha: Option<&str>, + path: Option<&str>, + page: Option, + limit: Option, + ) -> Result, Error>; + async fn get_archive( + &self, + owner: &str, + repo: &str, + archive: &str, + ) -> Result<(), Error>; + async fn get_assignees( + &self, + owner: &str, + repo: &str, + ) -> Result, Error>; + async fn get_branch( + &self, + owner: &str, + repo: &str, + branch: &str, + ) -> Result>; + async fn get_branch_protection( + &self, + owner: &str, + repo: &str, + name: &str, + ) -> Result>; + async fn get_by_id(&self, id: i64) -> Result>; + async fn get_combined_status_by_ref( + &self, + owner: &str, + repo: &str, + r#ref: &str, + page: Option, + limit: Option, + ) -> Result>; + async fn get_contents( + &self, + owner: &str, + repo: &str, + filepath: &str, + r#ref: Option<&str>, + ) -> Result>; + async fn get_contents_list( + &self, + owner: &str, + repo: &str, + r#ref: Option<&str>, + ) -> Result, Error>; + async fn get_editor_config( + &self, + owner: &str, + repo: &str, + filepath: &str, + r#ref: Option<&str>, + ) -> Result<(), Error>; + async fn get_git_hook( + &self, + owner: &str, + repo: &str, + id: &str, + ) -> Result>; + async fn get_hook( + &self, + owner: &str, + repo: &str, + id: i64, + ) -> Result>; + async fn get_issue_templates( + &self, + owner: &str, + repo: &str, + ) -> Result, Error>; + async fn get_key( + &self, + owner: &str, + repo: &str, + id: i64, + ) -> Result>; + async fn get_languages( + &self, + owner: &str, + repo: &str, + ) -> Result<::std::collections::HashMap, Error>; + async fn get_note( + &self, + owner: &str, + repo: &str, + sha: &str, + ) -> Result>; + async fn get_pull_request( + &self, + owner: &str, + repo: &str, + index: i64, + ) -> Result>; + async fn get_pull_request_commits( + &self, + owner: &str, + repo: &str, + index: i64, + page: Option, + limit: Option, + ) -> Result, Error>; + async fn get_pull_review( + &self, + owner: &str, + repo: &str, + index: i64, + id: i64, + ) -> Result>; + async fn get_pull_review_comments( + &self, + owner: &str, + repo: &str, + index: i64, + id: i64, + ) -> Result, Error>; + async fn get_raw_file( + &self, + owner: &str, + repo: &str, + filepath: &str, + r#ref: Option<&str>, + ) -> Result<(), Error>; + async fn get_raw_file_or_lfs( + &self, + owner: &str, + repo: &str, + filepath: &str, + r#ref: Option<&str>, + ) -> Result<(), Error>; + async fn get_release( + &self, + owner: &str, + repo: &str, + id: i64, + ) -> Result>; + async fn get_release_attachment( + &self, + owner: &str, + repo: &str, + id: i64, + attachment_id: i64, + ) -> Result>; + async fn get_release_by_tag( + &self, + owner: &str, + repo: &str, + tag: &str, + ) -> Result>; + async fn get_repo_permissions( + &self, + owner: &str, + repo: &str, + collaborator: &str, + ) -> Result>; + async fn get_reviewers( + &self, + owner: &str, + repo: &str, + ) -> Result, Error>; + async fn get_single_commit( + &self, + owner: &str, + repo: &str, + sha: &str, + ) -> Result>; + async fn get_tag( + &self, + owner: &str, + repo: &str, + tag: &str, + ) -> Result>; + async fn get_wiki_page( + &self, + owner: &str, + repo: &str, + page_name: &str, + ) -> Result>; + async fn get_wiki_page_revisions( + &self, + owner: &str, + repo: &str, + page_name: &str, + page: Option, + ) -> Result>; + async fn get_wiki_pages( + &self, + owner: &str, + repo: &str, + page: Option, + limit: Option, + ) -> Result, Error>; + async fn list_all_git_refs( + &self, + owner: &str, + repo: &str, + ) -> Result, Error>; + async fn list_branch_protection( + &self, + owner: &str, + repo: &str, + ) -> Result, Error>; + async fn list_branches( + &self, + owner: &str, + repo: &str, + page: Option, + limit: Option, + ) -> Result, Error>; + async fn list_collaborators( + &self, + owner: &str, + repo: &str, + page: Option, + limit: Option, + ) -> Result, Error>; + async fn list_git_hooks( + &self, + owner: &str, + repo: &str, + ) -> Result, Error>; + async fn list_git_refs( + &self, + owner: &str, + repo: &str, + r#ref: &str, + ) -> Result, Error>; + async fn list_hooks( + &self, + owner: &str, + repo: &str, + page: Option, + limit: Option, + ) -> Result, Error>; + async fn list_keys( + &self, + owner: &str, + repo: &str, + key_id: Option, + fingerprint: Option<&str>, + page: Option, + limit: Option, + ) -> Result, Error>; + async fn list_pull_requests( + &self, + owner: &str, + repo: &str, + state: Option<&str>, + sort: Option<&str>, + milestone: Option, + labels: Option>, + page: Option, + limit: Option, + ) -> Result, Error>; + async fn list_pull_reviews( + &self, + owner: &str, + repo: &str, + index: i64, + page: Option, + limit: Option, + ) -> Result, Error>; + async fn list_release_attachments( + &self, + owner: &str, + repo: &str, + id: i64, + ) -> Result, Error>; + async fn list_releases( + &self, + owner: &str, + repo: &str, + draft: Option, + pre_release: Option, + per_page: Option, + page: Option, + limit: Option, + ) -> Result, Error>; + async fn list_stargazers( + &self, + owner: &str, + repo: &str, + page: Option, + limit: Option, + ) -> Result, Error>; + async fn list_statuses( + &self, + owner: &str, + repo: &str, + sha: &str, + sort: Option<&str>, + state: Option<&str>, + page: Option, + limit: Option, + ) -> Result, Error>; + async fn list_statuses_by_ref( + &self, + owner: &str, + repo: &str, + r#ref: &str, + sort: Option<&str>, + state: Option<&str>, + page: Option, + limit: Option, + ) -> Result, Error>; + async fn list_subscribers( + &self, + owner: &str, + repo: &str, + page: Option, + limit: Option, + ) -> Result, Error>; + async fn list_tags( + &self, + owner: &str, + repo: &str, + page: Option, + limit: Option, + ) -> Result, Error>; + async fn list_teams( + &self, + owner: &str, + repo: &str, + ) -> Result, Error>; + async fn list_topics( + &self, + owner: &str, + repo: &str, + page: Option, + limit: Option, + ) -> Result>; + async fn merge_pull_request( + &self, + owner: &str, + repo: &str, + index: i64, + body: Option, + ) -> Result<(), Error>; + async fn migrate( + &self, + body: Option, + ) -> Result>; + async fn mirror_sync(&self, owner: &str, repo: &str) -> Result<(), Error>; + async fn pull_request_is_merged( + &self, + owner: &str, + repo: &str, + index: i64, + ) -> Result<(), Error>; + async fn search( + &self, + 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>; + async fn signing_key( + &self, + owner: &str, + repo: &str, + ) -> Result>; + async fn submit_pull_review( + &self, + owner: &str, + repo: &str, + index: i64, + id: i64, + body: models::SubmitPullReviewOptions, + ) -> Result>; + async fn test_hook( + &self, + owner: &str, + repo: &str, + id: i64, + r#ref: Option<&str>, + ) -> Result<(), Error>; + async fn tracked_times( + &self, + owner: &str, + repo: &str, + user: Option<&str>, + since: Option, + before: Option, + page: Option, + limit: Option, + ) -> Result, Error>; + async fn transfer( + &self, + owner: &str, + repo: &str, + body: models::TransferRepoOption, + ) -> Result>; + async fn un_dismiss_pull_review( + &self, + owner: &str, + repo: &str, + index: i64, + id: i64, + ) -> Result>; + async fn update_file( + &self, + owner: &str, + repo: &str, + filepath: &str, + body: models::UpdateFileOptions, + ) -> Result>; + async fn update_pull_request( + &self, + owner: &str, + repo: &str, + index: i64, + style: Option<&str>, + ) -> Result<(), Error>; + async fn update_topics( + &self, + owner: &str, + repo: &str, + body: Option, + ) -> Result<(), Error>; + async fn topic_search( + &self, + q: &str, + page: Option, + limit: Option, + ) -> Result, Error>; + async fn user_current_check_subscription( + &self, + owner: &str, + repo: &str, + ) -> Result>; + async fn user_current_delete_subscription( + &self, + owner: &str, + repo: &str, + ) -> Result<(), Error>; + async fn user_current_put_subscription( + &self, + owner: &str, + repo: &str, + ) -> Result>; + async fn user_tracked_times( + &self, + owner: &str, + repo: &str, + user: &str, + ) -> Result, Error>; +} + +pub type DynRepository = Arc; diff --git a/crates/gitea_client/src/builder.rs b/crates/gitea_client/src/builder.rs new file mode 100644 index 0000000..fbb3470 --- /dev/null +++ b/crates/gitea_client/src/builder.rs @@ -0,0 +1,66 @@ +use gitea_raw_client::apis::configuration::{ApiKey, Configuration}; + +use crate::client::GiteaClient; + +pub struct GiteaClientBuilder { + conf: Configuration, +} + +impl GiteaClientBuilder { + pub fn new() -> Self { + Self::default() + } + + pub fn set_basic_auth(mut self, username: String, password: Option) -> Self { + self.conf.basic_auth = Some((username, password)); + self + } + + pub fn set_oauth(mut self, oauth_token: String) -> Self { + self.conf.oauth_access_token = Some(oauth_token); + self + } + + pub fn set_bearer(mut self, bearer_token: String) -> Self { + self.conf.bearer_access_token = Some(bearer_token); + self + } + + pub fn set_api_key(mut self, api_key: String, prefix: Option) -> Self { + self.conf.api_key = Some(ApiKey { + key: api_key, + prefix, + }); + self + } + + pub fn set_base_path(mut self, base_path: &String) -> Self { + self.conf.base_path = base_path.clone(); + self + } + + pub fn set_client(mut self, client: reqwest::Client) -> Self { + self.conf.client = client; + self + } + + pub fn build(self) -> GiteaClient { + GiteaClient::new(self.conf) + } +} + +impl Default for GiteaClientBuilder { + fn default() -> Self { + Self { + conf: Configuration::default(), + } + } +} + +impl From for GiteaClientBuilder { + fn from(conf: Configuration) -> Self { + let mut s = Self::default(); + s.conf = conf; + s + } +} diff --git a/crates/gitea_client/src/client.rs b/crates/gitea_client/src/client.rs new file mode 100644 index 0000000..13c26a5 --- /dev/null +++ b/crates/gitea_client/src/client.rs @@ -0,0 +1,29 @@ +use std::sync::Arc; + +use gitea_raw_client::apis::configuration::Configuration; + +use crate::apis::{defaults::repository::DefaultRepository, repository::DynRepository}; + +pub struct GiteaClient { + repository: DynRepository, +} + +impl GiteaClient { + pub fn new(config: Configuration) -> Self { + let conf = Arc::new(config); + + Self { + repository: Arc::new(DefaultRepository::new(conf.clone())), + } + } + + pub fn repository(&self) -> DynRepository { + self.repository.clone() + } +} + +impl From for GiteaClient { + fn from(conf: Configuration) -> Self { + Self::new(conf) + } +} diff --git a/crates/gitea_client/src/lib.rs b/crates/gitea_client/src/lib.rs new file mode 100644 index 0000000..621c360 --- /dev/null +++ b/crates/gitea_client/src/lib.rs @@ -0,0 +1,8 @@ +pub mod apis; +pub mod builder; +pub mod client; + +pub mod models { + pub use gitea_raw_client::models::*; +} + 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 new file mode 100644 index 0000000..425c23c --- /dev/null +++ b/crates/gitea_raw_client/Cargo.toml @@ -0,0 +1,17 @@ +[package] +name = "gitea_raw_client" +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 new file mode 100644 index 0000000..a594199 --- /dev/null +++ b/crates/gitea_raw_client/scripts/generate_client.Dockerfile @@ -0,0 +1,3 @@ +FROM openapitools/openapi-generator-cli + +WORKDIR /src/app diff --git a/crates/gitea_raw_client/scripts/generate_client.docker-compose.yml b/crates/gitea_raw_client/scripts/generate_client.docker-compose.yml new file mode 100644 index 0000000..2430b24 --- /dev/null +++ b/crates/gitea_raw_client/scripts/generate_client.docker-compose.yml @@ -0,0 +1,25 @@ +version: "3" + +services: + gitea: + image: "gitea/gitea:1.17.3" + environment: + ROOT_URL: "http://gitea:3000" + INSTALL_LOCK: "true" + healthcheck: + test: curl --fail http://localhost:3000 || exit 1 + interval: 5s + retries: 5 + start_period: 5s + timeout: 10s + + generator: + build: + dockerfile: scripts/generate_client.Dockerfile + context: ../ + command: "generate -i http://gitea:3000/swagger.v1.json -g rust -o /mnt/generated/ -p packageName=gitea_raw_client" + volumes: + - "../:/mnt/generated/" + depends_on: + gitea: + condition: service_healthy diff --git a/crates/gitea_raw_client/scripts/generate_client.sh b/crates/gitea_raw_client/scripts/generate_client.sh new file mode 100755 index 0000000..1539e7c --- /dev/null +++ b/crates/gitea_raw_client/scripts/generate_client.sh @@ -0,0 +1,7 @@ +#!/bin/bash + +set -e + +docker compose -f scripts/generate_client.docker-compose.yml build +docker compose -f scripts/generate_client.docker-compose.yml up generator +docker compose -f scripts/generate_client.docker-compose.yml down diff --git a/crates/gitea_raw_client/src/.gitignore b/crates/gitea_raw_client/src/.gitignore new file mode 100644 index 0000000..6aa1064 --- /dev/null +++ b/crates/gitea_raw_client/src/.gitignore @@ -0,0 +1,3 @@ +/target/ +**/*.rs.bk +Cargo.lock diff --git a/crates/gitea_raw_client/src/.openapi-generator-ignore b/crates/gitea_raw_client/src/.openapi-generator-ignore new file mode 100644 index 0000000..7484ee5 --- /dev/null +++ b/crates/gitea_raw_client/src/.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/src/.openapi-generator/FILES b/crates/gitea_raw_client/src/.openapi-generator/FILES new file mode 100644 index 0000000..f132361 --- /dev/null +++ b/crates/gitea_raw_client/src/.openapi-generator/FILES @@ -0,0 +1,336 @@ +.gitignore +.openapi-generator-ignore +.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/src/.openapi-generator/VERSION b/crates/gitea_raw_client/src/.openapi-generator/VERSION new file mode 100644 index 0000000..d6b4ec4 --- /dev/null +++ b/crates/gitea_raw_client/src/.openapi-generator/VERSION @@ -0,0 +1 @@ +6.3.0-SNAPSHOT \ No newline at end of file diff --git a/crates/gitea_raw_client/src/.travis.yml b/crates/gitea_raw_client/src/.travis.yml new file mode 100644 index 0000000..22761ba --- /dev/null +++ b/crates/gitea_raw_client/src/.travis.yml @@ -0,0 +1 @@ +language: rust 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, + } + } +} + + diff --git a/crates/octopush_cli/.gitignore b/crates/octopush_cli/.gitignore new file mode 100644 index 0000000..4fffb2f --- /dev/null +++ b/crates/octopush_cli/.gitignore @@ -0,0 +1,2 @@ +/target +/Cargo.lock diff --git a/crates/octopush_cli/Cargo.toml b/crates/octopush_cli/Cargo.toml new file mode 100644 index 0000000..807b1d9 --- /dev/null +++ b/crates/octopush_cli/Cargo.toml @@ -0,0 +1,16 @@ +[package] +name = "octopush_cli" +version = "0.1.0" +edition = "2021" + +# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html + +[dependencies] +octopush_infra = { path = "../octopush_infra" } +octopush_core = { path = "../octopush_core" } + +eyre = { workspace = true } +tracing = { workspace = true } +tokio = { workspace = true } + +clap = { version = "4.0.18", features = ["env"] } diff --git a/crates/octopush_cli/src/commands/execute.rs b/crates/octopush_cli/src/commands/execute.rs new file mode 100644 index 0000000..82ad4da --- /dev/null +++ b/crates/octopush_cli/src/commands/execute.rs @@ -0,0 +1,100 @@ +use std::path::PathBuf; + +use clap::{Arg, ArgAction, ArgMatches, Command}; +use octopush_core::{ + git::{git::LocalGitProviderOptions, gitea::client::DefaultGiteaClientOptions}, + schema, +}; +use octopush_infra::service_register::ServiceRegister; + +pub fn execute_cmd() -> Command { + Command::new("execute") + .about("execute a certain action") + .arg( + Arg::new("action") + .long("action") + .short('a') + .action(ArgAction::Set) + .help("action path to your local octopush.yaml file") + .long_help("action path to your local octopush.yaml file") + .default_value(".") + .required(true), + ) + .arg( + Arg::new("gitea-api-token") + .long("gitea-api-token") + .action(ArgAction::Set) + .env("GITEA_API_TOKEN") + .required(false), + ) + .arg( + Arg::new("gitea-username") + .long("gitea-username") + .action(ArgAction::Set) + .env("GITEA_USERNAME") + .required(false), + ) + .arg( + Arg::new("gitea-url") + .long("gitea-url") + .action(ArgAction::Set) + .env("GITEA_URL") + .required(false), + ) +} + +pub async fn execute_subcommand(args: &ArgMatches) -> eyre::Result<()> { + let action = args + .get_one::("action") + .ok_or(eyre::anyhow!("--action is required"))?; + + let gitea_http_token = args.get_one::("gitea-api-token"); + let gitea_username = args.get_one::("gitea-username"); + let gitea_url = args.get_one::("gitea-url"); + + let service_register = ServiceRegister::new( + LocalGitProviderOptions { http_auth: None }, + DefaultGiteaClientOptions { + url: gitea_url.map(|g| g.clone()).unwrap_or("".into()), + basicauth: gitea_username + .zip(gitea_http_token) + .map(|(u, ht)| format!("{}:{}", u, ht)) + .map(|t| t.clone()), + }, + ); + + let action_path: PathBuf = action.into(); + + let schema = service_register + .schema_parser + .parse_file(action_path.join("octopush.yml")) + .await?; + + match schema { + schema::models::Schema::Action { + name, + select, + action, + } => { + tracing::debug!(name, "running action"); + + if let Some(git) = &select.git { + service_register + .git_selector + .run(git, &action_path, &action) + .await?; + } + + if let Some(gitea) = &select.gitea { + service_register + .gitea_selector + .run(gitea, &action_path, &action) + .await?; + } + } + } + + service_register.cleanup().await?; + + Ok(()) +} diff --git a/crates/octopush_cli/src/commands/mod.rs b/crates/octopush_cli/src/commands/mod.rs new file mode 100644 index 0000000..2e8bddd --- /dev/null +++ b/crates/octopush_cli/src/commands/mod.rs @@ -0,0 +1 @@ +pub mod execute; diff --git a/crates/octopush_cli/src/lib.rs b/crates/octopush_cli/src/lib.rs new file mode 100644 index 0000000..8d895fd --- /dev/null +++ b/crates/octopush_cli/src/lib.rs @@ -0,0 +1,39 @@ +mod commands; + +use clap::Command; + +const VERSION: &str = "1.0.0"; + +#[derive(Debug)] +pub struct OctopushCli { + cmd: clap::Command, +} + +impl OctopushCli { + pub fn new() -> Self { + let cmd = Command::new("octopush") + .version(VERSION) + .author("Kasper J. Hermansen ") + .about("Your cute action executor") + .propagate_version(true) + .subcommand_required(true) + .subcommand(commands::execute::execute_cmd()); + + Self { cmd } + } + + pub async fn execute(self) -> eyre::Result<()> { + let matches = self.cmd.get_matches(); + + match matches.subcommand() { + Some(("execute", execute_sub)) => { + tracing::debug!("executing subcommand 'execute'"); + commands::execute::execute_subcommand(execute_sub).await?; + } + Some(_) => return Err(eyre::anyhow!("unknown subcommand, please see --help")), + None => return Err(eyre::anyhow!("no subcommand specified")), + } + + Ok(()) + } +} diff --git a/crates/octopush_core/Cargo.toml b/crates/octopush_core/Cargo.toml new file mode 100644 index 0000000..ad4e1a2 --- /dev/null +++ b/crates/octopush_core/Cargo.toml @@ -0,0 +1,23 @@ +[package] +name = "octopush_core" +version = "0.1.0" +edition = "2021" + +# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html + +[dependencies] +gitea_client = { path = "../gitea_client" } + +async-trait = { workspace = true } +eyre = { workspace = true } +tokio = { workspace = true } +tracing = { workspace = true } + +rand = "0.8.5" +hex = "0.4.3" +git2 = { version = "0.15.0", features = [ + "vendored-libgit2", + "vendored-openssl", +] } +serde = { version = "1.0.147", features = ["derive"] } +serde_yaml = "0.9.14" diff --git a/crates/octopush_core/src/builder/builder_capabilities.rs b/crates/octopush_core/src/builder/builder_capabilities.rs new file mode 100644 index 0000000..ac4517e --- /dev/null +++ b/crates/octopush_core/src/builder/builder_capabilities.rs @@ -0,0 +1,36 @@ +use std::{path::PathBuf, sync::Arc}; + +use async_trait::async_trait; + +use crate::schema::models::Action; + +use super::{ + builders::golang_bin::{GolangBinBuild, GolangBinBuildOpts}, + Builder, DynRunnableBin, +}; + +pub struct BuilderCapabilities; + +impl BuilderCapabilities { + pub fn new() -> Self { + Self {} + } +} + +#[async_trait] +impl Builder for BuilderCapabilities { + async fn build(&self, action_path: &PathBuf, action: &Action) -> eyre::Result { + match action { + Action::Go { entry } => { + let bin = GolangBinBuild::new() + .build(GolangBinBuildOpts { + entry: entry.clone(), + src_path: action_path.clone(), + }) + .await?; + + Ok(Arc::new(bin)) + } + } + } +} diff --git a/crates/octopush_core/src/builder/builders/golang_bin.rs b/crates/octopush_core/src/builder/builders/golang_bin.rs new file mode 100644 index 0000000..03cbeb1 --- /dev/null +++ b/crates/octopush_core/src/builder/builders/golang_bin.rs @@ -0,0 +1,59 @@ +use std::path::PathBuf; + +use async_trait::async_trait; + +use crate::{builder::RunnableBin, shell::execute_shell}; + +pub struct GolangBinBuildOpts { + pub entry: String, + pub src_path: PathBuf, +} + +pub struct GolangBinBuild; + +impl GolangBinBuild { + pub fn new() -> Self { + Self {} + } + + pub async fn build(&self, opts: GolangBinBuildOpts) -> eyre::Result { + tracing::trace!( + src = opts.src_path.to_string_lossy().to_string(), + entry = opts.entry, + "build golang_bin" + ); + + execute_shell( + format!("go build -o dist/bin {}", opts.entry), + Some(opts.src_path.clone()), + ) + .await?; + + let abs_path = std::fs::canonicalize(opts.src_path.join("dist/bin"))?; + + Ok(GolangBin::new(abs_path)) + } +} + +pub struct GolangBin { + path: PathBuf, +} + +impl GolangBin { + fn new(path: PathBuf) -> Self { + Self { path } + } +} + +#[async_trait] +impl RunnableBin for GolangBin { + async fn run(&self, victim_path: &PathBuf) -> eyre::Result<()> { + execute_shell( + self.path.to_string_lossy().to_string(), + Some(victim_path.clone()), + ) + .await?; + + Ok(()) + } +} diff --git a/crates/octopush_core/src/builder/builders/mod.rs b/crates/octopush_core/src/builder/builders/mod.rs new file mode 100644 index 0000000..9b0dbd0 --- /dev/null +++ b/crates/octopush_core/src/builder/builders/mod.rs @@ -0,0 +1 @@ +pub mod golang_bin; diff --git a/crates/octopush_core/src/builder/mod.rs b/crates/octopush_core/src/builder/mod.rs new file mode 100644 index 0000000..a99ca6d --- /dev/null +++ b/crates/octopush_core/src/builder/mod.rs @@ -0,0 +1,22 @@ +pub mod builder_capabilities; +mod builders; + +use std::{path::PathBuf, sync::Arc}; + +use async_trait::async_trait; + +use crate::schema::models::Action; + +#[async_trait] +pub trait RunnableBin { + async fn run(&self, victim_path: &PathBuf) -> eyre::Result<()>; +} + +pub type DynRunnableBin = Arc; + +#[async_trait] +pub trait Builder { + async fn build(&self, action_path: &PathBuf, action: &Action) -> eyre::Result; +} + +pub type DynBuilder = Arc; diff --git a/crates/octopush_core/src/executor/default_executor.rs b/crates/octopush_core/src/executor/default_executor.rs new file mode 100644 index 0000000..a0824ee --- /dev/null +++ b/crates/octopush_core/src/executor/default_executor.rs @@ -0,0 +1,48 @@ +use std::path::PathBuf; + +use async_trait::async_trait; + +use crate::{builder::DynBuilder, schema::models::Action}; + +use super::{ + executor::Executor, + executors::golang::{GolangExecutor, GolangExecutorOpts}, +}; + +pub struct DefaultExecutor { + builder: DynBuilder, +} + +impl DefaultExecutor { + pub fn new(builder: DynBuilder) -> Self { + Self { builder } + } +} + +#[async_trait] +impl Executor for DefaultExecutor { + async fn execute( + &self, + victim_path: &PathBuf, + action_path: &PathBuf, + action: &Action, + ) -> eyre::Result<()> { + tracing::trace!( + victim_path = victim_path.to_string_lossy().to_string(), + "execute" + ); + let bin = self.builder.build(action_path, action).await?; + match action { + Action::Go { .. } => { + GolangExecutor::new() + .execute(GolangExecutorOpts { + bin, + victim_path: victim_path.clone(), + }) + .await? + } + } + + Ok(()) + } +} diff --git a/crates/octopush_core/src/executor/executor.rs b/crates/octopush_core/src/executor/executor.rs new file mode 100644 index 0000000..ba36d64 --- /dev/null +++ b/crates/octopush_core/src/executor/executor.rs @@ -0,0 +1,17 @@ +use std::{path::PathBuf, sync::Arc}; + +use async_trait::async_trait; + +use crate::schema::models::Action; + +#[async_trait] +pub trait Executor { + async fn execute( + &self, + victim_path: &PathBuf, + action_path: &PathBuf, + action: &Action, + ) -> eyre::Result<()>; +} + +pub type DynExecutor = Arc; diff --git a/crates/octopush_core/src/executor/executors/golang.rs b/crates/octopush_core/src/executor/executors/golang.rs new file mode 100644 index 0000000..7cd4d3a --- /dev/null +++ b/crates/octopush_core/src/executor/executors/golang.rs @@ -0,0 +1,22 @@ +use std::path::PathBuf; + +use crate::builder::DynRunnableBin; + +pub struct GolangExecutorOpts { + pub bin: DynRunnableBin, + pub victim_path: PathBuf, +} + +pub struct GolangExecutor; + +impl GolangExecutor { + pub fn new() -> Self { + Self {} + } + + pub async fn execute(&self, opts: GolangExecutorOpts) -> eyre::Result<()> { + opts.bin.run(&opts.victim_path).await?; + + Ok(()) + } +} diff --git a/crates/octopush_core/src/executor/executors/mod.rs b/crates/octopush_core/src/executor/executors/mod.rs new file mode 100644 index 0000000..2da05a6 --- /dev/null +++ b/crates/octopush_core/src/executor/executors/mod.rs @@ -0,0 +1 @@ +pub mod golang; diff --git a/crates/octopush_core/src/executor/mod.rs b/crates/octopush_core/src/executor/mod.rs new file mode 100644 index 0000000..941cabe --- /dev/null +++ b/crates/octopush_core/src/executor/mod.rs @@ -0,0 +1,3 @@ +pub mod default_executor; +pub mod executor; +mod executors; diff --git a/crates/octopush_core/src/git/git.rs b/crates/octopush_core/src/git/git.rs new file mode 100644 index 0000000..8bab12d --- /dev/null +++ b/crates/octopush_core/src/git/git.rs @@ -0,0 +1,315 @@ +use std::{path::PathBuf, sync::Arc}; + +use eyre::ContextCompat; +use git2::{Cred, FetchOptions, PushOptions, RemoteCallbacks, Repository}; +use tokio::sync::Mutex; + +use crate::storage::DynStorageEngine; + +use super::GitProvider; + +#[derive(Clone, Debug)] +pub struct LocalGitProviderOptions { + pub http_auth: Option, +} + +pub struct LocalGitProvider { + storage_engine: DynStorageEngine, + options: LocalGitProviderOptions, +} + +impl LocalGitProvider { + pub fn new(options: LocalGitProviderOptions, storage_engine: DynStorageEngine) -> Self { + Self { + storage_engine, + options, + } + } + + fn fast_forward( + repo: &Repository, + lb: &mut git2::Reference, + rc: &git2::AnnotatedCommit, + ) -> Result<(), git2::Error> { + let name = match lb.name() { + Some(s) => s.to_string(), + None => String::from_utf8_lossy(lb.name_bytes()).to_string(), + }; + let msg = format!("Fast-Forward: Setting {} to id: {}", name, rc.id()); + println!("{}", msg); + lb.set_target(rc.id(), &msg)?; + repo.set_head(&name)?; + repo.checkout_head(Some( + git2::build::CheckoutBuilder::default() + // For some reason the force is required to make the working directory actually get updated + // I suspect we should be adding some logic to handle dirty working directory states + // but this is just an example so maybe not. + .force(), + ))?; + Ok(()) + } + + fn normal_merge( + repo: &Repository, + local: &git2::AnnotatedCommit, + remote: &git2::AnnotatedCommit, + ) -> Result<(), git2::Error> { + let local_tree = repo.find_commit(local.id())?.tree()?; + let remote_tree = repo.find_commit(remote.id())?.tree()?; + let ancestor = repo + .find_commit(repo.merge_base(local.id(), remote.id())?)? + .tree()?; + let mut idx = repo.merge_trees(&ancestor, &local_tree, &remote_tree, None)?; + + if idx.has_conflicts() { + println!("Merge conficts detected..."); + repo.checkout_index(Some(&mut idx), None)?; + return Ok(()); + } + let result_tree = repo.find_tree(idx.write_tree_to(repo)?)?; + // now create the merge commit + let msg = format!("Merge: {} into {}", remote.id(), local.id()); + let sig = repo.signature()?; + let local_commit = repo.find_commit(local.id())?; + let remote_commit = repo.find_commit(remote.id())?; + // Do our merge commit and set current branch head to that commit. + let _merge_commit = repo.commit( + Some("HEAD"), + &sig, + &sig, + &msg, + &result_tree, + &[&local_commit, &remote_commit], + )?; + // Set working tree to match head. + repo.checkout_head(None)?; + Ok(()) + } + + fn do_merge<'a>( + repo: &'a Repository, + remote_branch: &str, + fetch_commit: git2::AnnotatedCommit<'a>, + ) -> Result<(), git2::Error> { + // 1. do a merge analysis + let analysis = repo.merge_analysis(&[&fetch_commit])?; + + // 2. Do the appopriate merge + if analysis.0.is_fast_forward() { + println!("Doing a fast forward"); + // do a fast forward + let refname = format!("refs/heads/{}", remote_branch); + match repo.find_reference(&refname) { + Ok(mut r) => { + Self::fast_forward(repo, &mut r, &fetch_commit)?; + } + Err(_) => { + // The branch doesn't exist so just set the reference to the + // commit directly. Usually this is because you are pulling + // into an empty repository. + repo.reference( + &refname, + fetch_commit.id(), + true, + &format!("Setting {} to {}", remote_branch, fetch_commit.id()), + )?; + repo.set_head(&refname)?; + repo.checkout_head(Some( + git2::build::CheckoutBuilder::default() + .allow_conflicts(true) + .conflict_style_merge(true) + .force(), + ))?; + } + }; + } else if analysis.0.is_normal() { + // do a normal merge + let head_commit = repo.reference_to_annotated_commit(&repo.head()?)?; + Self::normal_merge(&repo, &head_commit, &fetch_commit)?; + } else { + println!("Nothing to do..."); + } + Ok(()) + } +} + +#[async_trait::async_trait] +impl GitProvider for LocalGitProvider { + async fn clone_from_url(&self, url: &String) -> eyre::Result<(PathBuf, Repository)> { + let url = url.clone(); + tracing::debug!(url, "allocating dir"); + let dir = self.storage_engine.allocate_dir().await?; + let options = self.options.clone(); + + let dirpath = dir.clone().path(); + let repo = tokio::task::spawn_blocking(move || { + let mut callbacks = RemoteCallbacks::new(); + callbacks.credentials(|url, username_from_url, _allowed_types| { + tracing::debug!(username_from_url, url, "pulling key from ssh-agent"); + + if let Some(auth) = &options.http_auth { + tracing::trace!(auth, "authenticating"); + let (user, pass) = auth + .split_once(":") + .ok_or("http_auth is not formatted correctly") + .unwrap(); + + Cred::userpass_plaintext(user, pass) + } else { + let username = username_from_url + .context("could not find username_from_url") + .unwrap(); + Cred::ssh_key_from_agent(username) + } + }); + + let mut fo = git2::FetchOptions::new(); + fo.remote_callbacks(callbacks); + + let checkout_builder = git2::build::CheckoutBuilder::new(); + + let mut builder = git2::build::RepoBuilder::new(); + builder.fetch_options(fo).with_checkout(checkout_builder); + + tracing::debug!( + path = dirpath.as_os_str().to_string_lossy().to_string(), + "clone git repo" + ); + builder.clone(url.as_str(), dirpath.as_path()) + }) + .await??; + + tracing::debug!("done pulling repo"); + + Ok((dir.path(), repo)) + } + + async fn create_branch( + &self, + repo: Arc>, + branch_name: &String, + ) -> eyre::Result<()> { + let repo = repo.lock().await; + let branch_name = branch_name.to_lowercase().replace(" ", "-"); + + let head_commit_oid = repo + .head()? + .target() + .ok_or(eyre::anyhow!("could not get access to target commit"))?; + let head_commit = repo.find_commit(head_commit_oid)?; + let newbranch = repo.branch(&branch_name, &head_commit, true)?; + + repo.set_head( + newbranch + .into_reference() + .name() + .ok_or(eyre::anyhow!("could not get name of reference"))?, + )?; + + tracing::trace!("pulling from origin"); + let options = self.options.clone(); + let remote = "origin"; + let mut cb = RemoteCallbacks::new(); + cb.credentials(|url, username_from_url, _allowed_types| { + tracing::debug!(username_from_url, url, "pulling key from ssh-agent"); + + if let Some(auth) = &options.http_auth { + tracing::trace!(auth, "authenticating"); + let (user, pass) = auth + .split_once(":") + .ok_or("http_auth is not formatted correctly") + .unwrap(); + + Cred::userpass_plaintext(user, pass) + } else { + let username = username_from_url.unwrap(); + Cred::ssh_key_from_agent(username) + } + }); + let mut remote = repo + .find_remote(remote) + .or_else(|_| repo.remote_anonymous(remote))?; + + let mut fo = FetchOptions::new(); + fo.remote_callbacks(cb); + let head = repo.head()?; + let refspec = &[head + .name() + .ok_or(eyre::anyhow!("could not find head.name"))?]; + + remote.fetch(refspec, Some(&mut fo), None)?; + + let fetch_head = repo.find_reference("FETCH_HEAD")?; + let commit = repo.reference_to_annotated_commit(&fetch_head)?; + Self::do_merge(&repo, &branch_name, commit)?; + + Ok(()) + } + + async fn push_branch( + &self, + repo: Arc>, + branch_name: &String, + ) -> eyre::Result<()> { + let repo = repo.lock().await; + let options = self.options.clone(); + + tracing::trace!("pulling signature from local git"); + let signature = repo.signature()?; + + tracing::trace!("fetching index and adding changed files to working tree"); + let mut index = repo.index()?; + index.add_all(&["."], git2::IndexAddOption::DEFAULT, None)?; + index.write()?; + let tree = index.write_tree()?; + let tree = repo.find_tree(tree)?; + + let parents = repo.head().map(|h| { + h.target() + .ok_or(eyre::anyhow!("could not fetch target")) + .map(|t| repo.find_commit(t)) + })???; + + tracing::trace!("writing commit object"); + repo.commit( + Some("HEAD"), + &signature, + &signature, + branch_name.to_lowercase().replace(" ", "-").as_str(), + &tree, + &[&parents], + )?; + + let mut remote = repo.find_remote("origin")?; + let head = repo.head()?; + let refspec = &[head + .name() + .ok_or(eyre::anyhow!("could not find head.name"))?]; + + let mut remote_callbacks = RemoteCallbacks::new(); + remote_callbacks.credentials(|url, username_from_url, _allowed_types| { + tracing::debug!(username_from_url, url, "pulling key from ssh-agent"); + + if let Some(auth) = &options.http_auth { + tracing::trace!(auth, "authenticating"); + let (user, pass) = auth + .split_once(":") + .ok_or("http_auth is not formatted correctly") + .unwrap(); + + Cred::userpass_plaintext(user, pass) + } else { + let username = username_from_url.unwrap(); + Cred::ssh_key_from_agent(username) + } + }); + + let mut push_options = PushOptions::new(); + push_options.remote_callbacks(remote_callbacks); + + tracing::trace!("pushing to remote"); + remote.push(refspec, Some(&mut push_options))?; + + Ok(()) + } +} diff --git a/crates/octopush_core/src/git/gitea/client.rs b/crates/octopush_core/src/git/gitea/client.rs new file mode 100644 index 0000000..9133614 --- /dev/null +++ b/crates/octopush_core/src/git/gitea/client.rs @@ -0,0 +1,76 @@ +use std::sync::Arc; + +use async_trait::async_trait; +use gitea_client::{builder::GiteaClientBuilder, models::CreatePullRequestOption}; + +use super::GiteaClient; + +pub struct DefaultGiteaClientOptions { + pub url: String, + pub basicauth: Option, +} + +pub struct DefaultGiteaClient { + gitea_client: Arc, +} + +impl DefaultGiteaClient { + pub fn new(options: &DefaultGiteaClientOptions) -> Self { + let mut gitea = GiteaClientBuilder::new().set_base_path(&options.url); + + if let Some(basicauth) = options.basicauth.clone() { + if let Some((username, password)) = basicauth.split_once(":") { + gitea = gitea.set_basic_auth(username.into(), Some(password.into())); + } + } + + Self { + gitea_client: Arc::new(gitea.build()), + } + } +} + +#[async_trait] +impl GiteaClient for DefaultGiteaClient { + async fn get_clone_url(&self, owner: String, repo_name: String) -> eyre::Result { + let repo = self + .gitea_client + .repository() + .get(&owner, &repo_name) + .await?; + + let clone_url = repo + .ssh_url + .ok_or(eyre::anyhow!("clone_url is not set for repository"))?; + + Ok(clone_url) + } + + async fn create_pull_request( + &self, + owner: &String, + repo_name: &String, + pull_request_name: &String, + ) -> eyre::Result<()> { + self.gitea_client + .repository() + .create_pull_request( + &owner, + &repo_name, + Some(CreatePullRequestOption { + assignee: None, + assignees: None, + base: Some("main".into()), + body: None, + due_date: None, + head: Some(pull_request_name.to_lowercase().replace(" ", "-")), + labels: None, + milestone: None, + title: Some(pull_request_name.clone()), + }), + ) + .await?; + + Ok(()) + } +} diff --git a/crates/octopush_core/src/git/gitea/mod.rs b/crates/octopush_core/src/git/gitea/mod.rs new file mode 100644 index 0000000..96abb1f --- /dev/null +++ b/crates/octopush_core/src/git/gitea/mod.rs @@ -0,0 +1,42 @@ +pub mod client; +pub mod provider; + +use std::{path::PathBuf, sync::Arc}; + +use async_trait::async_trait; +use git2::Repository; +use tokio::sync::Mutex; + +use crate::schema::models::GitPushPullRequest; + +#[async_trait] +pub trait GiteaClient { + async fn get_clone_url(&self, owner: String, repo_name: String) -> eyre::Result; + async fn create_pull_request( + &self, + owner: &String, + repo_name: &String, + pull_request_name: &String, + ) -> eyre::Result<()>; +} + +pub type DynGiteaClient = Arc; + +#[async_trait] +pub trait GiteaProvider { + async fn clone_from_qualified(&self, repo: &String) -> eyre::Result<(PathBuf, Repository)>; + async fn create_branch( + &self, + repo: Arc>, + branch: &GitPushPullRequest, + ) -> eyre::Result<()>; + + async fn create_pull_request( + &self, + repo: Arc>, + repo_name: &String, + pull_request: &GitPushPullRequest, + ) -> eyre::Result<()>; +} + +pub type DynGiteaProvider = Arc; diff --git a/crates/octopush_core/src/git/gitea/provider.rs b/crates/octopush_core/src/git/gitea/provider.rs new file mode 100644 index 0000000..323099b --- /dev/null +++ b/crates/octopush_core/src/git/gitea/provider.rs @@ -0,0 +1,79 @@ +use std::{path::PathBuf, sync::Arc}; + +use async_trait::async_trait; +use git2::Repository; +use tokio::sync::Mutex; + +use crate::{git::DynGitProvider, schema::models::GitPushPullRequest, storage::DynStorageEngine}; + +use super::{DynGiteaClient, GiteaProvider}; + +pub struct DefaultGiteaProvider { + git_provider: DynGitProvider, + _storage_engine: DynStorageEngine, + gitea_client: DynGiteaClient, +} + +impl DefaultGiteaProvider { + pub fn new( + git_provider: DynGitProvider, + storage_engine: DynStorageEngine, + gitea_client: DynGiteaClient, + ) -> Self { + Self { + git_provider, + _storage_engine: storage_engine, + gitea_client, + } + } +} + +#[async_trait] +impl GiteaProvider for DefaultGiteaProvider { + async fn clone_from_qualified(&self, repo: &String) -> eyre::Result<(PathBuf, Repository)> { + let (owner, repo_name) = repo + .split_once("/") + .ok_or(eyre::anyhow!("repo is not a valid format"))?; + + let clone_url = self + .gitea_client + .get_clone_url(owner.into(), repo_name.into()) + .await?; + + let (path, repo) = self.git_provider.clone_from_url(&clone_url).await?; + + Ok((path, repo)) + } + + async fn create_branch( + &self, + repo: Arc>, + pull_request: &GitPushPullRequest, + ) -> eyre::Result<()> { + tracing::trace!("creating branch"); + self.git_provider + .create_branch(repo, &pull_request.name) + .await + } + + async fn create_pull_request( + &self, + repo: Arc>, + repo_name: &String, + pull_request: &GitPushPullRequest, + ) -> eyre::Result<()> { + let (owner, repo_name) = repo_name + .split_once("/") + .ok_or(eyre::anyhow!("repo is not a valid format"))?; + + tracing::trace!("push_branch"); + self.git_provider + .push_branch(repo, &pull_request.name) + .await?; + + tracing::trace!("create_pull_request"); + self.gitea_client + .create_pull_request(&owner.into(), &repo_name.into(), &pull_request.name) + .await + } +} diff --git a/crates/octopush_core/src/git/mod.rs b/crates/octopush_core/src/git/mod.rs new file mode 100644 index 0000000..64f58e6 --- /dev/null +++ b/crates/octopush_core/src/git/mod.rs @@ -0,0 +1,25 @@ +use std::{path::PathBuf, sync::Arc}; + +use async_trait::async_trait; +use git2::Repository; +use tokio::sync::Mutex; + +pub mod git; +pub mod gitea; + +#[async_trait] +pub trait GitProvider { + async fn clone_from_url(&self, url: &String) -> eyre::Result<(PathBuf, Repository)>; + async fn create_branch( + &self, + repo: Arc>, + branch_name: &String, + ) -> eyre::Result<()>; + async fn push_branch( + &self, + repo: Arc>, + branch_name: &String, + ) -> eyre::Result<()>; +} + +pub type DynGitProvider = Arc; diff --git a/crates/octopush_core/src/lib.rs b/crates/octopush_core/src/lib.rs new file mode 100644 index 0000000..07c1e0c --- /dev/null +++ b/crates/octopush_core/src/lib.rs @@ -0,0 +1,7 @@ +pub mod builder; +pub mod executor; +pub mod git; +pub mod schema; +pub mod selectors; +mod shell; +pub mod storage; diff --git a/crates/octopush_core/src/schema/mod.rs b/crates/octopush_core/src/schema/mod.rs new file mode 100644 index 0000000..3031dbb --- /dev/null +++ b/crates/octopush_core/src/schema/mod.rs @@ -0,0 +1,2 @@ +pub mod models; +pub mod parser; diff --git a/crates/octopush_core/src/schema/models.rs b/crates/octopush_core/src/schema/models.rs new file mode 100644 index 0000000..2640a60 --- /dev/null +++ b/crates/octopush_core/src/schema/models.rs @@ -0,0 +1,73 @@ +use serde::{Deserialize, Serialize}; + +pub type Repository = String; + +#[derive(Debug, PartialEq, Serialize, Deserialize, Clone)] +pub struct GitPushBranch { + pub name: String, +} + +#[derive(Debug, PartialEq, Serialize, Deserialize, Clone)] +pub struct GitPushPullRequest { + pub name: String, +} + +#[derive(Debug, PartialEq, Serialize, Deserialize, Clone)] +pub struct GitPush { + pub branch: GitPushBranch, +} + +#[derive(Debug, PartialEq, Serialize, Deserialize, Clone)] +pub struct Git { + pub push: Option, + pub repositories: Vec, +} + +#[derive(Debug, PartialEq, Serialize, Deserialize, Clone)] +pub struct GitHubPush { + #[serde(rename = "pull-request")] + pub pull_request: GitPushPullRequest, +} + +#[derive(Debug, PartialEq, Serialize, Deserialize, Clone)] +pub struct GiteaPush { + #[serde(rename = "pull-request")] + pub pull_request: GitPushPullRequest, +} + +#[derive(Debug, PartialEq, Serialize, Deserialize, Clone)] +pub struct GitHub { + pub push: Option, + pub repositories: Vec, +} + +#[derive(Debug, PartialEq, Serialize, Deserialize, Clone)] +pub struct Gitea { + pub push: Option, + pub repositories: Vec, +} + +#[derive(Debug, PartialEq, Serialize, Deserialize, Clone)] +pub struct SelectAction { + pub git: Option, + pub github: Option, + pub gitea: Option, +} + +#[derive(Debug, PartialEq, Serialize, Deserialize, Clone)] +#[serde(tag = "type")] +pub enum Action { + #[serde(rename = "go")] + Go { entry: String }, +} + +#[derive(Debug, Serialize, Deserialize, Clone, PartialEq)] +#[serde(tag = "apiVersion")] +pub enum Schema { + #[serde(rename = "action")] + Action { + name: String, + select: SelectAction, + action: Action, + }, +} diff --git a/crates/octopush_core/src/schema/parser.rs b/crates/octopush_core/src/schema/parser.rs new file mode 100644 index 0000000..7737a32 --- /dev/null +++ b/crates/octopush_core/src/schema/parser.rs @@ -0,0 +1,36 @@ +use std::{path::PathBuf, sync::Arc}; + +use async_trait::async_trait; + +use super::models::Schema; + +#[async_trait] +pub trait SchemaParser { + async fn parse_file(&self, file: PathBuf) -> eyre::Result; +} + +pub type DynSchemaParser = Arc; + +#[derive(Debug)] +pub struct DefaultSchemaParser {} + +#[async_trait] +impl SchemaParser for DefaultSchemaParser { + async fn parse_file(&self, file: PathBuf) -> eyre::Result { + let file = tokio::fs::read(file).await?; + + self.parse(file) + } +} + +impl DefaultSchemaParser { + pub fn new() -> Self { + Self {} + } + + pub fn parse(&self, contents: Vec) -> eyre::Result { + let schema = serde_yaml::from_slice(contents.as_slice())?; + + Ok(schema) + } +} diff --git a/crates/octopush_core/src/selectors/git_selector.rs b/crates/octopush_core/src/selectors/git_selector.rs new file mode 100644 index 0000000..303ac57 --- /dev/null +++ b/crates/octopush_core/src/selectors/git_selector.rs @@ -0,0 +1,48 @@ +use std::{path::PathBuf, sync::Arc}; + +use tokio::sync::Mutex; + +use crate::{ + executor::executor::DynExecutor, + git::DynGitProvider, + schema::models::{Action, Git}, +}; + +pub struct GitSelector { + git_provider: DynGitProvider, + executor: DynExecutor, +} + +impl GitSelector { + pub fn new(git_provider: DynGitProvider, executor: DynExecutor) -> Self { + Self { + git_provider, + executor, + } + } + + pub async fn run(&self, git: &Git, action_path: &PathBuf, action: &Action) -> eyre::Result<()> { + tracing::info!("fetching repos"); + for repo in &git.repositories { + let gp = self.git_provider.clone(); + let (path, repo) = gp.clone_from_url(repo).await?; + let repo = Arc::new(Mutex::new(repo)); + + if let Some(push) = &git.push { + self.git_provider + .create_branch(repo.clone(), &push.branch.name) + .await?; + } + + self.executor.execute(&path, action_path, action).await?; + + if let Some(push) = &git.push { + self.git_provider + .push_branch(repo, &push.branch.name) + .await?; + } + } + + Ok(()) + } +} diff --git a/crates/octopush_core/src/selectors/gitea_selector.rs b/crates/octopush_core/src/selectors/gitea_selector.rs new file mode 100644 index 0000000..4b80b97 --- /dev/null +++ b/crates/octopush_core/src/selectors/gitea_selector.rs @@ -0,0 +1,59 @@ +use std::{path::PathBuf, sync::Arc}; + +use tokio::sync::Mutex; + +use crate::{ + executor::executor::DynExecutor, + git::{gitea::DynGiteaProvider, DynGitProvider}, + schema::models::{Action, Gitea}, +}; + +pub struct GiteaSelector { + gitea_provider: DynGiteaProvider, + git_provider: DynGitProvider, + executor: DynExecutor, +} + +impl GiteaSelector { + pub fn new( + gitea_provider: DynGiteaProvider, + git_provider: DynGitProvider, + executor: DynExecutor, + ) -> Self { + Self { + gitea_provider, + git_provider, + executor, + } + } + + pub async fn run( + &self, + git: &Gitea, + action_path: &PathBuf, + action: &Action, + ) -> eyre::Result<()> { + tracing::info!("fetching repos"); + for repo in &git.repositories { + let gp = self.gitea_provider.clone(); + let (path, repo) = gp.clone_from_qualified(repo).await?; + let repo = Arc::new(Mutex::new(repo)); + + if let Some(push) = &git.push { + self.git_provider + .create_branch(repo.clone(), &push.pull_request.name) + .await?; + } + + self.executor.execute(&path, action_path, action).await?; + + if let Some(push) = &git.push { + self.git_provider + .push_branch(repo, &push.pull_request.name) + .await?; + } + } + + Ok(()) + } +} diff --git a/crates/octopush_core/src/selectors/mod.rs b/crates/octopush_core/src/selectors/mod.rs new file mode 100644 index 0000000..c31befe --- /dev/null +++ b/crates/octopush_core/src/selectors/mod.rs @@ -0,0 +1,3 @@ +pub mod git_selector; +pub mod gitea_selector; + diff --git a/crates/octopush_core/src/shell/mod.rs b/crates/octopush_core/src/shell/mod.rs new file mode 100644 index 0000000..ea5d588 --- /dev/null +++ b/crates/octopush_core/src/shell/mod.rs @@ -0,0 +1,50 @@ +use std::{path::PathBuf, process::Stdio}; + +use eyre::Context; +use tokio::io::{AsyncBufReadExt, BufReader}; + +pub async fn execute_shell(cmd: String, path: Option) -> eyre::Result<()> { + let mut command = tokio::process::Command::new("sh"); + let command = command.arg("-c"); + + let command = if let Some(path) = path { + command.current_dir(path) + } else { + command + }; + + let command = command.arg(format!("{}", cmd)); + + let command = command.stdout(Stdio::piped()); + + let mut child = command.spawn()?; + + let stdout = child + .stdout + .take() + .ok_or(eyre::anyhow!("could not take stdout of command"))?; + + let mut reader = BufReader::new(stdout).lines(); + + tokio::spawn(async move { + let status = child + .wait() + .await + .context(eyre::anyhow!("child process encountered an error")) + .unwrap(); + + if !status.success() { + tracing::error!( + cmd, + status = status.to_string(), + "child program encountered an error" + ); + } + }); + + while let Some(line) = reader.next_line().await? { + tracing::trace!("{}", line) + } + + Ok(()) +} diff --git a/crates/octopush_core/src/storage/local.rs b/crates/octopush_core/src/storage/local.rs new file mode 100644 index 0000000..acdc4fd --- /dev/null +++ b/crates/octopush_core/src/storage/local.rs @@ -0,0 +1,54 @@ +use std::path::PathBuf; + +use rand::distributions::{DistString, Standard}; + +use super::StorageEngine; + +pub struct LocalStorageEngine { + root: PathBuf, +} + +impl LocalStorageEngine { + pub fn new(root: PathBuf) -> Self { + Self { root } + } +} + +#[async_trait::async_trait] +impl StorageEngine for LocalStorageEngine { + async fn allocate_dir(&self) -> eyre::Result { + let subdir_name = Standard.sample_string(&mut rand::thread_rng(), 2); + let mut path = self.root.clone(); + path.push("tmp"); + path.push(hex::encode(subdir_name)); + + Ok(super::TemporaryDir::new(path)) + } + + async fn cleanup(&self) -> eyre::Result<()> { + let mut path = self.root.clone(); + path.push("tmp"); + tokio::fs::remove_dir_all(path).await?; + + Ok(()) + } +} + +#[cfg(test)] +mod tests { + use std::path::PathBuf; + + use crate::storage::StorageEngine; + + use super::LocalStorageEngine; + + #[tokio::test] + async fn create_local_storage_engine_and_allocate() { + let local_storage = LocalStorageEngine::new(PathBuf::new()); + + let dir = local_storage.allocate_dir().await.expect("to allocate dir"); + + assert_eq!(dir.path().to_string_lossy().len(), 16); + assert_eq!(dir.path().to_string_lossy().is_empty(), false); + } +} diff --git a/crates/octopush_core/src/storage/mod.rs b/crates/octopush_core/src/storage/mod.rs new file mode 100644 index 0000000..38bb200 --- /dev/null +++ b/crates/octopush_core/src/storage/mod.rs @@ -0,0 +1,32 @@ +pub mod local; + +use std::{path::PathBuf, sync::Arc}; + +use async_trait::async_trait; + +#[async_trait] +pub trait StorageEngine { + async fn allocate_dir(&self) -> eyre::Result; + async fn cleanup(&self) -> eyre::Result<()>; +} + +pub type DynStorageEngine = Arc; + +#[derive(Clone, Debug)] +pub struct TemporaryDir { + path: PathBuf, +} + +impl TemporaryDir { + pub fn new(path: PathBuf) -> Self { + Self { path } + } + + pub fn path(&self) -> PathBuf { + self.path.clone() + } + + pub fn cleanup(self) -> eyre::Result<()> { + Ok(()) + } +} diff --git a/crates/octopush_infra/Cargo.toml b/crates/octopush_infra/Cargo.toml new file mode 100644 index 0000000..471daf0 --- /dev/null +++ b/crates/octopush_infra/Cargo.toml @@ -0,0 +1,12 @@ +[package] +name = "octopush_infra" +version = "0.1.0" +edition = "2021" + +# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html + +[dependencies] +octopush_core = { path = "../octopush_core" } + +eyre = { workspace = true } +tracing = { workspace = true } diff --git a/crates/octopush_infra/src/lib.rs b/crates/octopush_infra/src/lib.rs new file mode 100644 index 0000000..8107689 --- /dev/null +++ b/crates/octopush_infra/src/lib.rs @@ -0,0 +1 @@ +pub mod service_register; diff --git a/crates/octopush_infra/src/service_register.rs b/crates/octopush_infra/src/service_register.rs new file mode 100644 index 0000000..7b0301a --- /dev/null +++ b/crates/octopush_infra/src/service_register.rs @@ -0,0 +1,72 @@ +use std::sync::Arc; + +use octopush_core::{ + builder::{builder_capabilities::BuilderCapabilities, DynBuilder}, + executor::{default_executor::DefaultExecutor, executor::DynExecutor}, + git::{ + git::{LocalGitProvider, LocalGitProviderOptions}, + gitea::{ + client::{DefaultGiteaClient, DefaultGiteaClientOptions}, + provider::DefaultGiteaProvider, + DynGiteaProvider, + }, + DynGitProvider, + }, + schema::parser::{DefaultSchemaParser, DynSchemaParser}, + selectors::{git_selector::GitSelector, gitea_selector::GiteaSelector}, + storage::{local::LocalStorageEngine, DynStorageEngine}, +}; + +pub struct ServiceRegister { + pub storage_engine: DynStorageEngine, + pub git_provider: DynGitProvider, + pub schema_parser: DynSchemaParser, + pub builder: DynBuilder, + pub executor: DynExecutor, + pub gitea_provider: DynGiteaProvider, + pub git_selector: Arc, + pub gitea_selector: Arc, +} + +impl ServiceRegister { + pub fn new( + git_provider_options: LocalGitProviderOptions, + gitea_client_options: DefaultGiteaClientOptions, + ) -> Self { + let storage_engine = Arc::new(LocalStorageEngine::new("/tmp/octopush".into())); + let git_provider = Arc::new(LocalGitProvider::new( + git_provider_options, + storage_engine.clone(), + )); + let schema_parser = Arc::new(DefaultSchemaParser::new()); + let builder = Arc::new(BuilderCapabilities::new()); + let executor = Arc::new(DefaultExecutor::new(builder.clone())); + let gitea_client = Arc::new(DefaultGiteaClient::new(&gitea_client_options)); + let gitea_provider = Arc::new(DefaultGiteaProvider::new( + git_provider.clone(), + storage_engine.clone(), + gitea_client.clone(), + )); + let git_selector = Arc::new(GitSelector::new(git_provider.clone(), executor.clone())); + let gitea_selector = Arc::new(GiteaSelector::new( + gitea_provider.clone(), + git_provider.clone(), + executor.clone(), + )); + + Self { + storage_engine, + git_provider, + schema_parser, + builder, + executor, + gitea_provider, + git_selector, + gitea_selector, + } + } + + pub async fn cleanup(self) -> eyre::Result<()> { + self.storage_engine.cleanup().await + } +} diff --git a/cuddle.yaml b/cuddle.yaml index 0bd3198..22191a0 100644 --- a/cuddle.yaml +++ b/cuddle.yaml @@ -1,6 +1,6 @@ # yaml-language-server: $schema=https://git.front.kjuulh.io/kjuulh/cuddle/raw/branch/main/schemas/base.json -base: "git@git.front.kjuulh.io:kjuulh/cuddle-go-plan.git" +base: "git@git.front.kjuulh.io:kjuulh/cuddle-rust-plan.git" vars: service: "octopush" @@ -9,9 +9,5 @@ vars: scripts: push_github: type: shell - run_server: - type: shell - run_client: - type: shell run: type: shell diff --git a/example/testkey.private.pgp b/example/testkey.private.pgp deleted file mode 100644 index b31f2d7..0000000 --- a/example/testkey.private.pgp +++ /dev/null @@ -1,17 +0,0 @@ ------BEGIN PGP PRIVATE KEY BLOCK----- - -lIYEYx8kxRYJKwYBBAHaRw8BAQdAwlYhGGWpLSSxZoHUmzvl6iJeZgtfKu/8/cjt -LLQ8Swf+BwMCGPF3fdZbweT7+Y/bMMnelXmhYsTgEk30h+FeXOnGy/ZvJgnqoBed -eRPRO5VDN4xq30D8zp04em8tgPXXS50yXvf7PUIKcx4u0IDteTC/Q7QjS3Jha2Vu -IDxrcmFrZW5Aa2FzcGVyaGVybWFuc2VuLmNvbT6IkwQTFgoAOxYhBKh3AMKI2yc/ -qX90YXHawJCw+EZkBQJjHyTFAhsDBQsJCAcCAiICBhUKCQgLAgQWAgMBAh4HAheA -AAoJEHHawJCw+EZkJMQA/AgeMkam18RasuPcl9kiiFkE2EA2TvO25IieZesbCEf5 -APwLjuXkMNYrPSAGPk0VZY7Eq8hWQd3qh9GHV9vDEUvND5yLBGMfJMUSCisGAQQB -l1UBBQEBB0D4pGbjQW+s2aYO3DZX7M0yyq4JkZ+Wana3v2BuAXXYEwMBCAf+BwMC -7hV7XuPdNrP7q1BylZe5GKz0TP0LSRbVjPgnetTyDqOaWEtdRzc996rBR0WcvUJO -xN7oRR8XNMp1v6Up2LcvUs6XDpJ4f1MBGh3npytF7oh4BBgWCgAgFiEEqHcAwojb -Jz+pf3RhcdrAkLD4RmQFAmMfJMUCGwwACgkQcdrAkLD4RmTvQgEAqGhqQuiZQskW -Zbr27HBpQIukcIOVFle+wNXNyhKTJlkBAKoM/wTrQNIyS2gnGPQ1IE/AtDhMvwsV -hCIzhb/ybLMH -=9Nw9 ------END PGP PRIVATE KEY BLOCK----- diff --git a/go.mod b/go.mod deleted file mode 100644 index 25bc5ba..0000000 --- a/go.mod +++ /dev/null @@ -1,61 +0,0 @@ -module git.front.kjuulh.io/kjuulh/octopush - -go 1.19 - -require ( - code.gitea.io/sdk/gitea v0.15.1 - git.front.kjuulh.io/kjuulh/curre v1.3.5 - github.com/ProtonMail/go-crypto v0.0.0-20221026131551-cf6655e29de4 - github.com/gin-contrib/zap v0.1.0 - github.com/gin-gonic/gin v1.8.1 - github.com/go-git/go-git/v5 v5.4.2 - github.com/google/uuid v1.3.0 - github.com/spf13/cobra v1.6.1 - github.com/stretchr/testify v1.8.1 - github.com/whilp/git-urls v1.0.0 - go.uber.org/zap v1.23.0 - golang.org/x/net v0.2.0 - gopkg.in/yaml.v3 v3.0.1 -) - -require ( - github.com/Microsoft/go-winio v0.5.2 // indirect - github.com/acomagu/bufpipe v1.0.3 // indirect - github.com/cloudflare/circl v1.1.0 // indirect - github.com/davecgh/go-spew v1.1.1 // indirect - github.com/emirpasic/gods v1.18.1 // indirect - github.com/gin-contrib/sse v0.1.0 // indirect - github.com/go-git/gcfg v1.5.0 // indirect - github.com/go-git/go-billy/v5 v5.3.1 // indirect - github.com/go-playground/locales v0.14.0 // indirect - github.com/go-playground/universal-translator v0.18.0 // indirect - github.com/go-playground/validator/v10 v10.10.0 // indirect - github.com/goccy/go-json v0.9.7 // indirect - github.com/hashicorp/go-version v1.2.1 // indirect - github.com/imdario/mergo v0.3.12 // indirect - github.com/inconshreveable/mousetrap v1.0.1 // indirect - github.com/jbenet/go-context v0.0.0-20150711004518-d14ea06fba99 // indirect - github.com/json-iterator/go v1.1.12 // indirect - github.com/kevinburke/ssh_config v1.2.0 // indirect - github.com/leodido/go-urn v1.2.1 // indirect - github.com/mattn/go-isatty v0.0.14 // indirect - github.com/mitchellh/go-homedir v1.1.0 // indirect - github.com/modern-go/concurrent v0.0.0-20180228061459-e0a39a4cb421 // indirect - github.com/modern-go/reflect2 v1.0.2 // indirect - github.com/pelletier/go-toml/v2 v2.0.1 // indirect - github.com/pmezard/go-difflib v1.0.0 // indirect - github.com/sergi/go-diff v1.2.0 // indirect - github.com/spf13/pflag v1.0.5 // indirect - github.com/ugorji/go/codec v1.2.7 // indirect - github.com/xanzy/ssh-agent v0.3.2 // indirect - go.opentelemetry.io/otel v1.10.0 // indirect - go.opentelemetry.io/otel/trace v1.10.0 // indirect - go.uber.org/atomic v1.10.0 // indirect - go.uber.org/multierr v1.8.0 // indirect - golang.org/x/crypto v0.0.0-20220829220503-c86fa9a7ed90 // indirect - golang.org/x/sys v0.2.0 // indirect - golang.org/x/text v0.4.0 // indirect - google.golang.org/protobuf v1.28.0 // indirect - gopkg.in/warnings.v0 v0.1.2 // indirect - gopkg.in/yaml.v2 v2.4.0 // indirect -) diff --git a/go.sum b/go.sum deleted file mode 100644 index 74463fc..0000000 --- a/go.sum +++ /dev/null @@ -1,285 +0,0 @@ -code.gitea.io/gitea-vet v0.2.1/go.mod h1:zcNbT/aJEmivCAhfmkHOlT645KNOf9W2KnkLgFjGGfE= -code.gitea.io/sdk/gitea v0.15.1 h1:WJreC7YYuxbn0UDaPuWIe/mtiNKTvLN8MLkaw71yx/M= -code.gitea.io/sdk/gitea v0.15.1/go.mod h1:klY2LVI3s3NChzIk/MzMn7G1FHrfU7qd63iSMVoHRBA= -git.front.kjuulh.io/kjuulh/curre v1.3.5 h1:oKYh5Z0vInjViLnS4ppzK0G2Mnj7vXq8mA5i/rsWId4= -git.front.kjuulh.io/kjuulh/curre v1.3.5/go.mod h1:m7WpSehONLqPh/XF3F0BI0UOpLOfGuDmDEFI1XsM6fE= -github.com/Microsoft/go-winio v0.4.14/go.mod h1:qXqCSQ3Xa7+6tgxaGTIe4Kpcdsi+P8jBhyzoq1bpyYA= -github.com/Microsoft/go-winio v0.4.16/go.mod h1:XB6nPKklQyQ7GC9LdcBEcBl8PF76WugXOPRXwdLnMv0= -github.com/Microsoft/go-winio v0.5.2 h1:a9IhgEQBCUEk6QCdml9CiJGhAws+YwffDHEMp1VMrpA= -github.com/Microsoft/go-winio v0.5.2/go.mod h1:WpS1mjBmmwHBEWmogvA2mj8546UReBk4v8QkMxJ6pZY= -github.com/ProtonMail/go-crypto v0.0.0-20210428141323-04723f9f07d7/go.mod h1:z4/9nQmJSSwwds7ejkxaJwO37dru3geImFUdJlaLzQo= -github.com/ProtonMail/go-crypto v0.0.0-20220822140716-1678d6eb0cbe h1:R2HeCk7SG/XpoYZlEeI1v7sId7w2AMWwzOaVqXn45FE= -github.com/ProtonMail/go-crypto v0.0.0-20220822140716-1678d6eb0cbe/go.mod h1:UBYPn8k0D56RtnR8RFQMjmh4KrZzWJ5o7Z9SYjossQ8= -github.com/ProtonMail/go-crypto v0.0.0-20221026131551-cf6655e29de4 h1:ra2OtmuW0AE5csawV4YXMNGNQQXvLRps3z2Z59OPO+I= -github.com/ProtonMail/go-crypto v0.0.0-20221026131551-cf6655e29de4/go.mod h1:UBYPn8k0D56RtnR8RFQMjmh4KrZzWJ5o7Z9SYjossQ8= -github.com/acomagu/bufpipe v1.0.3 h1:fxAGrHZTgQ9w5QqVItgzwj235/uYZYgbXitB+dLupOk= -github.com/acomagu/bufpipe v1.0.3/go.mod h1:mxdxdup/WdsKVreO5GpW4+M/1CE2sMG4jeGJ2sYmHc4= -github.com/anmitsu/go-shlex v0.0.0-20161002113705-648efa622239 h1:kFOfPq6dUM1hTo4JG6LR5AXSUEsOjtdm0kw0FtQtMJA= -github.com/anmitsu/go-shlex v0.0.0-20161002113705-648efa622239/go.mod h1:2FmKhYUyUczH0OGQWaF5ceTx0UBShxjsH6f8oGKYe2c= -github.com/armon/go-socks5 v0.0.0-20160902184237-e75332964ef5 h1:0CwZNZbxp69SHPdPJAN/hZIm0C4OItdklCFmMRWYpio= -github.com/armon/go-socks5 v0.0.0-20160902184237-e75332964ef5/go.mod h1:wHh0iHkYZB8zMSxRWpUBQtwG5a7fFgvEO+odwuTv2gs= -github.com/benbjohnson/clock v1.1.0 h1:Q92kusRqC1XV2MjkWETPvjJVqKetz1OzxZB7mHJLju8= -github.com/benbjohnson/clock v1.1.0/go.mod h1:J11/hYXuz8f4ySSvYwY0FKfm+ezbsZBKZxNJlLklBHA= -github.com/bwesterb/go-ristretto v1.2.0/go.mod h1:fUIoIZaG73pV5biE2Blr2xEzDoMj7NFEuV9ekS419A0= -github.com/cloudflare/circl v1.1.0 h1:bZgT/A+cikZnKIwn7xL2OBj012Bmvho/o6RpRvv3GKY= -github.com/cloudflare/circl v1.1.0/go.mod h1:prBCrKB9DV4poKZY1l9zBXg2QJY7mvgRvtMxxK7fi4I= -github.com/cpuguy83/go-md2man/v2 v2.0.2/go.mod h1:tgQtvFlXSQOSOSIRvRPT7W67SCa46tRHOmNcaadrF8o= -github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E= -github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= -github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= -github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= -github.com/emirpasic/gods v1.12.0/go.mod h1:YfzfFFoVP/catgzJb4IKIqXjX78Ha8FMSDh3ymbK86o= -github.com/emirpasic/gods v1.18.1 h1:FXtiHYKDGKCW2KzwZKx0iC0PQmdlorYgdFG9jPXJ1Bc= -github.com/emirpasic/gods v1.18.1/go.mod h1:8tpGGwCnJ5H4r6BWwaV6OrWmMoPhUl5jm/FMNAnJvWQ= -github.com/flynn/go-shlex v0.0.0-20150515145356-3f9db97f8568/go.mod h1:xEzjJPgXI435gkrCt3MPfRiAkVrwSbHsst4LCFVfpJc= -github.com/gin-contrib/sse v0.1.0 h1:Y/yl/+YNO8GZSjAhjMsSuLt29uWRFHdHYUb5lYOV9qE= -github.com/gin-contrib/sse v0.1.0/go.mod h1:RHrZQHXnP2xjPF+u1gW/2HnVO7nvIa9PG3Gm+fLHvGI= -github.com/gin-contrib/zap v0.0.2 h1:VnIucI+kUsxgzmcrX0gMk19a2I12KirTxi+ufuT2xZk= -github.com/gin-contrib/zap v0.0.2/go.mod h1:2vZj8gTuOYOfottCirxZr9gNM/Q1yk2iSVn15SUVG5A= -github.com/gin-contrib/zap v0.1.0 h1:RMSFFJo34XZogV62OgOzvrlaMNmXrNxmJ3bFmMwl6Cc= -github.com/gin-contrib/zap v0.1.0/go.mod h1:hvnZaPs478H1PGvRP8w89ZZbyJUiyip4ddiI/53WG3o= -github.com/gin-gonic/gin v1.7.7/go.mod h1:axIBovoeJpVj8S3BwE0uPMTeReE4+AfFtqpqaZ1qq1U= -github.com/gin-gonic/gin v1.8.1 h1:4+fr/el88TOO3ewCmQr8cx/CtZ/umlIRIs5M4NTNjf8= -github.com/gin-gonic/gin v1.8.1/go.mod h1:ji8BvRH1azfM+SYow9zQ6SZMvR8qOMZHmsCuWR9tTTk= -github.com/gliderlabs/ssh v0.2.2 h1:6zsha5zo/TWhRhwqCD3+EarCAgZ2yN28ipRnGPnwkI0= -github.com/gliderlabs/ssh v0.2.2/go.mod h1:U7qILu1NlMHj9FlMhZLlkCdDnU1DBEAqr0aevW3Awn0= -github.com/go-git/gcfg v1.5.0 h1:Q5ViNfGF8zFgyJWPqYwA7qGFoMTEiBmdlkcfRmpIMa4= -github.com/go-git/gcfg v1.5.0/go.mod h1:5m20vg6GwYabIxaOonVkTdrILxQMpEShl1xiMF4ua+E= -github.com/go-git/go-billy/v5 v5.2.0/go.mod h1:pmpqyWchKfYfrkb/UVH4otLvyi/5gJlGI4Hb3ZqZ3W0= -github.com/go-git/go-billy/v5 v5.3.1 h1:CPiOUAzKtMRvolEKw+bG1PLRpT7D3LIs3/3ey4Aiu34= -github.com/go-git/go-billy/v5 v5.3.1/go.mod h1:pmpqyWchKfYfrkb/UVH4otLvyi/5gJlGI4Hb3ZqZ3W0= -github.com/go-git/go-git-fixtures/v4 v4.2.1 h1:n9gGL1Ct/yIw+nfsfr8s4+sbhT+Ncu2SubfXjIWgci8= -github.com/go-git/go-git-fixtures/v4 v4.2.1/go.mod h1:K8zd3kDUAykwTdDCr+I0per6Y6vMiRR/nnVTBtavnB0= -github.com/go-git/go-git/v5 v5.4.2 h1:BXyZu9t0VkbiHtqrsvdq39UDhGJTl1h55VW6CSC4aY4= -github.com/go-git/go-git/v5 v5.4.2/go.mod h1:gQ1kArt6d+n+BGd+/B/I74HwRTLhth2+zti4ihgckDc= -github.com/go-logr/logr v1.2.2/go.mod h1:jdQByPbusPIv2/zmleS9BjJVeZ6kBagPoEUsqbVz/1A= -github.com/go-logr/logr v1.2.3/go.mod h1:jdQByPbusPIv2/zmleS9BjJVeZ6kBagPoEUsqbVz/1A= -github.com/go-logr/stdr v1.2.2/go.mod h1:mMo/vtBO5dYbehREoey6XUKy/eSumjCCveDpRre4VKE= -github.com/go-playground/assert/v2 v2.0.1 h1:MsBgLAaY856+nPRTKrp3/OZK38U/wa0CcBYNjji3q3A= -github.com/go-playground/assert/v2 v2.0.1/go.mod h1:VDjEfimB/XKnb+ZQfWdccd7VUvScMdVu0Titje2rxJ4= -github.com/go-playground/locales v0.13.0/go.mod h1:taPMhCMXrRLJO55olJkUXHZBHCxTMfnGwq/HNwmWNS8= -github.com/go-playground/locales v0.14.0 h1:u50s323jtVGugKlcYeyzC0etD1HifMjqmJqb8WugfUU= -github.com/go-playground/locales v0.14.0/go.mod h1:sawfccIbzZTqEDETgFXqTho0QybSa7l++s0DH+LDiLs= -github.com/go-playground/universal-translator v0.17.0/go.mod h1:UkSxE5sNxxRwHyU+Scu5vgOQjsIJAF8j9muTVoKLVtA= -github.com/go-playground/universal-translator v0.18.0 h1:82dyy6p4OuJq4/CByFNOn/jYrnRPArHwAcmLoJZxyho= -github.com/go-playground/universal-translator v0.18.0/go.mod h1:UvRDBj+xPUEGrFYl+lu/H90nyDXpg0fqeB/AQUGNTVA= -github.com/go-playground/validator/v10 v10.4.1/go.mod h1:nlOn6nFhuKACm19sB/8EGNn9GlaMV7XkbRSipzJ0Ii4= -github.com/go-playground/validator/v10 v10.10.0 h1:I7mrTYv78z8k8VXa/qJlOlEXn/nBh+BF8dHX5nt/dr0= -github.com/go-playground/validator/v10 v10.10.0/go.mod h1:74x4gJWsvQexRdW8Pn3dXSGrTK4nAUsbPlLADvpJkos= -github.com/goccy/go-json v0.9.7 h1:IcB+Aqpx/iMHu5Yooh7jEzJk1JZ7Pjtmys2ukPr7EeM= -github.com/goccy/go-json v0.9.7/go.mod h1:6MelG93GURQebXPDq3khkgXZkazVtN9CRI+MGFi0w8I= -github.com/golang/protobuf v1.3.3/go.mod h1:vzj43D7+SQXF/4pzW/hwtAqwc6iTitCiVSaWz5lYuqw= -github.com/golang/protobuf v1.5.0/go.mod h1:FsONVRAS9T7sI+LIUmWTfcYkHO4aIWwzhcaSAoJOfIk= -github.com/google/go-cmp v0.3.0/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= -github.com/google/go-cmp v0.5.5 h1:Khx7svrCpmxxtHBq5j2mp/xVjsi8hQMfNLvJFAlrGgU= -github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= -github.com/google/go-cmp v0.5.8/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= -github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= -github.com/google/uuid v1.3.0 h1:t6JiXgmwXMjEs8VusXIJk2BXHsn+wx8BZdTaoZ5fu7I= -github.com/google/uuid v1.3.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= -github.com/hashicorp/go-version v1.2.1 h1:zEfKbn2+PDgroKdiOzqiE8rsmLqU2uwi5PB5pBJ3TkI= -github.com/hashicorp/go-version v1.2.1/go.mod h1:fltr4n8CU8Ke44wwGCBoEymUuxUHl09ZGVZPK5anwXA= -github.com/imdario/mergo v0.3.12 h1:b6R2BslTbIEToALKP7LxUvijTsNI9TAe80pLWN2g/HU= -github.com/imdario/mergo v0.3.12/go.mod h1:jmQim1M+e3UYxmgPu/WyfjB3N3VflVyUjjjwH0dnCYA= -github.com/inconshreveable/mousetrap v1.0.0 h1:Z8tu5sraLXCXIcARxBp/8cbvlwVa7Z1NHg9XEKhtSvM= -github.com/inconshreveable/mousetrap v1.0.0/go.mod h1:PxqpIevigyE2G7u3NXJIT2ANytuPF1OarO4DADm73n8= -github.com/inconshreveable/mousetrap v1.0.1 h1:U3uMjPSQEBMNp1lFxmllqCPM6P5u/Xq7Pgzkat/bFNc= -github.com/inconshreveable/mousetrap v1.0.1/go.mod h1:vpF70FUmC8bwa3OWnCshd2FqLfsEA9PFc4w1p2J65bw= -github.com/jbenet/go-context v0.0.0-20150711004518-d14ea06fba99 h1:BQSFePA1RWJOlocH6Fxy8MmwDt+yVQYULKfN0RoTN8A= -github.com/jbenet/go-context v0.0.0-20150711004518-d14ea06fba99/go.mod h1:1lJo3i6rXxKeerYnT8Nvf0QmHCRC1n8sfWVwXF2Frvo= -github.com/jessevdk/go-flags v1.5.0/go.mod h1:Fw0T6WPc1dYxT4mKEZRfG5kJhaTDP9pj1c2EWnYs/m4= -github.com/json-iterator/go v1.1.9/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4= -github.com/json-iterator/go v1.1.12 h1:PV8peI4a0ysnczrg+LtxykD8LfKY9ML6u2jnxaEnrnM= -github.com/json-iterator/go v1.1.12/go.mod h1:e30LSqwooZae/UwlEbR2852Gd8hjQvJoHmT4TnhNGBo= -github.com/kevinburke/ssh_config v0.0.0-20201106050909-4977a11b4351/go.mod h1:CT57kijsi8u/K/BOFA39wgDQJ9CxiF4nAY/ojJ6r6mM= -github.com/kevinburke/ssh_config v1.2.0 h1:x584FjTGwHzMwvHx18PXxbBVzfnxogHaAReU4gf13a4= -github.com/kevinburke/ssh_config v1.2.0/go.mod h1:CT57kijsi8u/K/BOFA39wgDQJ9CxiF4nAY/ojJ6r6mM= -github.com/konsorten/go-windows-terminal-sequences v1.0.1/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= -github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo= -github.com/kr/pretty v0.2.1/go.mod h1:ipq/a2n7PKx3OHsz4KJII5eveXtPO4qwEXGdVfWzfnI= -github.com/kr/pretty v0.3.0 h1:WgNl7dwNpEZ6jJ9k1snq4pZsg7DOEN8hP9Xw0Tsjwk0= -github.com/kr/pretty v0.3.0/go.mod h1:640gp4NfQd8pI5XOwp5fnNeVWj67G7CFk/SaSQn7NBk= -github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= -github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= -github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY= -github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE= -github.com/leodido/go-urn v1.2.0/go.mod h1:+8+nEpDfqqsY+g338gtMEUOtuK+4dEMhiQEgxpxOKII= -github.com/leodido/go-urn v1.2.1 h1:BqpAaACuzVSgi/VLzGZIobT2z4v53pjosyNd9Yv6n/w= -github.com/leodido/go-urn v1.2.1/go.mod h1:zt4jvISO2HfUBqxjfIshjdMTYS56ZS/qv49ictyFfxY= -github.com/matryer/is v1.2.0 h1:92UTHpy8CDwaJ08GqLDzhhuixiBUUD1p3AU6PHddz4A= -github.com/matryer/is v1.2.0/go.mod h1:2fLPjFQM9rhQ15aVEtbuwhJinnOqrmgXPNdZsdwlWXA= -github.com/mattn/go-isatty v0.0.12/go.mod h1:cbi8OIDigv2wuxKPP5vlRcQ1OAZbq2CE4Kysco4FUpU= -github.com/mattn/go-isatty v0.0.14 h1:yVuAays6BHfxijgZPzw+3Zlu5yQgKGP2/hcQbHb7S9Y= -github.com/mattn/go-isatty v0.0.14/go.mod h1:7GGIvUiUoEMVVmxf/4nioHXj79iQHKdU27kJ6hsGG94= -github.com/mitchellh/go-homedir v1.1.0 h1:lukF9ziXFxDFPkA1vsr5zpc1XuPDn/wFntq5mG+4E0Y= -github.com/mitchellh/go-homedir v1.1.0/go.mod h1:SfyaCUpYCn1Vlf4IUYiD9fPX4A5wJrkLzIz1N1q0pr0= -github.com/modern-go/concurrent v0.0.0-20180228061459-e0a39a4cb421 h1:ZqeYNhU3OHLH3mGKHDcjJRFFRrJa6eAM5H+CtDdOsPc= -github.com/modern-go/concurrent v0.0.0-20180228061459-e0a39a4cb421/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= -github.com/modern-go/reflect2 v0.0.0-20180701023420-4b7aa43c6742/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0= -github.com/modern-go/reflect2 v1.0.2 h1:xBagoLtFs94CBntxluKeaWgTMpvLxC4ur3nMaC9Gz0M= -github.com/modern-go/reflect2 v1.0.2/go.mod h1:yWuevngMOJpCy52FWWMvUC8ws7m/LJsjYzDa0/r8luk= -github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e/go.mod h1:zD1mROLANZcx1PVRCS0qkT7pwLkGfwJo4zjcN/Tysno= -github.com/pelletier/go-toml/v2 v2.0.1 h1:8e3L2cCQzLFi2CR4g7vGFuFxX7Jl1kKX8gW+iV0GUKU= -github.com/pelletier/go-toml/v2 v2.0.1/go.mod h1:r9LEWfGN8R5k0VXJ+0BkIe7MYkRdwZOjgMj2KwnJFUo= -github.com/pkg/diff v0.0.0-20210226163009-20ebb0f2a09e/go.mod h1:pJLUxLENpZxwdsKMEsNbx1VGcRFpLqf3715MtcvvzbA= -github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= -github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4= -github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= -github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= -github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= -github.com/rogpeppe/go-internal v1.6.1/go.mod h1:xXDCJY+GAPziupqXw64V24skbSoqbTEfhy4qGm1nDQc= -github.com/rogpeppe/go-internal v1.8.0 h1:FCbCCtXNOY3UtUuHUYaghJg4y7Fd14rXifAYUAtL9R8= -github.com/rogpeppe/go-internal v1.8.0/go.mod h1:WmiCO8CzOY8rg0OYDC4/i/2WRWAB6poM+XZ2dLUbcbE= -github.com/russross/blackfriday/v2 v2.1.0/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM= -github.com/sergi/go-diff v1.1.0/go.mod h1:STckp+ISIX8hZLjrqAeVduY0gWCT9IjLuqbuNXdaHfM= -github.com/sergi/go-diff v1.2.0 h1:XU+rvMAioB0UC3q1MFrIQy4Vo5/4VsRDQQXHsEya6xQ= -github.com/sergi/go-diff v1.2.0/go.mod h1:STckp+ISIX8hZLjrqAeVduY0gWCT9IjLuqbuNXdaHfM= -github.com/sirupsen/logrus v1.4.1/go.mod h1:ni0Sbl8bgC9z8RoU9G6nDWqqs/fq4eDPysMBDgk/93Q= -github.com/sirupsen/logrus v1.7.0/go.mod h1:yWOB1SBYBC5VeMP7gHvWumXLIWorT60ONWic61uBYv0= -github.com/spf13/cobra v1.5.0 h1:X+jTBEBqF0bHN+9cSMgmfuvv2VHJ9ezmFNf9Y/XstYU= -github.com/spf13/cobra v1.5.0/go.mod h1:dWXEIy2H428czQCjInthrTRUg7yKbok+2Qi/yBIJoUM= -github.com/spf13/cobra v1.6.1 h1:o94oiPyS4KD1mPy2fmcYYHHfCxLqYjJOhGsCHFZtEzA= -github.com/spf13/cobra v1.6.1/go.mod h1:IOw/AERYS7UzyrGinqmz6HLUo219MORXGxhbaJUqzrY= -github.com/spf13/pflag v1.0.5 h1:iy+VFUOCP1a+8yFto/drg2CJ5u0yRoB7fZw3DKv/JXA= -github.com/spf13/pflag v1.0.5/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg= -github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= -github.com/stretchr/objx v0.1.1/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= -github.com/stretchr/objx v0.4.0/go.mod h1:YvHI0jy2hoMjB+UWwv71VJQ9isScKT/TqJzVSSt89Yw= -github.com/stretchr/objx v0.5.0/go.mod h1:Yh+to48EsGEfYuaHDzXPcE3xhTkx73EhmCGUpEOglKo= -github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs= -github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= -github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4= -github.com/stretchr/testify v1.6.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= -github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= -github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= -github.com/stretchr/testify v1.8.0 h1:pSgiaMZlXftHpm5L7V1+rVB+AZJydKsMxsQBIJw4PKk= -github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU= -github.com/stretchr/testify v1.8.1/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4= -github.com/ugorji/go v1.1.7/go.mod h1:kZn38zHttfInRq0xu/PH0az30d+z6vm202qpg1oXVMw= -github.com/ugorji/go v1.2.7/go.mod h1:nF9osbDWLy6bDVv/Rtoh6QgnvNDpmCalQV5urGCCS6M= -github.com/ugorji/go/codec v1.1.7/go.mod h1:Ax+UKWsSmolVDwsd+7N3ZtXu+yMGCf907BLYF3GoBXY= -github.com/ugorji/go/codec v1.2.7 h1:YPXUKf7fYbp/y8xloBqZOw2qaVggbfwMlI8WM3wZUJ0= -github.com/ugorji/go/codec v1.2.7/go.mod h1:WGN1fab3R1fzQlVQTkfxVtIBhWDRqOviHU95kRgeqEY= -github.com/whilp/git-urls v1.0.0 h1:95f6UMWN5FKW71ECsXRUd3FVYiXdrE7aX4NZKcPmIjU= -github.com/whilp/git-urls v1.0.0/go.mod h1:J16SAmobsqc3Qcy98brfl5f5+e0clUvg1krgwk/qCfE= -github.com/xanzy/ssh-agent v0.3.0/go.mod h1:3s9xbODqPuuhK9JV1R321M/FlMZSBvE5aY6eAcqrDh0= -github.com/xanzy/ssh-agent v0.3.2 h1:eKj4SX2Fe7mui28ZgnFW5fmTz1EIr7ugo5s6wDxdHBM= -github.com/xanzy/ssh-agent v0.3.2/go.mod h1:6dzNDKs0J9rVPHPhaGCukekBHKqfl+L3KghI1Bc68Uw= -github.com/yuin/goldmark v1.1.25/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= -github.com/yuin/goldmark v1.3.5/go.mod h1:mwnBkeHKe2W/ZEtQ+71ViKU8L12m81fl3OWwC1Zlc8k= -go.opentelemetry.io/otel v1.10.0 h1:Y7DTJMR6zs1xkS/upamJYk0SxxN4C9AqRd77jmZnyY4= -go.opentelemetry.io/otel v1.10.0/go.mod h1:NbvWjCthWHKBEUMpf0/v8ZRZlni86PpGFEMA9pnQSnQ= -go.opentelemetry.io/otel/trace v1.10.0 h1:npQMbR8o7mum8uF95yFbOEJffhs1sbCOfDh8zAJiH5E= -go.opentelemetry.io/otel/trace v1.10.0/go.mod h1:Sij3YYczqAdz+EhmGhE6TpTxUO5/F/AzrK+kxfGqySM= -go.uber.org/atomic v1.7.0/go.mod h1:fEN4uk6kAWBTFdckzkM89CLk9XfWZrxpCo0nPH17wJc= -go.uber.org/atomic v1.10.0 h1:9qC72Qh0+3MqyJbAn8YU5xVq1frD8bn3JtD2oXtafVQ= -go.uber.org/atomic v1.10.0/go.mod h1:LUxbIzbOniOlMKjJjyPfpl4v+PKK2cNJn91OQbhoJI0= -go.uber.org/goleak v1.1.11-0.20210813005559-691160354723/go.mod h1:cwTWslyiVhfpKIDGSZEM2HlOvcqm+tG4zioyIeLoqMQ= -go.uber.org/goleak v1.1.11 h1:wy28qYRKZgnJTxGxvye5/wgWr1EKjmUDGYox5mGlRlI= -go.uber.org/goleak v1.1.11/go.mod h1:cwTWslyiVhfpKIDGSZEM2HlOvcqm+tG4zioyIeLoqMQ= -go.uber.org/multierr v1.6.0/go.mod h1:cdWPpRnG4AhwMwsgIHip0KRBQjJy5kYEpYjJxpXp9iU= -go.uber.org/multierr v1.8.0 h1:dg6GjLku4EH+249NNmoIciG9N/jURbDG+pFlTkhzIC8= -go.uber.org/multierr v1.8.0/go.mod h1:7EAYxJLBy9rStEaz58O2t4Uvip6FSURkq8/ppBp95ak= -go.uber.org/zap v1.19.1/go.mod h1:j3DNczoxDZroyBnOT1L/Q79cfUMGZxlv/9dzN7SM1rI= -go.uber.org/zap v1.23.0 h1:OjGQ5KQDEUawVHxNwQgPpiypGHOxo2mNZsOqTak4fFY= -go.uber.org/zap v1.23.0/go.mod h1:D+nX8jyLsMHMYrln8A0rJjFt/T/9/bGgIhAqxv5URuY= -golang.org/x/crypto v0.0.0-20190219172222-a4c6cb3142f2/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= -golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= -golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= -golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= -golang.org/x/crypto v0.0.0-20210322153248-0c34fe9e7dc2/go.mod h1:T9bdIzuCu7OtxOm1hfPfRQxPLYneinmdGuTeoZ9dtd4= -golang.org/x/crypto v0.0.0-20210421170649-83a5a9bb288b/go.mod h1:T9bdIzuCu7OtxOm1hfPfRQxPLYneinmdGuTeoZ9dtd4= -golang.org/x/crypto v0.0.0-20210711020723-a769d52b0f97/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= -golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= -golang.org/x/crypto v0.0.0-20220622213112-05595931fe9d/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4= -golang.org/x/crypto v0.0.0-20220829220503-c86fa9a7ed90 h1:Y/gsMcFOcR+6S6f3YeMKl5g+dZMEWqcz5Czj/GWYbkM= -golang.org/x/crypto v0.0.0-20220829220503-c86fa9a7ed90/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4= -golang.org/x/lint v0.0.0-20190930215403-16217165b5de/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= -golang.org/x/mod v0.2.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= -golang.org/x/mod v0.4.2/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= -golang.org/x/net v0.0.0-20190311183353-d8887717615a/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= -golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= -golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= -golang.org/x/net v0.0.0-20200226121028-0de0cce0169b/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= -golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= -golang.org/x/net v0.0.0-20210326060303-6b1517762897/go.mod h1:uSPa2vr4CLtc/ILN5odXGNXS6mhrKVzTaCXzk9m6W3k= -golang.org/x/net v0.0.0-20210405180319-a5a99cb37ef4/go.mod h1:p54w0d4576C0XHj96bSt6lcn1PtDYWL6XObtHCRCNQM= -golang.org/x/net v0.0.0-20211112202133-69e39bad7dc2/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= -golang.org/x/net v0.0.0-20220909164309-bea034e7d591 h1:D0B/7al0LLrVC8aWF4+oxpv/m8bc7ViFfVS8/gXGdqI= -golang.org/x/net v0.0.0-20220909164309-bea034e7d591/go.mod h1:YDH+HFinaLZZlnHAfSS6ZXJJ9M9t4Dl22yv3iI2vPwk= -golang.org/x/net v0.1.0 h1:hZ/3BUoy5aId7sCpA/Tc5lt8DkFgdVS2onTpJsZ/fl0= -golang.org/x/net v0.1.0/go.mod h1:Cx3nUiGt4eDBEyega/BKRp+/AlGL8hYe7U9odMt2Cco= -golang.org/x/net v0.2.0 h1:sZfSu1wtKLGlWI4ZZayP0ck9Y73K1ynO6gqzTdBVdPU= -golang.org/x/net v0.2.0/go.mod h1:KqCZLdyyvdV855qA2rE3GC2aiw5xGR5TEjj8smXukLY= -golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.0.0-20210220032951-036812b2e83c/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sys v0.0.0-20180905080454-ebe1bf3edb33/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= -golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= -golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20190507160741-ecd444e8653b/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20190916202348-b4ddaad3f8a3/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20191026070338-33540a1f6037/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200116001909-b77594299b42/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200302150141-5c8b2ff67527/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20210124154548-22da62e12c0c/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20210320140829-1e4c9ba3b0c4/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20210324051608-47abb6519492/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20210330210617-4fbd30eecc44/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20210423082822-04245dca01da/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20210502180810-71e4cd670f79/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20210510120138-977fb7262007/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20210630005230-0f9fa26af87c/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20210806184541-e5e7981a1069/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20211007075335-d3039528d8ac/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20220715151400-c0bba94af5f8/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20220909162455-aba9fc2a8ff2 h1:wM1k/lXfpc5HdkJJyW9GELpd8ERGdnh8sMGL6Gzq3Ho= -golang.org/x/sys v0.0.0-20220909162455-aba9fc2a8ff2/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.1.0 h1:kunALQeHf1/185U1i0GOB/fy1IPRDDpuoOOqRReG57U= -golang.org/x/sys v0.1.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.2.0 h1:ljd4t30dBnAvMZaQCevtY0xLLD0A+bRZXbgLMLU1F/A= -golang.org/x/sys v0.2.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= -golang.org/x/term v0.0.0-20210927222741-03fcf44c2211 h1:JGgROgKl9N8DuW20oFS5gxc+lE67/N3FcwmBPMe7ArY= -golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= -golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk= -golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= -golang.org/x/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= -golang.org/x/text v0.3.7 h1:olpwvP2KacW1ZWvsR7uQhoyTYvKAupfQrRGBFM352Gk= -golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ= -golang.org/x/text v0.4.0 h1:BrVqGRd7+k1DiOgtnFvAkoQEWQvBc25ouMJM6429SFg= -golang.org/x/text v0.4.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= -golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= -golang.org/x/tools v0.0.0-20190311212946-11955173bddd/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= -golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= -golang.org/x/tools v0.0.0-20200325010219-a49f79bcc224/go.mod h1:Sl4aGygMT6LrqrWclx+PTx3U+LnKx/seiNR+3G19Ar8= -golang.org/x/tools v0.1.5/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= -golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= -golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= -golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= -golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1 h1:go1bK/D/BFZV2I8cIQd1NKEZ+0owSTG1fDTci4IqFcE= -golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= -google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp09yW+WbY/TyQbw= -google.golang.org/protobuf v1.28.0 h1:w43yiav+6bVFTBQFZX0r7ipe9JQ1QsbMgHwbBziscLw= -google.golang.org/protobuf v1.28.0/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I= -gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= -gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= -gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= -gopkg.in/check.v1 v1.0.0-20200227125254-8fa46927fb4f/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= -gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntNwaWcugrBjAiHlqqRiVk= -gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c/go.mod h1:JHkPIbrfpd72SG/EVd6muEfDQjcINNoR0C8j2r3qZ4Q= -gopkg.in/errgo.v2 v2.1.0/go.mod h1:hNsd1EY+bozCKY1Ytp96fpM3vjJbqLJn88ws8XvfDNI= -gopkg.in/warnings.v0 v0.1.2 h1:wFXVbFY8DY5/xOe1ECiWdKCzZlxgshcYVNkBHstARME= -gopkg.in/warnings.v0 v0.1.2/go.mod h1:jksf8JmL6Qr/oQM2OXTHunEvvTAsrWBLb6OOjuVWRNI= -gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= -gopkg.in/yaml.v2 v2.2.4/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= -gopkg.in/yaml.v2 v2.2.8/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= -gopkg.in/yaml.v2 v2.3.0/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= -gopkg.in/yaml.v2 v2.4.0 h1:D8xgwECY7CYvx+Y2n4sBz93Jn9JRvxdiyyo8CTfuKaY= -gopkg.in/yaml.v2 v2.4.0/go.mod h1:RDklbk79AGWmwhnvt/jBztapEOGDOx6ZbXqjP6csGnQ= -gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= -gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= -gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= -gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= diff --git a/integration_test/main_test.go b/integration_test/main_test.go deleted file mode 100644 index d6132b5..0000000 --- a/integration_test/main_test.go +++ /dev/null @@ -1,25 +0,0 @@ -//go:build integration -// +build integration - -package integrationtest_test - -import ( - "os" - "testing" - - "git.front.kjuulh.io/kjuulh/octopush/internal/server" - "go.uber.org/zap" -) - -func MainTest(t *testing.M) { - logger, err := zap.NewDevelopment() - if err != nil { - panic(err) - } - err = server.Start(logger) - if err != nil { - panic(err) - } - - os.Exit(t.Run()) -} diff --git a/integration_test/storage_test.go b/integration_test/storage_test.go deleted file mode 100644 index b77e6b1..0000000 --- a/integration_test/storage_test.go +++ /dev/null @@ -1,74 +0,0 @@ -//go:build integration -// +build integration - -package integrationtest_test - -import ( - "context" - "os" - "path" - "testing" - - "git.front.kjuulh.io/kjuulh/octopush/internal/services/storage" - "github.com/stretchr/testify/require" -) - -func TestInitializeStorage(t *testing.T) { - t.Parallel() - storage, cfg := prepareService(t) - err := storage.InitializeStorage(context.Background()) - require.NoError(t, err) - - if _, err := os.Stat(path.Join(cfg.Path, "storage")); os.IsNotExist(err) { - require.NoError(t, err, "could not create storage directory") - } -} - -func TestCleanupStorage(t *testing.T) { - t.Parallel() - storage, _ := prepareService(t) - err := storage.InitializeStorage(context.Background()) - require.NoError(t, err) - - err = storage.CleanupStorage(context.Background()) - require.NoError(t, err) -} - -func TestCreateArea(t *testing.T) { - t.Parallel() - storage, cfg := prepareService(t) - err := storage.InitializeStorage(context.Background()) - require.NoError(t, err) - - area, err := storage.CreateArea(context.Background()) - require.NoError(t, err) - require.NotNil(t, area) - require.NotEmpty(t, area.Path) - require.Contains(t, area.Path, cfg.Path) -} - -func TestRemoveArea(t *testing.T) { - t.Parallel() - storage, _ := prepareService(t) - err := storage.InitializeStorage(context.Background()) - require.NoError(t, err) - area, err := storage.CreateArea(context.Background()) - require.NoError(t, err) - - err = storage.RemoveArea(context.Background(), area) - require.NoError(t, err) - - if _, err := os.Stat(area.Path); os.IsNotExist(err) { - require.Error(t, err, "directory could not be removed") - return - } - t.Fatal("directory could not be removed") -} - -func prepareService(t *testing.T) (*storage.Service, *storage.StorageConfig) { - cfg := &storage.StorageConfig{ - Path: t.TempDir(), - } - - return storage.NewService(cfg), cfg -} diff --git a/internal/actions/action.go b/internal/actions/action.go deleted file mode 100644 index 07b4245..0000000 --- a/internal/actions/action.go +++ /dev/null @@ -1,77 +0,0 @@ -package actions - -import ( - "context" - "errors" - - "git.front.kjuulh.io/kjuulh/octopush/internal/actions/builders" - "git.front.kjuulh.io/kjuulh/octopush/internal/actions/querier" - "git.front.kjuulh.io/kjuulh/octopush/internal/schema" - "git.front.kjuulh.io/kjuulh/octopush/internal/services/storage" - "go.uber.org/zap" -) - -type Action struct { - Schema *schema.OctopushSchema - SchemaPath string -} - -func (a *Action) Execute(ctx context.Context, area *storage.Area) error { - for _, action := range a.Schema.Actions { - switch action.Type { - case "go": - exe, err := builders.NewGo(zap.L()).Build(ctx, a.SchemaPath, action.Entry) - if err != nil { - return err - } - err = exe(ctx, area.Path) - if err != nil { - return err - } - - zap.L().Debug("Execution done") - - case "docker-build": - zap.L().Debug("Building docker-build") - runCmd, err := builders.NewDockerBuild(zap.L()).Build(ctx, a.SchemaPath, action.Entry) - if err != nil { - return err - } - err = runCmd(ctx, area.Path) - if err != nil { - return err - } - return nil - - default: - return errors.New("could not determine action type") - } - } - - return nil -} - -func (a *Action) Query(ctx context.Context, area *storage.Area) ([]string, bool, error) { - for _, query := range a.Schema.Queries { - switch query.Type { - case "grep": - exe, err := querier.NewRipGrep(zap.L()).Build(ctx, a.SchemaPath, query.Query) - if err != nil { - return nil, false, err - } - output, found, err := exe(ctx, area.Path) - if err != nil { - return nil, false, err - } - - zap.L().Debug("Execution done") - - return output, found, nil - - default: - return nil, false, errors.New("could not determine query type") - } - } - - return nil, false, nil -} diff --git a/internal/actions/action_creator.go b/internal/actions/action_creator.go deleted file mode 100644 index 7fe4ef0..0000000 --- a/internal/actions/action_creator.go +++ /dev/null @@ -1,85 +0,0 @@ -package actions - -import ( - "context" - "fmt" - "os" - "path" - "time" - - "git.front.kjuulh.io/kjuulh/octopush/internal/schema" - "git.front.kjuulh.io/kjuulh/octopush/internal/services/providers" - "git.front.kjuulh.io/kjuulh/octopush/internal/services/storage" - "go.uber.org/zap" -) - -type ( - ActionCreatorOps struct { - RepositoryUrl string - Branch string - Path string - } - - ActionCreator struct { - logger *zap.Logger - storage *storage.Service - git *providers.GoGit - } - - ActionCreatorDeps interface { - GetStorageService() *storage.Service - GetGitProvider() *providers.GoGit - } -) - -func NewActionCreator(logger *zap.Logger, deps ActionCreatorDeps) *ActionCreator { - return &ActionCreator{ - logger: logger, - storage: deps.GetStorageService(), - git: deps.GetGitProvider(), - } -} - -func (ac *ActionCreator) Prepare(ctx context.Context, ops *ActionCreatorOps) (*Action, error) { - area, err := ac.storage.CreateArea(ctx) - if err != nil { - ac.logger.Error("failed to allocate area", zap.Error(err)) - return nil, err - } - - cloneCtx, _ := context.WithTimeout(ctx, time.Second*10) - _, err = ac.git.CloneBranch(cloneCtx, area, ops.RepositoryUrl, ops.Branch) - if err != nil { - ac.logger.Error("could not clone repo", zap.Error(err)) - return nil, err - } - - executorUrl := path.Join(area.Path, ops.Path) - if _, err = os.Stat(executorUrl); os.IsNotExist(err) { - return nil, fmt.Errorf("path is invalid: %s", ops.Path) - } - - contents, err := os.ReadFile(path.Join(executorUrl, "octopush.yml")) - if err != nil { - return nil, err - } - - octopushSchema, err := schema.Unmarshal(string(contents)) - if err != nil { - return nil, err - } - - ac.logger.Debug("Action creator done") - return &Action{ - Schema: octopushSchema, - SchemaPath: executorUrl, - }, nil -} - -func (ac *ActionCreator) Cleanup(ctx context.Context, area *storage.Area) { - ac.logger.Debug("Removing area", zap.String("path", area.Path)) - err := ac.storage.RemoveArea(ctx, area) - if err != nil { - panic(err) - } -} diff --git a/internal/actions/builders/docker.go b/internal/actions/builders/docker.go deleted file mode 100644 index ae11be7..0000000 --- a/internal/actions/builders/docker.go +++ /dev/null @@ -1,95 +0,0 @@ -package builders - -import ( - "context" - "crypto/rand" - "encoding/hex" - "errors" - "fmt" - "os" - "os/exec" - - "go.uber.org/zap" - "go.uber.org/zap/zapio" -) - -type DockerBuild struct { - logger *zap.Logger -} - -func NewDockerBuild(logger *zap.Logger) *DockerBuild { - return &DockerBuild{logger: logger} -} - -type DockerRunCommand func(ctx context.Context, victimPath string) error - -func (g *DockerBuild) Build(ctx context.Context, modulePath, entryPath string) (DockerRunCommand, error) { - g.logger.Debug("Building docker image", zap.String("actiondir", modulePath), zap.String("entry", entryPath)) - - if _, err := os.Stat(fmt.Sprintf("%s/%s", modulePath, entryPath)); os.IsNotExist(err) { - return nil, errors.New("could not find entry") - } - - b := make([]byte, 20) - _, err := rand.Reader.Read(b) - if err != nil { - return nil, err - } - tag := hex.EncodeToString(b) - buildDockerCmd := fmt.Sprintf("(cd %s; docker build -f %s --tag octopush/%s .)", modulePath, entryPath, tag) - g.logger.Debug("Running command", zap.String("command", buildDockerCmd)) - - cmd := exec.CommandContext( - ctx, - "/bin/bash", - "-c", - buildDockerCmd, - ) - - debugwriter := &zapio.Writer{ - Log: g.logger, - Level: zap.DebugLevel, - } - defer debugwriter.Close() - - cmd.Stdout = debugwriter - cmd.Stderr = debugwriter - err = cmd.Start() - if err != nil { - return nil, err - } - - err = cmd.Wait() - if err != nil { - return nil, err - } - - g.logger.Debug("Docker image built!") - - return func(ctx context.Context, victimPath string) error { - g.logger.Debug("Executing script", zap.String("victim", victimPath)) - - cmd := exec.CommandContext( - ctx, - "/bin/bash", - "-c", - fmt.Sprintf("docker run --rm -v %s/:/src/work/ octopush/%s", victimPath, tag), - ) - - runDockerWriter := &zapio.Writer{ - Log: g.logger, - Level: zap.DebugLevel, - } - defer runDockerWriter.Close() - - cmd.Stdout = runDockerWriter - cmd.Stderr = runDockerWriter - - err = cmd.Start() - if err != nil { - return err - } - - return cmd.Wait() - }, nil -} diff --git a/internal/actions/builders/go.go b/internal/actions/builders/go.go deleted file mode 100644 index 6d828ee..0000000 --- a/internal/actions/builders/go.go +++ /dev/null @@ -1,46 +0,0 @@ -package builders - -import ( - "context" - "errors" - "fmt" - "os" - "os/exec" - - "go.uber.org/zap" -) - -type Go struct { - logger *zap.Logger -} - -func NewGo(logger *zap.Logger) *Go { - return &Go{logger: logger} -} - -type GoExecutable func(ctx context.Context, victimPath string) error - -func (g *Go) Build(ctx context.Context, modulePath, entryPath string) (GoExecutable, error) { - g.logger.Debug("Building go binary", zap.String("actiondir", modulePath), zap.String("entry", entryPath)) - - if _, err := os.Stat(fmt.Sprintf("%s/%s", modulePath, entryPath)); os.IsNotExist(err) { - return nil, errors.New("could not find entry") - } - - err := exec.CommandContext( - ctx, - "/bin/bash", - "-c", - fmt.Sprintf("(cd %s; go build -o main %s)", modulePath, entryPath), - ).Run() - if err != nil { - return nil, err - } - - g.logger.Debug("Go binary built!") - - return func(ctx context.Context, victimPath string) error { - g.logger.Debug("Executing script", zap.String("victim", victimPath)) - return exec.CommandContext(ctx, "/bin/bash", "-c", fmt.Sprintf("(cd %s; %s/main)", victimPath, modulePath)).Run() - }, nil -} diff --git a/internal/actions/querier/ripgrep.go b/internal/actions/querier/ripgrep.go deleted file mode 100644 index 99a415b..0000000 --- a/internal/actions/querier/ripgrep.go +++ /dev/null @@ -1,106 +0,0 @@ -package querier - -import ( - "context" - "fmt" - "io" - "os/exec" - "strings" - - "go.uber.org/zap" - "go.uber.org/zap/zapio" -) - -type RipGrep struct { - logger *zap.Logger -} - -func NewRipGrep(logger *zap.Logger) *RipGrep { - return &RipGrep{logger: logger} -} - -type RipGrepCommand func(ctx context.Context, victimPath string) ([]string, bool, error) - -func (g *RipGrep) Build(ctx context.Context, modulePath, query string) (RipGrepCommand, error) { - g.logger.Debug("Pulling docker image", zap.String("actiondir", modulePath), zap.String("query", query)) - - pullDockerImage := "docker pull mbologna/docker-ripgrep" - g.logger.Debug("Running command", zap.String("command", pullDockerImage)) - - cmd := exec.CommandContext( - ctx, - "/bin/bash", - "-c", - pullDockerImage, - ) - - debugwriter := &zapio.Writer{ - Log: g.logger, - Level: zap.DebugLevel, - } - defer debugwriter.Close() - - cmd.Stdout = debugwriter - cmd.Stderr = debugwriter - err := cmd.Start() - if err != nil { - return nil, err - } - - err = cmd.Wait() - if err != nil { - return nil, err - } - - g.logger.Debug("Docker image pulled") - - return func(ctx context.Context, victimPath string) ([]string, bool, error) { - g.logger.Debug("Executing script", zap.String("victim", victimPath)) - - runRipGrepCmd := fmt.Sprintf("docker run --rm -v %s/:/data:ro mbologna/docker-ripgrep rg -i '%s' || true", victimPath, query) - - g.logger.Debug("Execute ripgrep query", zap.String("command", runRipGrepCmd)) - - cmd := exec.CommandContext( - ctx, - "/bin/bash", - "-c", - runRipGrepCmd, - ) - - runDockerWriter := &zapio.Writer{ - Log: g.logger, - Level: zap.DebugLevel, - } - defer runDockerWriter.Close() - - builder := &strings.Builder{} - combinedWriter := io.MultiWriter(runDockerWriter, builder) - - cmd.Stdout = combinedWriter - cmd.Stderr = combinedWriter - - err = cmd.Start() - if err != nil { - return nil, false, err - } - - err = cmd.Wait() - if err != nil { - return nil, false, err - } - - contents := strings.Split(builder.String(), "\n") - validatedOutput := make([]string, 0) - - for _, c := range contents { - if !strings.Contains(c, "WARNING:") { - validatedOutput = append(validatedOutput, c) - } - } - - found := len(validatedOutput) > 0 - - return validatedOutput, found, nil - }, nil -} diff --git a/internal/api/health.go b/internal/api/health.go deleted file mode 100644 index 3373220..0000000 --- a/internal/api/health.go +++ /dev/null @@ -1,16 +0,0 @@ -package api - -import ( - "net/http" - - "github.com/gin-gonic/gin" -) - -func HealthRoute(app *gin.Engine) { - healthRoute := app.Group("/health") - healthRoute.GET("/ready", func(c *gin.Context) { - c.JSON(http.StatusOK, gin.H{ - "message": "healthy", - }) - }) -} diff --git a/internal/api/process_command.go b/internal/api/process_command.go deleted file mode 100644 index b067615..0000000 --- a/internal/api/process_command.go +++ /dev/null @@ -1,44 +0,0 @@ -package api - -import ( - "context" - "net/http" - - "git.front.kjuulh.io/kjuulh/octopush/internal/commands" - "git.front.kjuulh.io/kjuulh/octopush/internal/serverdeps" - "git.front.kjuulh.io/kjuulh/octopush/internal/services/jobs" - "github.com/gin-gonic/gin" - "github.com/google/uuid" - "go.uber.org/zap" -) - -func CommandRoute(logger *zap.Logger, app *gin.Engine, deps *serverdeps.ServerDeps) { - commandRoute := app.Group("commands") - commandRoute.POST("processRepos", func(c *gin.Context) { - type processReposRequest struct { - Repository string `json:"repository"` - Branch string `json:"branch"` - Path string `json:"path"` - } - var request processReposRequest - err := c.BindJSON(&request) - if err != nil { - logger.Info("could not bind request", zap.String("request", "processRepo"), zap.Error(err)) - c.AbortWithStatus(http.StatusBadRequest) - return - } - - jobId := uuid.New().String() - - go func(repository string, branch string, path string, jobId string) { - ctx := context.WithValue(context.Background(), jobs.JobId{}, jobId) - processRepos := commands.NewProcessRepos(logger, deps) - err = processRepos.Process(ctx, repository, branch, path) - if err != nil { - logger.Error("could not process repo", zap.Error(err)) - } - }(request.Repository, request.Branch, request.Path, jobId) - - c.Status(http.StatusAccepted) - }) -} diff --git a/internal/api/root.go b/internal/api/root.go deleted file mode 100644 index c4f36a4..0000000 --- a/internal/api/root.go +++ /dev/null @@ -1,12 +0,0 @@ -package api - -import ( - "git.front.kjuulh.io/kjuulh/octopush/internal/serverdeps" - "github.com/gin-gonic/gin" - "go.uber.org/zap" -) - -func BuildApi(logger *zap.Logger, app *gin.Engine, deps *serverdeps.ServerDeps) { - HealthRoute(app) - CommandRoute(logger, app, deps) -} diff --git a/internal/cli/cli.go b/internal/cli/cli.go deleted file mode 100644 index d128ad9..0000000 --- a/internal/cli/cli.go +++ /dev/null @@ -1,30 +0,0 @@ -package cli - -import ( - "context" - - "git.front.kjuulh.io/kjuulh/curre" - "git.front.kjuulh.io/kjuulh/octopush/internal/server" - "git.front.kjuulh.io/kjuulh/octopush/internal/serverdeps" - "git.front.kjuulh.io/kjuulh/octopush/internal/services/signer" - "go.uber.org/zap" -) - -func Start(ctx context.Context, logger *zap.Logger) (*serverdeps.ServerDeps, curre.CleanupFunc, error) { - deps := serverdeps.NewServerDeps(logger) - - readyChan := make(chan curre.ComponentsAreReady, 1) - - cleanupFunc, err := curre.NewManager(). - Register( - server.NewStorageServer(logger.With(zap.Namespace("storage")), deps), - ). - Register( - signer.NewOpenPGPApp(deps.GetOpenPGP()), - ). - RunNonBlocking(ctx, readyChan) - - <-readyChan - - return deps, cleanupFunc, err -} diff --git a/internal/commands/process_repos.go b/internal/commands/process_repos.go deleted file mode 100644 index 316298e..0000000 --- a/internal/commands/process_repos.go +++ /dev/null @@ -1,241 +0,0 @@ -package commands - -import ( - "context" - "fmt" - "strings" - "sync" - "time" - - "git.front.kjuulh.io/kjuulh/octopush/internal/actions" - "git.front.kjuulh.io/kjuulh/octopush/internal/gitproviders" - "git.front.kjuulh.io/kjuulh/octopush/internal/schema" - "git.front.kjuulh.io/kjuulh/octopush/internal/services/providers" - "git.front.kjuulh.io/kjuulh/octopush/internal/services/storage" - giturls "github.com/whilp/git-urls" - "go.uber.org/zap" -) - -type ( - ProcessRepos struct { - logger *zap.Logger - storage *storage.Service - git *providers.GoGit - actionCreator *actions.ActionCreator - gitea *gitproviders.Gitea - } - - ProcessReposDeps interface { - GetStorageService() *storage.Service - GetGitProvider() *providers.GoGit - GetActionCreator() *actions.ActionCreator - GetGitea() *gitproviders.Gitea - } -) - -func NewProcessRepos(logger *zap.Logger, deps ProcessReposDeps) *ProcessRepos { - return &ProcessRepos{ - logger: logger, - storage: deps.GetStorageService(), - git: deps.GetGitProvider(), - actionCreator: deps.GetActionCreator(), - gitea: deps.GetGitea(), - } -} - -func (pr *ProcessRepos) Process(ctx context.Context, repository string, branch string, actionPath string) error { - action, err := pr.actionCreator.Prepare(ctx, &actions.ActionCreatorOps{ - RepositoryUrl: repository, - Branch: branch, - Path: actionPath, - }) - if err != nil { - return err - } - - repositoryUrls, err := pr.getRepoUrls(ctx, action.Schema) - if err != nil { - return err - } - - wg := sync.WaitGroup{} - wg.Add(len(repositoryUrls)) - - for _, repoUrl := range repositoryUrls { - go func(ctx context.Context, repoUrl string) { - defer func() { - wg.Done() - }() - err := pr.processRepo(ctx, repoUrl, action) - if err != nil { - pr.logger.Error("could not process repo", zap.Error(err)) - } - }(ctx, repoUrl) - } - - wg.Wait() - pr.logger.Debug("finished processing all repos", zap.Strings("repos", repositoryUrls)) - - return nil -} - -func (pr *ProcessRepos) getRepoUrls(ctx context.Context, schema *schema.OctopushSchema) ([]string, error) { - repoUrls := make([]string, 0) - - repoUrls = append(repoUrls, schema.Select.Repositories...) - - for _, provider := range schema.Select.Providers { - repos, err := pr.gitea.ListRepositoriesForOrganization(ctx, provider.Gitea, provider.Organisation) - if err != nil { - return nil, err - } - - repoUrls = append(repoUrls, repos...) - } - - return repoUrls, nil -} - -func (pr *ProcessRepos) processRepo(ctx context.Context, repoUrl string, action *actions.Action) error { - cleanup, area, err := pr.prepareAction(ctx) - defer func() { - if cleanup != nil { - cleanup(ctx) - } - }() - if err != nil { - return err - } - - repo, err := pr.clone(ctx, area, repoUrl) - if err != nil { - return err - } - - if len(action.Schema.Queries) > 0 { - result, found, err := action.Query(ctx, area) - if err != nil { - return err - } - - if found { - pr.logger.Info("Query result", zap.Strings("result", result)) - // TODO: Append to real result, and return together - } - } - - if len(action.Schema.Actions) > 0 { - err = action.Execute(ctx, area) - if err != nil { - return err - } - - err = pr.commit(ctx, area, repo, repoUrl) - if err != nil { - return err - } - } - - pr.logger.Debug("processing done", zap.String("path", area.Path), zap.String("repoUrl", repoUrl)) - - return nil -} - -func (pr *ProcessRepos) prepareAction( - ctx context.Context, -) (func(ctx context.Context), *storage.Area, error) { - pr.logger.Debug("Creating area") - area, err := pr.storage.CreateArea(ctx) - if err != nil { - return nil, nil, err - } - - cleanupfunc := func(ctx context.Context) { - pr.logger.Debug("Removing area", zap.String("path", area.Path)) - err = pr.storage.RemoveArea(ctx, area) - if err != nil { - panic(err) - } - } - - return cleanupfunc, area, nil -} - -func (pr *ProcessRepos) clone(ctx context.Context, area *storage.Area, repoUrl string) (*providers.GoGitRepo, error) { - pr.logger.Debug("Cloning repo", zap.String("path", area.Path), zap.String("repoUrl", repoUrl)) - cloneCtx, _ := context.WithTimeout(ctx, time.Second*5) - repo, err := pr.git.Clone(cloneCtx, area, repoUrl) - if err != nil { - return nil, err - } - - err = pr.git.CreateBranch(ctx, repo) - if err != nil { - return nil, err - } - - return repo, nil -} - -func (pr *ProcessRepos) commit(ctx context.Context, area *storage.Area, repo *providers.GoGitRepo, repoUrl string) error { - wt, err := pr.git.Add(ctx, area, repo) - if err != nil { - return fmt.Errorf("could not add file: %w", err) - } - - status, err := wt.Status() - if err != nil { - return err - } - - if status.IsClean() { - // TODO: check for pr - pr.logger.Info("Returning early, as no modifications are detected") - //return nil - } - - err = pr.git.Commit(ctx, repo) - if err != nil { - return fmt.Errorf("could not get diff: %w", err) - } - - dryrun := false - if !dryrun { - - err = pr.git.Push(ctx, repo) - if err != nil { - return fmt.Errorf("could not push to repo: %w", err) - } - - url, err := giturls.Parse(repoUrl) - if err != nil { - return err - } - - head, err := repo.GetHEAD() - if err != nil { - return err - } - - path := strings.Split(url.Path, "/") - pr.logger.Debug("path string", zap.Strings("paths", path), zap.String("HEAD", head)) - - org := path[0] - repoName := path[1] - semanticName, _, ok := strings.Cut(repoName, ".") - if !ok { - semanticName = repoName - } - - originHead, err := pr.git.GetOriginHEADForRepo(ctx, repo) - if err != nil { - return err - } - - err = pr.gitea.CreatePr(ctx, fmt.Sprintf("%s://%s", "https", url.Host), org, semanticName, head, originHead, "octopush-apply") - if err != nil { - return err - } - } - return nil -} diff --git a/internal/gitproviders/gitea.go b/internal/gitproviders/gitea.go deleted file mode 100644 index fcc277a..0000000 --- a/internal/gitproviders/gitea.go +++ /dev/null @@ -1,143 +0,0 @@ -package gitproviders - -import ( - "context" - "errors" - "fmt" - "os" - "sync" - - "code.gitea.io/sdk/gitea" - "go.uber.org/zap" -) - -type Gitea struct { - logger *zap.Logger - giteamu sync.Mutex - giteaClients map[string]*gitea.Client -} - -func NewGitea(logger *zap.Logger) *Gitea { - return &Gitea{ - logger: logger, - giteamu: sync.Mutex{}, - giteaClients: make(map[string]*gitea.Client, 0), - } -} - -func (g *Gitea) ListRepositoriesForOrganization( - ctx context.Context, - server string, - organization string, -) ([]string, error) { - client, err := g.getOrCreateClient(ctx, server) - if err != nil { - return nil, err - } - - g.logger.Debug("Listing repos for gitea", zap.String("server", server)) - repos, resp, err := client.ListOrgRepos(organization, gitea.ListOrgReposOptions{ - ListOptions: gitea.ListOptions{ - Page: 0, - PageSize: 20, - }, - }) - if err != nil { - return nil, fmt.Errorf("could not list repos: %w", err) - } - - if resp.StatusCode >= 300 { - return nil, fmt.Errorf("gitea responded with a non 200 status code (gitea response: %s)", resp.Status) - } - - repoUrls := make([]string, len(repos)) - for i, repo := range repos { - repoUrls[i] = repo.SSHURL - } - - return repoUrls, err -} - -func (g *Gitea) CreatePr( - ctx context.Context, - server string, - organization string, - repository string, - head string, - base string, - actionName string, -) error { - client, err := g.getOrCreateClient(ctx, server) - if err != nil { - return err - } - - prs, _, err := client.ListRepoPullRequests(organization, repository, gitea.ListPullRequestsOptions{ - ListOptions: gitea.ListOptions{ - Page: 0, - PageSize: 30, - }, - State: gitea.StateOpen, - Sort: "recentupdate", - Milestone: 0, - }) - if err != nil { - return fmt.Errorf( - "could not list repos, needed because we need to check for conflicts. Original error: %w", - err, - ) - } - for _, pr := range prs { - if pr.Head.Name == head { - g.logger.Info( - "returning early from creating pull-request, as it already exists.", - zap.String("repository", repository), - zap.String("pull-request", pr.URL), - ) - return nil - } - } - - pr, _, err := client.CreatePullRequest(organization, repository, gitea.CreatePullRequestOption{ - Head: head, - Base: base, - Title: actionName, - }) - if err != nil { - return err - } - - g.logger.Debug( - "Created pr", - zap.String("repository", repository), - zap.String("branch", head), - zap.String("pull-request", pr.URL), - ) - - return nil -} - -func (g *Gitea) getOrCreateClient(ctx context.Context, server string) (*gitea.Client, error) { - g.giteamu.Lock() - defer g.giteamu.Unlock() - client, ok := g.giteaClients[server] - if !ok || client == nil { - c, err := gitea.NewClient(server) - username, ok := os.LookupEnv("GITEA_USERNAME") - if !ok { - return nil, errors.New("missing environment variable GITEA_USERNAME") - } - apitoken, ok := os.LookupEnv("GITEA_API_TOKEN") - if !ok { - return nil, errors.New("missing environment variable GITEA_API_TOKEN") - } - c.SetBasicAuth(username, apitoken) - if err != nil { - return nil, err - } - g.giteaClients[server] = c - return c, nil - } - - return client, nil -} diff --git a/internal/logger/zap.go b/internal/logger/zap.go deleted file mode 100644 index b3b10c9..0000000 --- a/internal/logger/zap.go +++ /dev/null @@ -1,33 +0,0 @@ -package logger - -import ( - "os" - - "go.uber.org/zap" - "go.uber.org/zap/zapcore" -) - -func New() (*zap.Logger, error) { - highPriority := zap.LevelEnablerFunc(func(lvl zapcore.Level) bool { - return lvl >= zapcore.ErrorLevel - }) - lowPriority := zap.LevelEnablerFunc(func(lvl zapcore.Level) bool { - return lvl < zapcore.ErrorLevel // && lvl > zapcore.DebugLevel - }) - - config := zap.NewDevelopmentEncoderConfig() - config.EncodeTime = nil - config.EncodeLevel = zapcore.CapitalColorLevelEncoder - consoleEncoder := zapcore.NewConsoleEncoder(config) - consoleDebugging := zapcore.Lock(os.Stdout) - consoleErrors := zapcore.Lock(os.Stderr) - - core := zapcore.NewTee( - zapcore.NewCore(consoleEncoder, consoleErrors, highPriority), - zapcore.NewCore(consoleEncoder, consoleDebugging, lowPriority), - ) - - logger := zap.New(core) - - return logger, nil -} diff --git a/internal/schema/kraken.go b/internal/schema/kraken.go deleted file mode 100644 index afa6f2d..0000000 --- a/internal/schema/kraken.go +++ /dev/null @@ -1,32 +0,0 @@ -package schema - -import "gopkg.in/yaml.v3" - -type OctopushSchema struct { - ApiVersion string `yaml:"apiVersion"` - Name string `yaml:"name"` - Select struct { - Repositories []string `yaml:"repositories"` - Providers []struct { - Gitea string `yaml:"gitea"` - Organisation string `yaml:"organisation"` - } `yaml:"providers"` - } `yaml:"select"` - Actions []struct { - Type string `yaml:"type"` - Entry string `yaml:"entry"` - } `yaml:"actions"` - Queries []struct { - Type string `yaml:"type"` - Query string `yaml:"query"` - } `yaml:"queries"` -} - -func Unmarshal(raw string) (*OctopushSchema, error) { - k := &OctopushSchema{} - err := yaml.Unmarshal([]byte(raw), k) - if err != nil { - return nil, err - } - return k, nil -} diff --git a/internal/server/http_server.go b/internal/server/http_server.go deleted file mode 100644 index b367049..0000000 --- a/internal/server/http_server.go +++ /dev/null @@ -1,54 +0,0 @@ -package server - -import ( - "context" - "errors" - "net/http" - "time" - - "git.front.kjuulh.io/kjuulh/curre" - "git.front.kjuulh.io/kjuulh/octopush/internal/api" - "git.front.kjuulh.io/kjuulh/octopush/internal/serverdeps" - ginzap "github.com/gin-contrib/zap" - "github.com/gin-gonic/gin" - "go.uber.org/zap" -) - -func NewGinHttpServer(logger *zap.Logger, deps *serverdeps.ServerDeps) curre.Component { - var app *gin.Engine - var server *http.Server - - return curre.NewFunctionalComponent(&curre.FunctionalComponent{ - InitFunc: func(_ *curre.FunctionalComponent, _ context.Context) error { - app = gin.New() - app.UseH2C = true - app.Use(ginzap.Ginzap(logger, time.RFC3339, true)) - app.Use(ginzap.RecoveryWithZap(logger, true)) - - api.BuildApi(logger, app, deps) - - server = &http.Server{ - Addr: "127.0.0.1:3000", - Handler: app, - } - - return nil - }, - StartFunc: func(_ *curre.FunctionalComponent, _ context.Context) error { - if server != nil { - err := server.ListenAndServe() - if err != nil && !errors.Is(err, http.ErrServerClosed) { - return err - } - } - return nil - }, - StopFunc: func(_ *curre.FunctionalComponent, ctx context.Context) error { - ctx, _ = context.WithTimeout(ctx, time.Second*10) - if server != nil { - server.Shutdown(ctx) - } - return nil - }, - }) -} diff --git a/internal/server/server.go b/internal/server/server.go deleted file mode 100644 index cc946eb..0000000 --- a/internal/server/server.go +++ /dev/null @@ -1,22 +0,0 @@ -package server - -import ( - "context" - - "git.front.kjuulh.io/kjuulh/curre" - "git.front.kjuulh.io/kjuulh/octopush/internal/serverdeps" - "git.front.kjuulh.io/kjuulh/octopush/internal/services/signer" - "go.uber.org/zap" -) - -func Start(logger *zap.Logger) error { - ctx := context.Background() - - deps := serverdeps.NewServerDeps(logger) - - return curre.NewManager(). - Register(NewGinHttpServer(logger.With(zap.Namespace("ginHttpServer")), deps)). - Register(NewStorageServer(logger.With(zap.Namespace("storageServer")), deps)). - Register(signer.NewOpenPGPApp(deps.GetOpenPGP())). - Run(ctx) -} diff --git a/internal/server/storage_server.go b/internal/server/storage_server.go deleted file mode 100644 index 9a18493..0000000 --- a/internal/server/storage_server.go +++ /dev/null @@ -1,28 +0,0 @@ -package server - -import ( - "context" - "time" - - "git.front.kjuulh.io/kjuulh/curre" - "git.front.kjuulh.io/kjuulh/octopush/internal/serverdeps" - "go.uber.org/zap" -) - -func NewStorageServer(logger *zap.Logger, deps *serverdeps.ServerDeps) curre.Component { - storage := deps.GetStorageService() - return curre.NewFunctionalComponent(&curre.FunctionalComponent{ - InitFunc: func(_ *curre.FunctionalComponent, ctx context.Context) error { - logger.Debug("Initializing storage") - return storage.InitializeStorage(ctx) - }, - StartFunc: func(fc *curre.FunctionalComponent, ctx context.Context) error { - return nil - }, - StopFunc: func(_ *curre.FunctionalComponent, ctx context.Context) error { - logger.Debug("Cleaning up storage") - ctx, _ = context.WithTimeout(ctx, time.Second*10) - return storage.CleanupStorage(ctx) - }, - }) -} diff --git a/internal/serverdeps/server_deps.go b/internal/serverdeps/server_deps.go deleted file mode 100644 index f52a88c..0000000 --- a/internal/serverdeps/server_deps.go +++ /dev/null @@ -1,74 +0,0 @@ -package serverdeps - -import ( - actionc "git.front.kjuulh.io/kjuulh/octopush/internal/actions" - "git.front.kjuulh.io/kjuulh/octopush/internal/gitproviders" - "git.front.kjuulh.io/kjuulh/octopush/internal/services/actions" - "git.front.kjuulh.io/kjuulh/octopush/internal/services/providers" - "git.front.kjuulh.io/kjuulh/octopush/internal/services/signer" - "git.front.kjuulh.io/kjuulh/octopush/internal/services/storage" - "go.uber.org/zap" -) - -type ServerDeps struct { - logger *zap.Logger - - storageConfig *storage.StorageConfig - gitCfg *providers.GitConfig - - openPGP *signer.OpenPGP -} - -func NewServerDeps(logger *zap.Logger) *ServerDeps { - deps := &ServerDeps{ - logger: logger.With(zap.Namespace("serverdeps")), - } - - if storageCfg, err := storage.NewDefaultStorageConfig(); err != nil { - panic(err) - } else { - deps.storageConfig = storageCfg - } - - deps.gitCfg = &providers.GitConfig{ - AuthOption: providers.GIT_AUTH_SSH, - User: "git", - Password: "", - AccessToken: "", - SshPublicKeyFilePath: "/Users/kah/.ssh/id_ed25519", - SshPrivateKeyPassword: "", - } - - openPGPConfig := &signer.OpenPgpConfig{ - PrivateKeyFilePath: "./example/testkey.private.pgp", - PrivateKeyPassword: "somepassword", - PrivateKeyIdentity: "kraken@kasperhermansen.com", - } - deps.openPGP = signer.NewOpenPGP(logger.With(zap.Namespace("openpgp")), openPGPConfig) - - return deps -} - -func (deps *ServerDeps) GetStorageService() *storage.Service { - return storage.NewService(deps.logger.With(zap.Namespace("storage")), deps.storageConfig) -} - -func (deps *ServerDeps) GetGitProvider() *providers.GoGit { - return providers.NewGit(deps.logger.With(zap.Namespace("gitProvider")), deps.gitCfg, deps.openPGP) -} - -func (deps *ServerDeps) GetAction() *actions.Action { - return actions.NewAction(deps.logger.With(zap.Namespace("action"))) -} - -func (deps *ServerDeps) GetActionCreator() *actionc.ActionCreator { - return actionc.NewActionCreator(deps.logger.With(zap.Namespace("action")), deps) -} - -func (deps *ServerDeps) GetGitea() *gitproviders.Gitea { - return gitproviders.NewGitea(deps.logger.With(zap.Namespace("gitea"))) -} - -func (deps *ServerDeps) GetOpenPGP() *signer.OpenPGP { - return deps.openPGP -} diff --git a/internal/services/actions/action.go b/internal/services/actions/action.go deleted file mode 100644 index c711b47..0000000 --- a/internal/services/actions/action.go +++ /dev/null @@ -1,43 +0,0 @@ -package actions - -import ( - "context" - - "git.front.kjuulh.io/kjuulh/octopush/internal/services/storage" - "go.uber.org/zap" -) - -type Predicate func(ctx context.Context, area *storage.Area) (bool, error) -type ActionFunc func(ctx context.Context, area *storage.Area) error - -type Action struct { - logger *zap.Logger -} - -func NewAction(logger *zap.Logger) *Action { - return &Action{logger: logger} -} - -func (a *Action) Run(ctx context.Context, area *storage.Area, predicate Predicate, action ActionFunc, dryrun bool) error { - matches, err := predicate(ctx, area) - if err != nil { - return err - } - - if !matches { - a.logger.Debug("repo doesn't match, skipping", zap.String("path", area.Path)) - return nil - } - - if dryrun { - a.logger.Panic("dryrun selected, but not implemented yet") - return nil - } - - err = action(ctx, area) - if err != nil { - return err - } - - return nil -} diff --git a/internal/services/jobs/models.go b/internal/services/jobs/models.go deleted file mode 100644 index 1dea285..0000000 --- a/internal/services/jobs/models.go +++ /dev/null @@ -1,4 +0,0 @@ -package jobs - -type JobId struct { -} diff --git a/internal/services/providers/git.go b/internal/services/providers/git.go deleted file mode 100644 index cf2a3ba..0000000 --- a/internal/services/providers/git.go +++ /dev/null @@ -1 +0,0 @@ -package providers diff --git a/internal/services/providers/gogit.go b/internal/services/providers/gogit.go deleted file mode 100644 index 3e1eacd..0000000 --- a/internal/services/providers/gogit.go +++ /dev/null @@ -1,339 +0,0 @@ -package providers - -import ( - "context" - "errors" - "fmt" - "time" - - "git.front.kjuulh.io/kjuulh/octopush/internal/services/signer" - "git.front.kjuulh.io/kjuulh/octopush/internal/services/storage" - "github.com/go-git/go-git/v5" - "github.com/go-git/go-git/v5/config" - "github.com/go-git/go-git/v5/plumbing" - "github.com/go-git/go-git/v5/plumbing/object" - "github.com/go-git/go-git/v5/plumbing/transport" - "github.com/go-git/go-git/v5/plumbing/transport/http" - "github.com/go-git/go-git/v5/plumbing/transport/ssh" - "go.uber.org/zap" - "go.uber.org/zap/zapio" -) - -// GoGit is a native git provider, it can clone, pull -// , push and as in abstraction on native git operations -type GoGit struct { - logger *zap.Logger - gitConfig *GitConfig - openPGP *signer.OpenPGP -} - -type GoGitRepo struct { - repo *git.Repository -} - -func (gr *GoGitRepo) GetHEAD() (string, error) { - head, err := gr.repo.Head() - if err != nil { - return "", err - } - - return head.Name().Short(), nil -} - -type GitAuth string - -const ( - GIT_AUTH_SSH GitAuth = "ssh" - GIT_AUTH_USERNAME_PASSWORD GitAuth = "username_password" - GIT_AUTH_ACCESS_TOKEN GitAuth = "access_token" - GIT_AUTH_ANONYMOUS GitAuth = "anonymous" - GIT_AUTH_SSH_AGENT GitAuth = "ssh_agent" -) - -type GitConfig struct { - AuthOption GitAuth - User string - Password string - AccessToken string - SshPublicKeyFilePath string - SshPrivateKeyPassword string -} - -func NewGit(logger *zap.Logger, gitConfig *GitConfig, openPGP *signer.OpenPGP) *GoGit { - return &GoGit{logger: logger, gitConfig: gitConfig, openPGP: openPGP} -} - -func (g *GoGit) GetOriginHEADForRepo(ctx context.Context, gitRepo *GoGitRepo) (string, error) { - auth, err := g.GetAuth() - if err != nil { - return "", err - } - - remote, err := gitRepo.repo.Remote("origin") - if err != nil { - return "", err - } - - refs, err := remote.ListContext(ctx, &git.ListOptions{ - Auth: auth, - }) - if err != nil { - return "", err - } - - headRef := "" - for _, ref := range refs { - //g.logger.Debug(ref.String()) - if ref.Target().IsBranch() { - headRef = ref.Target().Short() - } - } - - if headRef == "" { - return "", errors.New("no upstream HEAD branch could be found") - } - - return headRef, nil -} - -func (g *GoGit) CloneBranch(ctx context.Context, storageArea *storage.Area, repoUrl string, branch string) (*GoGitRepo, error) { - g.logger.Debug( - "cloning repository", - zap.String("repoUrl", repoUrl), - zap.String("path", storageArea.Path), - ) - - auth, err := g.GetAuth() - if err != nil { - return nil, err - } - - cloneOptions := git.CloneOptions{ - URL: repoUrl, - Auth: auth, - RemoteName: "origin", - ReferenceName: plumbing.NewBranchReferenceName(branch), - SingleBranch: false, - NoCheckout: false, - Depth: 1, - RecurseSubmodules: 1, - Progress: g.getProgressWriter(), - Tags: 0, - InsecureSkipTLS: false, - CABundle: []byte{}, - } - - repo, err := git.PlainCloneContext(ctx, storageArea.Path, false, &cloneOptions) - if err != nil && !errors.Is(err, git.NoErrAlreadyUpToDate) { - return nil, err - } - - g.logger.Debug("done cloning repo") - - return &GoGitRepo{repo: repo}, nil -} - -func (g *GoGit) Clone(ctx context.Context, storageArea *storage.Area, repoUrl string) (*GoGitRepo, error) { - g.logger.Debug( - "cloning repository", - zap.String("repoUrl", repoUrl), - zap.String("path", storageArea.Path), - ) - - auth, err := g.GetAuth() - if err != nil { - return nil, err - } - - cloneOptions := git.CloneOptions{ - URL: repoUrl, - Auth: auth, - RemoteName: "origin", - ReferenceName: "", - SingleBranch: false, - NoCheckout: false, - Depth: 1, - RecurseSubmodules: 1, - Progress: g.getProgressWriter(), - Tags: 0, - InsecureSkipTLS: false, - CABundle: []byte{}, - } - - repo, err := git.PlainCloneContext(ctx, storageArea.Path, false, &cloneOptions) - if err != nil { - return nil, err - } - - g.logger.Debug("done cloning repo") - - return &GoGitRepo{repo: repo}, nil -} - -func (g *GoGit) getProgressWriter() *zapio.Writer { - return &zapio.Writer{ - Log: g.logger.With(zap.String("process", "go-git")), - Level: zap.DebugLevel, - } -} - -func (g *GoGit) Add(ctx context.Context, storageArea *storage.Area, gitRepo *GoGitRepo) (*git.Worktree, error) { - worktree, err := gitRepo.repo.Worktree() - if err != nil { - return nil, err - } - - err = worktree.AddWithOptions(&git.AddOptions{ - All: true, - }) - if err != nil { - return nil, err - } - - status, err := worktree.Status() - if err != nil { - return nil, err - } - - g.logger.Debug("git status", zap.String("status", status.String())) - - return worktree, nil -} - -func (g *GoGit) CreateBranch(ctx context.Context, gitRepo *GoGitRepo) error { - worktree, err := gitRepo.repo.Worktree() - if err != nil { - return err - } - - refSpec := plumbing.NewBranchReferenceName("octopush-apply") - err = gitRepo.repo.CreateBranch(&config.Branch{ - Name: "octopush-apply", - Remote: "origin", - Merge: refSpec, - Rebase: "", - }) - if err != nil { - return fmt.Errorf("could not create branch: %w", err) - } - - err = worktree.Checkout(&git.CheckoutOptions{ - Branch: plumbing.ReferenceName(refSpec.String()), - Create: true, - Force: false, - Keep: false, - }) - if err != nil { - return fmt.Errorf("could not checkout branch: %w", err) - } - - //remoteRef := plumbing.NewRemoteReferenceName("origin", "octopush-apply") - //ref := plumbing.NewSymbolicReference(refSpec, remoteRef) - //err = gitRepo.repo.Storer.SetReference(ref) - //if err != nil { - // return fmt.Errorf("could not set reference: %w", err) - //} - - auth, err := g.GetAuth() - if err != nil { - return err - } - - err = worktree.PullContext(ctx, &git.PullOptions{ - RemoteName: "origin", - ReferenceName: "", - SingleBranch: false, - Depth: 1, - Auth: auth, - RecurseSubmodules: 1, - Progress: g.getProgressWriter(), - Force: true, - InsecureSkipTLS: false, - CABundle: []byte{}, - }) - if err != nil && !errors.Is(err, git.NoErrAlreadyUpToDate) { - return fmt.Errorf("could not pull from origin: %w", err) - } - - g.logger.Debug("done creating branches") - - return nil -} - -func (g *GoGit) Commit(ctx context.Context, gitRepo *GoGitRepo) error { - worktree, err := gitRepo.repo.Worktree() - if err != nil { - return err - } - - _, err = worktree.Commit("some-commit", &git.CommitOptions{ - All: true, - Author: &object.Signature{Name: "octopush", Email: "octopush@kasperhermansen.com", When: time.Now()}, - Committer: &object.Signature{Name: "octopush", Email: "octopush@kasperhermansen.com", When: time.Now()}, - SignKey: g.openPGP.SigningKey, - }) - if err != nil { - return err - } - - g.logger.Debug("done commiting objects") - - return nil -} - -func (g *GoGit) Push(ctx context.Context, gitRepo *GoGitRepo) error { - auth, err := g.GetAuth() - if err != nil { - return err - } - - err = gitRepo.repo.PushContext(ctx, &git.PushOptions{ - RemoteName: "origin", - RefSpecs: []config.RefSpec{}, - Auth: auth, - Progress: g.getProgressWriter(), - Prune: false, - Force: true, - InsecureSkipTLS: false, - CABundle: []byte{}, - RequireRemoteRefs: []config.RefSpec{}, - }) - if err != nil { - return err - } - - g.logger.Debug("done pushing branch") - - return nil -} - -func (g *GoGit) GetAuth() (transport.AuthMethod, error) { - switch g.gitConfig.AuthOption { - case GIT_AUTH_SSH: - sshKey, err := ssh.NewPublicKeysFromFile( - g.gitConfig.User, - g.gitConfig.SshPublicKeyFilePath, - g.gitConfig.SshPrivateKeyPassword, - ) - if err != nil { - return nil, err - } - return sshKey, nil - case GIT_AUTH_USERNAME_PASSWORD: - return &http.BasicAuth{ - Username: g.gitConfig.User, - Password: g.gitConfig.Password, - }, nil - case GIT_AUTH_ACCESS_TOKEN: - return &http.BasicAuth{ - Username: "required-username", - Password: g.gitConfig.AccessToken, - }, nil - case GIT_AUTH_ANONYMOUS: - return nil, nil - case GIT_AUTH_SSH_AGENT: - return ssh.NewSSHAgentAuth(g.gitConfig.User) - default: - return nil, nil - } -} diff --git a/internal/services/signer/openpgp.go b/internal/services/signer/openpgp.go deleted file mode 100644 index 0d53fc2..0000000 --- a/internal/services/signer/openpgp.go +++ /dev/null @@ -1,81 +0,0 @@ -package signer - -import ( - "context" - "errors" - "os" - "strings" - - "git.front.kjuulh.io/kjuulh/curre" - "github.com/ProtonMail/go-crypto/openpgp" - "go.uber.org/zap" -) - -type OpenPGP struct { - logger *zap.Logger - SigningKey *openpgp.Entity - config *OpenPgpConfig -} - -type OpenPgpConfig struct { - PrivateKeyFilePath string - PrivateKeyPassword string - PrivateKeyIdentity string -} - -func NewOpenPGP(logger *zap.Logger, config *OpenPgpConfig) *OpenPGP { - return &OpenPGP{ - logger: logger, - config: config, - } -} - -func NewOpenPGPApp(openPGP *OpenPGP) curre.Component { - return curre.NewFunctionalComponent(&curre.FunctionalComponent{ - InitFunc: func(_ *curre.FunctionalComponent, ctx context.Context) error { - keyring, err := buildKeyring(ctx, openPGP) - if err != nil { - openPGP.logger.Panic("could not build keyring", zap.Error(err)) - return err - } - - openPGP.SigningKey = keyring - - return nil - }, - StartFunc: func(fc *curre.FunctionalComponent, ctx context.Context) error { - return nil - }, - StopFunc: func(fc *curre.FunctionalComponent, ctx context.Context) error { - return nil - }, - }) -} - -func buildKeyring(_ context.Context, openPGP *OpenPGP) (*openpgp.Entity, error) { - content, err := os.ReadFile(openPGP.config.PrivateKeyFilePath) - if err != nil { - return nil, err - } - reader := strings.NewReader(string(content)) - - es, err := openpgp.ReadArmoredKeyRing(reader) - if err != nil { - return nil, err - } - - for _, key := range es { - for k := range key.Identities { - if strings.Contains(k, openPGP.config.PrivateKeyIdentity) { - err = key.PrivateKey.Decrypt([]byte(openPGP.config.PrivateKeyPassword)) - if err != nil { - return nil, err - } - return key, nil - } - } - } - - return nil, errors.New("could not find key matching identity") - -} diff --git a/internal/services/storage/models.go b/internal/services/storage/models.go deleted file mode 100644 index eac33dc..0000000 --- a/internal/services/storage/models.go +++ /dev/null @@ -1,7 +0,0 @@ -package storage - -type ( - Area struct { - Path string - } -) diff --git a/internal/services/storage/storage.go b/internal/services/storage/storage.go deleted file mode 100644 index 89b8a90..0000000 --- a/internal/services/storage/storage.go +++ /dev/null @@ -1,77 +0,0 @@ -package storage - -import ( - "errors" - "os" - "path" - - "go.uber.org/zap" - "golang.org/x/net/context" -) - -// The idea behind storage is that we have file dir, with a git repo. -// This file repo can now take certain actions - -type StorageConfig struct { - Path string -} - -func NewDefaultStorageConfig() (*StorageConfig, error) { - tempDir, err := os.MkdirTemp(os.TempDir(), "") - if err != nil { - return nil, err - } - return &StorageConfig{ - Path: path.Join(tempDir, "octopush"), - }, nil -} - -type Service struct { - logger *zap.Logger - cfg *StorageConfig -} - -func NewService(logger *zap.Logger, cfg *StorageConfig) *Service { - return &Service{logger: logger, cfg: cfg} -} - -func (s *Service) getStoragePath(ctx context.Context) string { - return path.Join(s.cfg.Path, "storage") -} - -func (s *Service) InitializeStorage(ctx context.Context) error { - return os.MkdirAll(s.getStoragePath(ctx), 0755) -} - -func (s *Service) CleanupStorage(ctx context.Context) error { - doneRemovingChan := make(chan struct{}, 1) - go func(ctx context.Context) { - s.logger.Debug("Removing all temp storage") - os.RemoveAll(s.getStoragePath(ctx)) - doneRemovingChan <- struct{}{} - }(ctx) - - select { - case <-ctx.Done(): - return errors.New("could not cleanup storage aborting") - case <-doneRemovingChan: - return nil - } - - return nil -} - -func (s *Service) CreateArea(ctx context.Context) (*Area, error) { - dir, err := os.MkdirTemp(s.getStoragePath(ctx), "*") - if err != nil { - return nil, err - } - - return &Area{ - Path: dir, - }, nil -} - -func (s *Service) RemoveArea(ctx context.Context, area *Area) error { - return os.RemoveAll(area.Path) -} diff --git a/roadmap.md b/roadmap.md deleted file mode 100644 index 2e91660..0000000 --- a/roadmap.md +++ /dev/null @@ -1,63 +0,0 @@ -# Roadmap - -## POC: - -- [x] Add cuddle -- [x] Create storage mechanism -- [x] Pull repository into storage -- [x] Create test action to run on repository -- [x] Sign commit using gpg -- [x] Push commits to branch - -### Not in scope - -- Pooled runners -- CLI with options -- Server app -- Git hosting providers - -## Version 0.1 - -- [x] Setup a way to choose actions and predicates -- [x] Allow instantiation of actions, octopush template repo etc. -- [x] Implement docker action -- [x] Create pr for gitea provider -- [x] Providing query results -- [x] Create CLI to trigger action - -## Version 0.2 - -- [x] Write README -- [x] Fix git issues -- [x] Allow octopush to run directly on the cli - -## Version 0.3 - -- [ ] Make select depend on query -- [ ] Make configurable ssh user -- [ ] Make configurable gpg keyset -- [ ] Make configurable git provider - - [ ] Add github -- [ ] Create templating function for easily creating new actions -- [ ] Add way to see progress of runners -- [ ] Implement global .octopush store for easy access to settings -- [ ] Move builders to start instead of every building on every action -- [ ] Setup releases on github -- [ ] Setup CI -- [ ] Setup static analysis -- [ ] Setup releases on gitea using drone -- [ ] Figure out a license (probably MIT) - -## Version 0.4 - -- [ ] Create setup version for local actions -- [ ] Create setup version for server actions -- [ ] Create json schema -- [ ] Move roadmap to release / changelog - -## Version 0.x - -- Think about some sort of isolation -- Run authenticated on servers -- Create queuing system -- Setup pool of runners diff --git a/scripts/push_github.sh b/scripts/push_github.sh deleted file mode 100755 index f8032db..0000000 --- a/scripts/push_github.sh +++ /dev/null @@ -1,7 +0,0 @@ -#!/bin/bash - -set -e - -git remote add github git@github.com:kjuulh/octopush.git || true - -git push -f github main diff --git a/scripts/run.sh b/scripts/run.sh deleted file mode 100755 index e2f75ac..0000000 --- a/scripts/run.sh +++ /dev/null @@ -1,15 +0,0 @@ -#!/bin/bash - -set -e - -run_server="cuddle_cli x run_server" - -$run_server & - -sleep 1s - -cuddle_cli x run_client - -sleep 5s - -kill %1 diff --git a/scripts/run_client.sh b/scripts/run_client.sh deleted file mode 100755 index 8ab48f4..0000000 --- a/scripts/run_client.sh +++ /dev/null @@ -1,13 +0,0 @@ -#!/bin/bash - -set -e - -current_branch=$(git branch --show-current) - -export $(cat .env | xargs) - -#go run cmd/octopush/octopush.go process --actions-repo "git@git.front.kjuulh.io:kjuulh/octopush.git" --branch "$current_branch" --path "_examples/actions/write_a_readme" -go run cmd/octopush/octopush.go process \ - --actions-repo "git@git.front.kjuulh.io:kjuulh/octopush.git"\ - --branch "$current_branch" \ - --path "_examples/actions/add_releaserc" diff --git a/scripts/run_server.sh b/scripts/run_server.sh deleted file mode 100755 index 59ec179..0000000 --- a/scripts/run_server.sh +++ /dev/null @@ -1,7 +0,0 @@ -#!/bin/bash - -set -e - -export $(cat .env | xargs) - -go run cmd/server/server.go start diff --git a/src/main.rs b/src/main.rs new file mode 100644 index 0000000..4dfd6b2 --- /dev/null +++ b/src/main.rs @@ -0,0 +1,18 @@ +use dotenv::dotenv; +use tracing_subscriber::prelude::*; + +#[tokio::main] +async fn main() -> eyre::Result<()> { + dotenv()?; + + tracing_subscriber::registry() + .with(tracing_subscriber::EnvFilter::new( + std::env::var("RUST_LOG") + .unwrap_or_else(|_| "octopush,octopush_cli,octopush_core,octopush_infra".into()), + )) + .with(tracing_subscriber::fmt::layer()) + .init(); + + let cli = octopush_cli::OctopushCli::new(); + cli.execute().await +} diff --git a/templates/build_release.Dockerfile b/templates/build_release.Dockerfile deleted file mode 100644 index ac7b134..0000000 --- a/templates/build_release.Dockerfile +++ /dev/null @@ -1,7 +0,0 @@ -FROM golang - -COPY . . - -RUN go build cmd/server/server.go - -CMD [ "server", "start" ]