diff --git a/Cargo.lock b/Cargo.lock index 53d0548..ea6f1b3 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2,1900 +2,6 @@ # It is not intended for manual editing. version = 4 -[[package]] -name = "anyhow" -version = "1.0.101" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5f0e0fee31ef5ed1ba1316088939cea399010ed7731dba877ed44aeb407a75ea" - -[[package]] -name = "atomic-waker" -version = "1.1.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1505bd5d3d116872e7271a6d4e16d81d0c8570876c8de68093a09ac269d8aac0" - -[[package]] -name = "base64" -version = "0.22.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "72b3254f16251a8381aa12e40e3c4d2f0199f8c6508fbecb9d91f575e0fbb8c6" - -[[package]] -name = "bitflags" -version = "2.10.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "812e12b5285cc515a9c72a5c1d3b6d46a19dac5acfef5265968c166106e31dd3" - -[[package]] -name = "bumpalo" -version = "3.19.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5dd9dc738b7a8311c7ade152424974d8115f2cdad61e8dab8dac9f2362298510" - -[[package]] -name = "bytes" -version = "1.11.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1e748733b7cbc798e1434b6ac524f0c1ff2ab456fe201501e6497c8417a4fc33" - -[[package]] -name = "cc" -version = "1.2.55" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "47b26a0954ae34af09b50f0de26458fa95369a0d478d8236d3f93082b219bd29" -dependencies = [ - "find-msvc-tools", - "shlex", -] - -[[package]] -name = "cfg-if" -version = "1.0.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9330f8b2ff13f34540b44e946ef35111825727b38d33286ef986142615121801" - -[[package]] -name = "cfg_aliases" -version = "0.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "613afe47fcd5fac7ccf1db93babcb082c5994d996f20b8b159f2ad1658eb5724" - -[[package]] -name = "core-foundation" -version = "0.9.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "91e195e091a93c46f7102ec7818a2aa394e1e1771c3ab4825963fa03e45afb8f" -dependencies = [ - "core-foundation-sys", - "libc", -] - -[[package]] -name = "core-foundation-sys" -version = "0.8.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "773648b94d0e5d620f64f280777445740e61fe701025087ec8b57f45c791888b" - -[[package]] -name = "displaydoc" -version = "0.2.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "97369cbbc041bc366949bc74d34658d6cda5621039731c6310521892a3a20ae0" -dependencies = [ - "proc-macro2", - "quote", - "syn", -] - -[[package]] -name = "equivalent" -version = "1.0.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "877a4ace8713b0bcf2a4e7eec82529c029f1d0619886d18145fea96c3ffe5c0f" - -[[package]] -name = "errno" -version = "0.3.14" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "39cab71617ae0d63f51a36d69f866391735b51691dbda63cf6f96d042b63efeb" -dependencies = [ - "libc", - "windows-sys 0.61.2", -] - -[[package]] -name = "fastrand" -version = "2.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "37909eebbb50d72f9059c3b6d82c0463f2ff062c9e95845c43a6c9c0355411be" - -[[package]] -name = "find-msvc-tools" -version = "0.1.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5baebc0774151f905a1a2cc41989300b1e6fbb29aff0ceffa1064fdd3088d582" - -[[package]] -name = "foldhash" -version = "0.1.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d9c4f5dac5e15c24eb999c26181a6ca40b39fe946cbe4c263c7209467bc83af2" - -[[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 = "forgejo-openapi" -version = "14.0.2-2-84240ce3a2+gitea-1.22.0" -dependencies = [ - "reqwest", - "serde", - "serde_json", - "serde_repr", - "tokio", - "tokio-util", - "url", -] - -[[package]] -name = "form_urlencoded" -version = "1.2.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cb4cb245038516f5f85277875cdaa4f7d2c9a0fa0468de06ed190163b1581fcf" -dependencies = [ - "percent-encoding", -] - -[[package]] -name = "futures-channel" -version = "0.3.31" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2dff15bf788c671c1934e366d07e30c1814a8ef514e1af724a602e8a2fbe1b10" -dependencies = [ - "futures-core", -] - -[[package]] -name = "futures-core" -version = "0.3.31" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "05f29059c0c2090612e8d742178b0580d2dc940c837851ad723096f87af6663e" - -[[package]] -name = "futures-io" -version = "0.3.31" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9e5c1b78ca4aae1ac06c48a526a655760685149f0d465d21f37abfe57ce075c6" - -[[package]] -name = "futures-macro" -version = "0.3.31" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "162ee34ebcb7c64a8abebc059ce0fee27c2262618d7b60ed8faf72fef13c3650" -dependencies = [ - "proc-macro2", - "quote", - "syn", -] - -[[package]] -name = "futures-sink" -version = "0.3.31" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e575fab7d1e0dcb8d0c7bcf9a63ee213816ab51902e6d244a95819acacf1d4f7" - -[[package]] -name = "futures-task" -version = "0.3.31" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f90f7dce0722e95104fcb095585910c0977252f286e354b5e3bd38902cd99988" - -[[package]] -name = "futures-util" -version = "0.3.31" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9fa08315bb612088cc391249efdc3bc77536f16c91f6cf495e6fbe85b20a4a81" -dependencies = [ - "futures-core", - "futures-io", - "futures-macro", - "futures-sink", - "futures-task", - "memchr", - "pin-project-lite", - "pin-utils", - "slab", -] - -[[package]] -name = "getrandom" -version = "0.2.17" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ff2abc00be7fca6ebc474524697ae276ad847ad0a6b3faa4bcb027e9a4614ad0" -dependencies = [ - "cfg-if", - "js-sys", - "libc", - "wasi", - "wasm-bindgen", -] - -[[package]] -name = "getrandom" -version = "0.3.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "899def5c37c4fd7b2664648c28120ecec138e4d395b459e5ca34f9cce2dd77fd" -dependencies = [ - "cfg-if", - "js-sys", - "libc", - "r-efi", - "wasip2", - "wasm-bindgen", -] - -[[package]] -name = "getrandom" -version = "0.4.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "139ef39800118c7683f2fd3c98c1b23c09ae076556b435f8e9064ae108aaeeec" -dependencies = [ - "cfg-if", - "libc", - "r-efi", - "wasip2", - "wasip3", -] - -[[package]] -name = "hashbrown" -version = "0.15.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9229cfe53dfd69f0609a49f65461bd93001ea1ef889cd5529dd176593f5338a1" -dependencies = [ - "foldhash", -] - -[[package]] -name = "hashbrown" -version = "0.16.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "841d1cc9bed7f9236f321df977030373f4a4163ae1a7dbfe1a51a2c1a51d9100" - -[[package]] -name = "heck" -version = "0.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2304e00983f87ffb38b55b444b5e3b60a884b5d30c0fca7d82fe33449bbe55ea" - -[[package]] -name = "http" -version = "1.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e3ba2a386d7f85a81f119ad7498ebe444d2e22c2af0b86b069416ace48b3311a" -dependencies = [ - "bytes", - "itoa", -] - -[[package]] -name = "http-body" -version = "1.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1efedce1fb8e6913f23e0c92de8e62cd5b772a67e7b3946df930a62566c93184" -dependencies = [ - "bytes", - "http", -] - -[[package]] -name = "http-body-util" -version = "0.1.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b021d93e26becf5dc7e1b75b1bed1fd93124b374ceb73f43d4d4eafec896a64a" -dependencies = [ - "bytes", - "futures-core", - "http", - "http-body", - "pin-project-lite", -] - -[[package]] -name = "httparse" -version = "1.10.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6dbf3de79e51f3d586ab4cb9d5c3e2c14aa28ed23d180cf89b4df0454a69cc87" - -[[package]] -name = "hyper" -version = "1.8.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2ab2d4f250c3d7b1c9fcdff1cece94ea4e2dfbec68614f7b87cb205f24ca9d11" -dependencies = [ - "atomic-waker", - "bytes", - "futures-channel", - "futures-core", - "http", - "http-body", - "httparse", - "itoa", - "pin-project-lite", - "pin-utils", - "smallvec", - "tokio", - "want", -] - -[[package]] -name = "hyper-rustls" -version = "0.27.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e3c93eb611681b207e1fe55d5a71ecf91572ec8a6705cdb6857f7d8d5242cf58" -dependencies = [ - "http", - "hyper", - "hyper-util", - "rustls", - "rustls-pki-types", - "tokio", - "tokio-rustls", - "tower-service", - "webpki-roots", -] - -[[package]] -name = "hyper-tls" -version = "0.6.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "70206fc6890eaca9fde8a0bf71caa2ddfc9fe045ac9e5c70df101a7dbde866e0" -dependencies = [ - "bytes", - "http-body-util", - "hyper", - "hyper-util", - "native-tls", - "tokio", - "tokio-native-tls", - "tower-service", -] - -[[package]] -name = "hyper-util" -version = "0.1.20" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "96547c2556ec9d12fb1578c4eaf448b04993e7fb79cbaad930a656880a6bdfa0" -dependencies = [ - "base64", - "bytes", - "futures-channel", - "futures-util", - "http", - "http-body", - "hyper", - "ipnet", - "libc", - "percent-encoding", - "pin-project-lite", - "socket2", - "tokio", - "tower-service", - "tracing", -] - -[[package]] -name = "icu_collections" -version = "2.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4c6b649701667bbe825c3b7e6388cb521c23d88644678e83c0c4d0a621a34b43" -dependencies = [ - "displaydoc", - "potential_utf", - "yoke", - "zerofrom", - "zerovec", -] - -[[package]] -name = "icu_locale_core" -version = "2.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "edba7861004dd3714265b4db54a3c390e880ab658fec5f7db895fae2046b5bb6" -dependencies = [ - "displaydoc", - "litemap", - "tinystr", - "writeable", - "zerovec", -] - -[[package]] -name = "icu_normalizer" -version = "2.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5f6c8828b67bf8908d82127b2054ea1b4427ff0230ee9141c54251934ab1b599" -dependencies = [ - "icu_collections", - "icu_normalizer_data", - "icu_properties", - "icu_provider", - "smallvec", - "zerovec", -] - -[[package]] -name = "icu_normalizer_data" -version = "2.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7aedcccd01fc5fe81e6b489c15b247b8b0690feb23304303a9e560f37efc560a" - -[[package]] -name = "icu_properties" -version = "2.1.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "020bfc02fe870ec3a66d93e677ccca0562506e5872c650f893269e08615d74ec" -dependencies = [ - "icu_collections", - "icu_locale_core", - "icu_properties_data", - "icu_provider", - "zerotrie", - "zerovec", -] - -[[package]] -name = "icu_properties_data" -version = "2.1.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "616c294cf8d725c6afcd8f55abc17c56464ef6211f9ed59cccffe534129c77af" - -[[package]] -name = "icu_provider" -version = "2.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "85962cf0ce02e1e0a629cc34e7ca3e373ce20dda4c4d7294bbd0bf1fdb59e614" -dependencies = [ - "displaydoc", - "icu_locale_core", - "writeable", - "yoke", - "zerofrom", - "zerotrie", - "zerovec", -] - -[[package]] -name = "id-arena" -version = "2.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3d3067d79b975e8844ca9eb072e16b31c3c1c36928edf9c6789548c524d0d954" - -[[package]] -name = "idna" -version = "1.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3b0875f23caa03898994f6ddc501886a45c7d3d62d04d2d90788d47be1b1e4de" -dependencies = [ - "idna_adapter", - "smallvec", - "utf8_iter", -] - -[[package]] -name = "idna_adapter" -version = "1.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3acae9609540aa318d1bc588455225fb2085b9ed0c4f6bd0d9d5bcd86f1a0344" -dependencies = [ - "icu_normalizer", - "icu_properties", -] - -[[package]] -name = "indexmap" -version = "2.13.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7714e70437a7dc3ac8eb7e6f8df75fd8eb422675fc7678aff7364301092b1017" -dependencies = [ - "equivalent", - "hashbrown 0.16.1", - "serde", - "serde_core", -] - -[[package]] -name = "ipnet" -version = "2.11.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "469fb0b9cefa57e3ef31275ee7cacb78f2fdca44e4765491884a2b119d4eb130" - -[[package]] -name = "iri-string" -version = "0.7.10" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c91338f0783edbd6195decb37bae672fd3b165faffb89bf7b9e6942f8b1a731a" -dependencies = [ - "memchr", - "serde", -] - -[[package]] -name = "itoa" -version = "1.0.17" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "92ecc6618181def0457392ccd0ee51198e065e016d1d527a7ac1b6dc7c1f09d2" - -[[package]] -name = "js-sys" -version = "0.3.85" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8c942ebf8e95485ca0d52d97da7c5a2c387d0e7f0ba4c35e93bfcaee045955b3" -dependencies = [ - "once_cell", - "wasm-bindgen", -] - -[[package]] -name = "leb128fmt" version = "0.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "09edd9e8b54e49e587e4f6295a7d29c3ea94d469cb40ab8ca70b288248a81db2" - -[[package]] -name = "libc" -version = "0.2.181" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "459427e2af2b9c839b132acb702a1c654d95e10f8c326bfc2ad11310e458b1c5" - -[[package]] -name = "linux-raw-sys" -version = "0.11.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "df1d3c3b53da64cf5760482273a98e575c651a67eec7f77df96b5b642de8f039" - -[[package]] -name = "litemap" -version = "0.8.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6373607a59f0be73a39b6fe456b8192fcc3585f602af20751600e974dd455e77" - -[[package]] -name = "log" -version = "0.4.29" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5e5032e24019045c762d3c0f28f5b6b8bbf38563a65908389bf7978758920897" - -[[package]] -name = "lru-slab" -version = "0.1.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "112b39cec0b298b6c1999fee3e31427f74f676e4cb9879ed1a121b43661a4154" - -[[package]] -name = "memchr" -version = "2.8.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f8ca58f447f06ed17d5fc4043ce1b10dd205e060fb3ce5b979b8ed8e59ff3f79" - -[[package]] -name = "mime" -version = "0.3.17" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6877bb514081ee2a7ff5ef9de3281f14a4dd4bceac4c09388074a6b5df8a139a" - -[[package]] -name = "mime_guess" -version = "2.0.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f7c44f8e672c00fe5308fa235f821cb4198414e1c77935c1ab6948d3fd78550e" -dependencies = [ - "mime", - "unicase", -] - -[[package]] -name = "mio" -version = "1.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a69bcab0ad47271a0234d9422b131806bf3968021e5dc9328caf2d4cd58557fc" -dependencies = [ - "libc", - "wasi", - "windows-sys 0.61.2", -] - -[[package]] -name = "native-tls" -version = "0.2.14" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "87de3442987e9dbec73158d5c715e7ad9072fda936bb03d19d7fa10e00520f0e" -dependencies = [ - "libc", - "log", - "openssl", - "openssl-probe", - "openssl-sys", - "schannel", - "security-framework", - "security-framework-sys", - "tempfile", -] - -[[package]] -name = "once_cell" -version = "1.21.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "42f5e15c9953c5e4ccceeb2e7382a716482c34515315f7b03532b8b4e8393d2d" - -[[package]] -name = "openssl" -version = "0.10.75" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "08838db121398ad17ab8531ce9de97b244589089e290a384c900cb9ff7434328" -dependencies = [ - "bitflags", - "cfg-if", - "foreign-types", - "libc", - "once_cell", - "openssl-macros", - "openssl-sys", -] - -[[package]] -name = "openssl-macros" -version = "0.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a948666b637a0f465e8564c73e89d4dde00d72d4d473cc972f390fc3dcee7d9c" -dependencies = [ - "proc-macro2", - "quote", - "syn", -] - -[[package]] -name = "openssl-probe" -version = "0.1.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d05e27ee213611ffe7d6348b942e8f942b37114c00cc03cec254295a4a17852e" - -[[package]] -name = "openssl-sys" -version = "0.9.111" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "82cab2d520aa75e3c58898289429321eb788c3106963d0dc886ec7a5f4adc321" -dependencies = [ - "cc", - "libc", - "pkg-config", - "vcpkg", -] - -[[package]] -name = "percent-encoding" -version = "2.3.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9b4f627cb1b25917193a259e49bdad08f671f8d9708acfd5fe0a8c1455d87220" - -[[package]] -name = "pin-project-lite" -version = "0.2.16" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3b3cff922bd51709b605d9ead9aa71031d81447142d828eb4a6eba76fe619f9b" - -[[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.32" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7edddbd0b52d732b21ad9a5fab5c704c14cd949e5e9a1ec5929a24fded1b904c" - -[[package]] -name = "potential_utf" -version = "0.1.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b73949432f5e2a09657003c25bca5e19a0e9c84f8058ca374f49e0ebe605af77" -dependencies = [ - "zerovec", -] - -[[package]] -name = "ppv-lite86" -version = "0.2.21" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "85eae3c4ed2f50dcfe72643da4befc30deadb458a9b590d720cde2f2b1e97da9" -dependencies = [ - "zerocopy", -] - -[[package]] -name = "prettyplease" -version = "0.2.37" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "479ca8adacdd7ce8f1fb39ce9ecccbfe93a3f1344b3d0d97f20bc0196208f62b" -dependencies = [ - "proc-macro2", - "syn", -] - -[[package]] -name = "proc-macro2" -version = "1.0.106" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8fd00f0bb2e90d81d1044c2b32617f68fcb9fa3bb7640c23e9c748e53fb30934" -dependencies = [ - "unicode-ident", -] - -[[package]] -name = "quinn" -version = "0.11.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b9e20a958963c291dc322d98411f541009df2ced7b5a4f2bd52337638cfccf20" -dependencies = [ - "bytes", - "cfg_aliases", - "pin-project-lite", - "quinn-proto", - "quinn-udp", - "rustc-hash", - "rustls", - "socket2", - "thiserror", - "tokio", - "tracing", - "web-time", -] - -[[package]] -name = "quinn-proto" -version = "0.11.13" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f1906b49b0c3bc04b5fe5d86a77925ae6524a19b816ae38ce1e426255f1d8a31" -dependencies = [ - "bytes", - "getrandom 0.3.4", - "lru-slab", - "rand", - "ring", - "rustc-hash", - "rustls", - "rustls-pki-types", - "slab", - "thiserror", - "tinyvec", - "tracing", - "web-time", -] - -[[package]] -name = "quinn-udp" -version = "0.5.14" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "addec6a0dcad8a8d96a771f815f0eaf55f9d1805756410b39f5fa81332574cbd" -dependencies = [ - "cfg_aliases", - "libc", - "once_cell", - "socket2", - "tracing", - "windows-sys 0.60.2", -] - -[[package]] -name = "quote" -version = "1.0.44" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "21b2ebcf727b7760c461f091f9f0f539b77b8e87f2fd88131e7f1b433b3cece4" -dependencies = [ - "proc-macro2", -] - -[[package]] -name = "r-efi" -version = "5.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "69cdb34c158ceb288df11e18b4bd39de994f6657d83847bdffdbd7f346754b0f" - -[[package]] -name = "rand" -version = "0.9.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6db2770f06117d490610c7488547d543617b21bfa07796d7a12f6f1bd53850d1" -dependencies = [ - "rand_chacha", - "rand_core", -] - -[[package]] -name = "rand_chacha" -version = "0.9.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d3022b5f1df60f26e1ffddd6c66e8aa15de382ae63b3a0c1bfc0e4d3e3f325cb" -dependencies = [ - "ppv-lite86", - "rand_core", -] - -[[package]] -name = "rand_core" -version = "0.9.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "76afc826de14238e6e8c374ddcc1fa19e374fd8dd986b0d2af0d02377261d83c" -dependencies = [ - "getrandom 0.3.4", -] - -[[package]] -name = "reqwest" -version = "0.12.28" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "eddd3ca559203180a307f12d114c268abf583f59b03cb906fd0b3ff8646c1147" -dependencies = [ - "base64", - "bytes", - "futures-core", - "futures-util", - "http", - "http-body", - "http-body-util", - "hyper", - "hyper-rustls", - "hyper-tls", - "hyper-util", - "js-sys", - "log", - "mime_guess", - "native-tls", - "percent-encoding", - "pin-project-lite", - "quinn", - "rustls", - "rustls-pki-types", - "serde", - "serde_json", - "serde_urlencoded", - "sync_wrapper", - "tokio", - "tokio-native-tls", - "tokio-rustls", - "tokio-util", - "tower", - "tower-http", - "tower-service", - "url", - "wasm-bindgen", - "wasm-bindgen-futures", - "wasm-streams", - "web-sys", - "webpki-roots", -] - -[[package]] -name = "ring" -version = "0.17.14" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a4689e6c2294d81e88dc6261c768b63bc4fcdb852be6d1352498b114f61383b7" -dependencies = [ - "cc", - "cfg-if", - "getrandom 0.2.17", - "libc", - "untrusted", - "windows-sys 0.52.0", -] - -[[package]] -name = "rustc-hash" -version = "2.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "357703d41365b4b27c590e3ed91eabb1b663f07c4c084095e60cbed4362dff0d" - -[[package]] -name = "rustix" -version = "1.1.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "146c9e247ccc180c1f61615433868c99f3de3ae256a30a43b49f67c2d9171f34" -dependencies = [ - "bitflags", - "errno", - "libc", - "linux-raw-sys", - "windows-sys 0.61.2", -] - -[[package]] -name = "rustls" -version = "0.23.36" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c665f33d38cea657d9614f766881e4d510e0eda4239891eea56b4cadcf01801b" -dependencies = [ - "once_cell", - "ring", - "rustls-pki-types", - "rustls-webpki", - "subtle", - "zeroize", -] - -[[package]] -name = "rustls-pki-types" -version = "1.14.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "be040f8b0a225e40375822a563fa9524378b9d63112f53e19ffff34df5d33fdd" -dependencies = [ - "web-time", - "zeroize", -] - -[[package]] -name = "rustls-webpki" -version = "0.103.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d7df23109aa6c1567d1c575b9952556388da57401e4ace1d15f79eedad0d8f53" -dependencies = [ - "ring", - "rustls-pki-types", - "untrusted", -] - -[[package]] -name = "rustversion" -version = "1.0.22" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b39cdef0fa800fc44525c84ccb54a029961a8215f9619753635a9c0d2538d46d" - -[[package]] -name = "ryu" -version = "1.0.23" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9774ba4a74de5f7b1c1451ed6cd5285a32eddb5cccb8cc655a4e50009e06477f" - -[[package]] -name = "schannel" -version = "0.1.28" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "891d81b926048e76efe18581bf793546b4c0eaf8448d72be8de2bbee5fd166e1" -dependencies = [ - "windows-sys 0.61.2", -] - -[[package]] -name = "security-framework" -version = "2.11.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "897b2245f0b511c87893af39b033e5ca9cce68824c4d7e7630b5a1d339658d02" -dependencies = [ - "bitflags", - "core-foundation", - "core-foundation-sys", - "libc", - "security-framework-sys", -] - -[[package]] -name = "security-framework-sys" -version = "2.15.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cc1f0cbffaac4852523ce30d8bd3c5cdc873501d96ff467ca09b6767bb8cd5c0" -dependencies = [ - "core-foundation-sys", - "libc", -] - -[[package]] -name = "semver" -version = "1.0.27" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d767eb0aabc880b29956c35734170f26ed551a859dbd361d140cdbeca61ab1e2" - -[[package]] -name = "serde" -version = "1.0.228" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9a8e94ea7f378bd32cbbd37198a4a91436180c5bb472411e48b5ec2e2124ae9e" -dependencies = [ - "serde_core", - "serde_derive", -] - -[[package]] -name = "serde_core" -version = "1.0.228" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "41d385c7d4ca58e59fc732af25c3983b67ac852c1a25000afe1175de458b67ad" -dependencies = [ - "serde_derive", -] - -[[package]] -name = "serde_derive" -version = "1.0.228" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d540f220d3187173da220f885ab66608367b6574e925011a9353e4badda91d79" -dependencies = [ - "proc-macro2", - "quote", - "syn", -] - -[[package]] -name = "serde_json" -version = "1.0.149" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "83fc039473c5595ace860d8c4fafa220ff474b3fc6bfdb4293327f1a37e94d86" -dependencies = [ - "itoa", - "memchr", - "serde", - "serde_core", - "zmij", -] - -[[package]] -name = "serde_repr" -version = "0.1.20" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "175ee3e80ae9982737ca543e96133087cbd9a485eecc3bc4de9c1a37b47ea59c" -dependencies = [ - "proc-macro2", - "quote", - "syn", -] - -[[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 = "shlex" -version = "1.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0fda2ff0d084019ba4d7c6f371c95d8fd75ce3524c3cb8fb653a3023f6323e64" - -[[package]] -name = "slab" -version = "0.4.12" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0c790de23124f9ab44544d7ac05d60440adc586479ce501c1d6d7da3cd8c9cf5" - -[[package]] -name = "smallvec" -version = "1.15.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "67b1b7a3b5fe4f1376887184045fcf45c69e92af734b7aaddc05fb777b6fbd03" - -[[package]] -name = "socket2" -version = "0.6.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "86f4aa3ad99f2088c990dfa82d367e19cb29268ed67c574d10d0a4bfe71f07e0" -dependencies = [ - "libc", - "windows-sys 0.60.2", -] - -[[package]] -name = "stable_deref_trait" -version = "1.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6ce2be8dc25455e1f91df71bfa12ad37d7af1092ae736f3a6cd0e37bc7810596" - -[[package]] -name = "subtle" -version = "2.6.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "13c2bddecc57b384dee18652358fb23172facb8a2c51ccc10d74c157bdea3292" - -[[package]] -name = "syn" -version = "2.0.114" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d4d107df263a3013ef9b1879b0df87d706ff80f65a86ea879bd9c31f9b307c2a" -dependencies = [ - "proc-macro2", - "quote", - "unicode-ident", -] - -[[package]] -name = "sync_wrapper" -version = "1.0.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0bf256ce5efdfa370213c1dabab5935a12e49f2c58d15e9eac2870d3b4f27263" -dependencies = [ - "futures-core", -] - -[[package]] -name = "synstructure" -version = "0.13.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "728a70f3dbaf5bab7f0c4b1ac8d7ae5ea60a4b5549c8a5914361c99147a709d2" -dependencies = [ - "proc-macro2", - "quote", - "syn", -] - -[[package]] -name = "tempfile" -version = "3.25.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0136791f7c95b1f6dd99f9cc786b91bb81c3800b639b3478e561ddb7be95e5f1" -dependencies = [ - "fastrand", - "getrandom 0.4.1", - "once_cell", - "rustix", - "windows-sys 0.61.2", -] - -[[package]] -name = "thiserror" -version = "2.0.18" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4288b5bcbc7920c07a1149a35cf9590a2aa808e0bc1eafaade0b80947865fbc4" -dependencies = [ - "thiserror-impl", -] - -[[package]] -name = "thiserror-impl" -version = "2.0.18" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ebc4ee7f67670e9b64d05fa4253e753e016c6c95ff35b89b7941d6b856dec1d5" -dependencies = [ - "proc-macro2", - "quote", - "syn", -] - -[[package]] -name = "tinystr" -version = "0.8.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "42d3e9c45c09de15d06dd8acf5f4e0e399e85927b7f00711024eb7ae10fa4869" -dependencies = [ - "displaydoc", - "zerovec", -] - -[[package]] -name = "tinyvec" -version = "1.10.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bfa5fdc3bce6191a1dbc8c02d5c8bffcf557bafa17c124c5264a458f1b0613fa" -dependencies = [ - "tinyvec_macros", -] - -[[package]] -name = "tinyvec_macros" -version = "0.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1f3ccbac311fea05f86f61904b462b55fb3df8837a366dfc601a0161d0532f20" - -[[package]] -name = "tokio" -version = "1.49.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "72a2903cd7736441aac9df9d7688bd0ce48edccaadf181c3b90be801e81d3d86" -dependencies = [ - "bytes", - "libc", - "mio", - "pin-project-lite", - "socket2", - "windows-sys 0.61.2", -] - -[[package]] -name = "tokio-native-tls" -version = "0.3.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bbae76ab933c85776efabc971569dd6119c580d8f5d448769dec1764bf796ef2" -dependencies = [ - "native-tls", - "tokio", -] - -[[package]] -name = "tokio-rustls" -version = "0.26.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1729aa945f29d91ba541258c8df89027d5792d85a8841fb65e8bf0f4ede4ef61" -dependencies = [ - "rustls", - "tokio", -] - -[[package]] -name = "tokio-util" -version = "0.7.18" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9ae9cec805b01e8fc3fd2fe289f89149a9b66dd16786abd8b19cfa7b48cb0098" -dependencies = [ - "bytes", - "futures-core", - "futures-sink", - "pin-project-lite", - "tokio", -] - -[[package]] -name = "tower" -version = "0.5.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ebe5ef63511595f1344e2d5cfa636d973292adc0eec1f0ad45fae9f0851ab1d4" -dependencies = [ - "futures-core", - "futures-util", - "pin-project-lite", - "sync_wrapper", - "tokio", - "tower-layer", - "tower-service", -] - -[[package]] -name = "tower-http" -version = "0.6.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d4e6559d53cc268e5031cd8429d05415bc4cb4aefc4aa5d6cc35fbf5b924a1f8" -dependencies = [ - "bitflags", - "bytes", - "futures-util", - "http", - "http-body", - "iri-string", - "pin-project-lite", - "tower", - "tower-layer", - "tower-service", -] - -[[package]] -name = "tower-layer" -version = "0.3.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "121c2a6cda46980bb0fcd1647ffaf6cd3fc79a013de288782836f6df9c48780e" - -[[package]] -name = "tower-service" -version = "0.3.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8df9b6e13f2d32c91b9bd719c00d1958837bc7dec474d94952798cc8e69eeec3" - -[[package]] -name = "tracing" -version = "0.1.44" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "63e71662fa4b2a2c3a26f570f037eb95bb1f85397f3cd8076caed2f026a6d100" -dependencies = [ - "pin-project-lite", - "tracing-core", -] - -[[package]] -name = "tracing-core" -version = "0.1.36" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "db97caf9d906fbde555dd62fa95ddba9eecfd14cb388e4f491a66d74cd5fb79a" -dependencies = [ - "once_cell", -] - -[[package]] -name = "try-lock" -version = "0.2.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e421abadd41a4225275504ea4d6566923418b7f05506fbc9c0fe86ba7396114b" - -[[package]] -name = "unicase" -version = "2.9.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dbc4bc3a9f746d862c45cb89d705aa10f187bb96c76001afab07a0d35ce60142" - -[[package]] -name = "unicode-ident" -version = "1.0.23" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "537dd038a89878be9b64dd4bd1b260315c1bb94f4d784956b81e27a088d9a09e" - -[[package]] -name = "unicode-xid" -version = "0.2.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ebc1c04c71510c7f702b52b7c350734c9ff1295c464a03335b00bb84fc54f853" - -[[package]] -name = "untrusted" -version = "0.9.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8ecb6da28b8a351d773b68d5825ac39017e680750f980f3a1a85cd8dd28a47c1" - -[[package]] -name = "url" -version = "2.5.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ff67a8a4397373c3ef660812acab3268222035010ab8680ec4215f38ba3d0eed" -dependencies = [ - "form_urlencoded", - "idna", - "percent-encoding", - "serde", -] - -[[package]] -name = "utf8_iter" -version = "1.0.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b6c140620e7ffbb22c2dee59cafe6084a59b5ffc27a8859a5f0d494b5d52b6be" - -[[package]] -name = "vcpkg" -version = "0.2.15" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "accd4ea62f7bb7a82fe23066fb0957d48ef677f6eeb8215f372f52e48bb32426" - -[[package]] -name = "want" -version = "0.3.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bfa7760aed19e106de2c7c0b581b509f2f25d3dacaf737cb82ac61bc6d760b0e" -dependencies = [ - "try-lock", -] - -[[package]] -name = "wasi" -version = "0.11.1+wasi-snapshot-preview1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ccf3ec651a847eb01de73ccad15eb7d99f80485de043efb2f370cd654f4ea44b" - -[[package]] -name = "wasip2" -version = "1.0.2+wasi-0.2.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9517f9239f02c069db75e65f174b3da828fe5f5b945c4dd26bd25d89c03ebcf5" -dependencies = [ - "wit-bindgen", -] - -[[package]] -name = "wasip3" -version = "0.4.0+wasi-0.3.0-rc-2026-01-06" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5428f8bf88ea5ddc08faddef2ac4a67e390b88186c703ce6dbd955e1c145aca5" -dependencies = [ - "wit-bindgen", -] - -[[package]] -name = "wasm-bindgen" -version = "0.2.108" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "64024a30ec1e37399cf85a7ffefebdb72205ca1c972291c51512360d90bd8566" -dependencies = [ - "cfg-if", - "once_cell", - "rustversion", - "wasm-bindgen-macro", - "wasm-bindgen-shared", -] - -[[package]] -name = "wasm-bindgen-futures" -version = "0.4.58" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "70a6e77fd0ae8029c9ea0063f87c46fde723e7d887703d74ad2616d792e51e6f" -dependencies = [ - "cfg-if", - "futures-util", - "js-sys", - "once_cell", - "wasm-bindgen", - "web-sys", -] - -[[package]] -name = "wasm-bindgen-macro" -version = "0.2.108" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "008b239d9c740232e71bd39e8ef6429d27097518b6b30bdf9086833bd5b6d608" -dependencies = [ - "quote", - "wasm-bindgen-macro-support", -] - -[[package]] -name = "wasm-bindgen-macro-support" -version = "0.2.108" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5256bae2d58f54820e6490f9839c49780dff84c65aeab9e772f15d5f0e913a55" -dependencies = [ - "bumpalo", - "proc-macro2", - "quote", - "syn", - "wasm-bindgen-shared", -] - -[[package]] -name = "wasm-bindgen-shared" -version = "0.2.108" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1f01b580c9ac74c8d8f0c0e4afb04eeef2acf145458e52c03845ee9cd23e3d12" -dependencies = [ - "unicode-ident", -] - -[[package]] -name = "wasm-encoder" -version = "0.244.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "990065f2fe63003fe337b932cfb5e3b80e0b4d0f5ff650e6985b1048f62c8319" -dependencies = [ - "leb128fmt", - "wasmparser", -] - -[[package]] -name = "wasm-metadata" -version = "0.244.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bb0e353e6a2fbdc176932bbaab493762eb1255a7900fe0fea1a2f96c296cc909" -dependencies = [ - "anyhow", - "indexmap", - "wasm-encoder", - "wasmparser", -] - -[[package]] -name = "wasm-streams" -version = "0.4.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "15053d8d85c7eccdbefef60f06769760a563c7f0a9d6902a13d35c7800b0ad65" -dependencies = [ - "futures-util", - "js-sys", - "wasm-bindgen", - "wasm-bindgen-futures", - "web-sys", -] - -[[package]] -name = "wasmparser" -version = "0.244.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "47b807c72e1bac69382b3a6fb3dbe8ea4c0ed87ff5629b8685ae6b9a611028fe" -dependencies = [ - "bitflags", - "hashbrown 0.15.5", - "indexmap", - "semver", -] - -[[package]] -name = "web-sys" -version = "0.3.85" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "312e32e551d92129218ea9a2452120f4aabc03529ef03e4d0d82fb2780608598" -dependencies = [ - "js-sys", - "wasm-bindgen", -] - -[[package]] -name = "web-time" -version = "1.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5a6580f308b1fad9207618087a65c04e7a10bc77e02c8e84e9b00dd4b12fa0bb" -dependencies = [ - "js-sys", - "wasm-bindgen", -] - -[[package]] -name = "webpki-roots" -version = "1.0.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "22cfaf3c063993ff62e73cb4311efde4db1efb31ab78a3e5c457939ad5cc0bed" -dependencies = [ - "rustls-pki-types", -] - -[[package]] -name = "windows-link" -version = "0.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f0805222e57f7521d6a62e36fa9163bc891acd422f971defe97d64e70d0a4fe5" - -[[package]] -name = "windows-sys" -version = "0.52.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "282be5f36a8ce781fad8c8ae18fa3f9beff57ec1b52cb3de0789201425d9a33d" -dependencies = [ - "windows-targets 0.52.6", -] - -[[package]] -name = "windows-sys" -version = "0.60.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f2f500e4d28234f72040990ec9d39e3a6b950f9f22d3dba18416c35882612bcb" -dependencies = [ - "windows-targets 0.53.5", -] - -[[package]] -name = "windows-sys" -version = "0.61.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ae137229bcbd6cdf0f7b80a31df61766145077ddf49416a728b02cb3921ff3fc" -dependencies = [ - "windows-link", -] - -[[package]] -name = "windows-targets" -version = "0.52.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9b724f72796e036ab90c1021d4780d4d3d648aca59e491e6b98e725b84e99973" -dependencies = [ - "windows_aarch64_gnullvm 0.52.6", - "windows_aarch64_msvc 0.52.6", - "windows_i686_gnu 0.52.6", - "windows_i686_gnullvm 0.52.6", - "windows_i686_msvc 0.52.6", - "windows_x86_64_gnu 0.52.6", - "windows_x86_64_gnullvm 0.52.6", - "windows_x86_64_msvc 0.52.6", -] - -[[package]] -name = "windows-targets" -version = "0.53.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4945f9f551b88e0d65f3db0bc25c33b8acea4d9e41163edf90dcd0b19f9069f3" -dependencies = [ - "windows-link", - "windows_aarch64_gnullvm 0.53.1", - "windows_aarch64_msvc 0.53.1", - "windows_i686_gnu 0.53.1", - "windows_i686_gnullvm 0.53.1", - "windows_i686_msvc 0.53.1", - "windows_x86_64_gnu 0.53.1", - "windows_x86_64_gnullvm 0.53.1", - "windows_x86_64_msvc 0.53.1", -] - -[[package]] -name = "windows_aarch64_gnullvm" -version = "0.52.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "32a4622180e7a0ec044bb555404c800bc9fd9ec262ec147edd5989ccd0c02cd3" - -[[package]] -name = "windows_aarch64_gnullvm" -version = "0.53.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a9d8416fa8b42f5c947f8482c43e7d89e73a173cead56d044f6a56104a6d1b53" - -[[package]] -name = "windows_aarch64_msvc" -version = "0.52.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "09ec2a7bb152e2252b53fa7803150007879548bc709c039df7627cabbd05d469" - -[[package]] -name = "windows_aarch64_msvc" -version = "0.53.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b9d782e804c2f632e395708e99a94275910eb9100b2114651e04744e9b125006" - -[[package]] -name = "windows_i686_gnu" -version = "0.52.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8e9b5ad5ab802e97eb8e295ac6720e509ee4c243f69d781394014ebfe8bbfa0b" - -[[package]] -name = "windows_i686_gnu" -version = "0.53.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "960e6da069d81e09becb0ca57a65220ddff016ff2d6af6a223cf372a506593a3" - -[[package]] -name = "windows_i686_gnullvm" -version = "0.52.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0eee52d38c090b3caa76c563b86c3a4bd71ef1a819287c19d586d7334ae8ed66" - -[[package]] -name = "windows_i686_gnullvm" -version = "0.53.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fa7359d10048f68ab8b09fa71c3daccfb0e9b559aed648a8f95469c27057180c" - -[[package]] -name = "windows_i686_msvc" -version = "0.52.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "240948bc05c5e7c6dabba28bf89d89ffce3e303022809e73deaefe4f6ec56c66" - -[[package]] -name = "windows_i686_msvc" -version = "0.53.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1e7ac75179f18232fe9c285163565a57ef8d3c89254a30685b57d83a38d326c2" - -[[package]] -name = "windows_x86_64_gnu" -version = "0.52.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "147a5c80aabfbf0c7d901cb5895d1de30ef2907eb21fbbab29ca94c5b08b1a78" - -[[package]] -name = "windows_x86_64_gnu" -version = "0.53.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9c3842cdd74a865a8066ab39c8a7a473c0778a3f29370b5fd6b4b9aa7df4a499" - -[[package]] -name = "windows_x86_64_gnullvm" -version = "0.52.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "24d5b23dc417412679681396f2b49f3de8c1473deb516bd34410872eff51ed0d" - -[[package]] -name = "windows_x86_64_gnullvm" -version = "0.53.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0ffa179e2d07eee8ad8f57493436566c7cc30ac536a3379fdf008f47f6bb7ae1" - -[[package]] -name = "windows_x86_64_msvc" -version = "0.52.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "589f6da84c646204747d1270a2a5661ea66ed1cced2631d546fdfb155959f9ec" - -[[package]] -name = "windows_x86_64_msvc" -version = "0.53.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d6bbff5f0aada427a1e5a6da5f1f98158182f26556f345ac9e04d36d0ebed650" - -[[package]] -name = "wit-bindgen" -version = "0.51.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d7249219f66ced02969388cf2bb044a09756a083d0fab1e566056b04d9fbcaa5" -dependencies = [ - "wit-bindgen-rust-macro", -] - -[[package]] -name = "wit-bindgen-core" -version = "0.51.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ea61de684c3ea68cb082b7a88508a8b27fcc8b797d738bfc99a82facf1d752dc" -dependencies = [ - "anyhow", - "heck", - "wit-parser", -] - -[[package]] -name = "wit-bindgen-rust" -version = "0.51.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b7c566e0f4b284dd6561c786d9cb0142da491f46a9fbed79ea69cdad5db17f21" -dependencies = [ - "anyhow", - "heck", - "indexmap", - "prettyplease", - "syn", - "wasm-metadata", - "wit-bindgen-core", - "wit-component", -] - -[[package]] -name = "wit-bindgen-rust-macro" -version = "0.51.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0c0f9bfd77e6a48eccf51359e3ae77140a7f50b1e2ebfe62422d8afdaffab17a" -dependencies = [ - "anyhow", - "prettyplease", - "proc-macro2", - "quote", - "syn", - "wit-bindgen-core", - "wit-bindgen-rust", -] - -[[package]] -name = "wit-component" -version = "0.244.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9d66ea20e9553b30172b5e831994e35fbde2d165325bec84fc43dbf6f4eb9cb2" -dependencies = [ - "anyhow", - "bitflags", - "indexmap", - "log", - "serde", - "serde_derive", - "serde_json", - "wasm-encoder", - "wasm-metadata", - "wasmparser", - "wit-parser", -] - -[[package]] -name = "wit-parser" -version = "0.244.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ecc8ac4bc1dc3381b7f59c34f00b67e18f910c2c0f50015669dde7def656a736" -dependencies = [ - "anyhow", - "id-arena", - "indexmap", - "log", - "semver", - "serde", - "serde_derive", - "serde_json", - "unicode-xid", - "wasmparser", -] - -[[package]] -name = "writeable" -version = "0.6.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9edde0db4769d2dc68579893f2306b26c6ecfbe0ef499b013d731b7b9247e0b9" - -[[package]] -name = "yoke" -version = "0.8.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "72d6e5c6afb84d73944e5cedb052c4680d5657337201555f9f2a16b7406d4954" -dependencies = [ - "stable_deref_trait", - "yoke-derive", - "zerofrom", -] - -[[package]] -name = "yoke-derive" -version = "0.8.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b659052874eb698efe5b9e8cf382204678a0086ebf46982b79d6ca3182927e5d" -dependencies = [ - "proc-macro2", - "quote", - "syn", - "synstructure", -] - -[[package]] -name = "zerocopy" -version = "0.8.39" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "db6d35d663eadb6c932438e763b262fe1a70987f9ae936e60158176d710cae4a" -dependencies = [ - "zerocopy-derive", -] - -[[package]] -name = "zerocopy-derive" -version = "0.8.39" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4122cd3169e94605190e77839c9a40d40ed048d305bfdc146e7df40ab0f3e517" -dependencies = [ - "proc-macro2", - "quote", - "syn", -] - -[[package]] -name = "zerofrom" -version = "0.1.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "50cc42e0333e05660c3587f3bf9d0478688e15d870fab3346451ce7f8c9fbea5" -dependencies = [ - "zerofrom-derive", -] - -[[package]] -name = "zerofrom-derive" -version = "0.1.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d71e5d6e06ab090c67b5e44993ec16b72dcbaabc526db883a360057678b48502" -dependencies = [ - "proc-macro2", - "quote", - "syn", - "synstructure", -] - -[[package]] -name = "zeroize" -version = "1.8.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b97154e67e32c85465826e8bcc1c59429aaaf107c1e4a9e53c8d8ccd5eff88d0" - -[[package]] -name = "zerotrie" -version = "0.2.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2a59c17a5562d507e4b54960e8569ebee33bee890c70aa3fe7b97e85a9fd7851" -dependencies = [ - "displaydoc", - "yoke", - "zerofrom", -] - -[[package]] -name = "zerovec" -version = "0.11.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6c28719294829477f525be0186d13efa9a3c602f7ec202ca9e353d310fb9a002" -dependencies = [ - "yoke", - "zerofrom", - "zerovec-derive", -] - -[[package]] -name = "zerovec-derive" -version = "0.11.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "eadce39539ca5cb3985590102671f2567e659fca9666581ad3411d59207951f3" -dependencies = [ - "proc-macro2", - "quote", - "syn", -] - -[[package]] -name = "zmij" -version = "1.0.20" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4de98dfa5d5b7fef4ee834d0073d560c9ca7b6c46a71d058c48db7960f8cfaf7" diff --git a/Cargo.toml b/Cargo.toml index 7c37b9d..3b62863 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,21 +1,6 @@ [package] name = "forgejo-openapi" -version = "14.0.2-2-84240ce3a2+gitea-1.22.0" -authors = ["OpenAPI Generator team and contributors"] -description = "This documentation describes the Forgejo API." -license = "CC0" +version = "0.1.0" edition = "2024" [dependencies] -serde = { version = "^1.0", features = ["derive"] } -serde_json = "^1.0" -serde_repr = "^0.1" -url = "^2.5" -tokio = { version = "^1.46.0", features = ["fs"] } -tokio-util = { version = "^0.7", features = ["codec"] } -reqwest = { version = "^0.12", default-features = false, features = ["json", "multipart", "stream"] } - -[features] -default = ["native-tls"] -native-tls = ["reqwest/native-tls"] -rustls-tls = ["reqwest/rustls-tls"] diff --git a/LICENSE b/LICENSE deleted file mode 100644 index 0e259d4..0000000 --- a/LICENSE +++ /dev/null @@ -1,121 +0,0 @@ -Creative Commons Legal Code - -CC0 1.0 Universal - - CREATIVE COMMONS CORPORATION IS NOT A LAW FIRM AND DOES NOT PROVIDE - LEGAL SERVICES. DISTRIBUTION OF THIS DOCUMENT DOES NOT CREATE AN - ATTORNEY-CLIENT RELATIONSHIP. CREATIVE COMMONS PROVIDES THIS - INFORMATION ON AN "AS-IS" BASIS. CREATIVE COMMONS MAKES NO WARRANTIES - REGARDING THE USE OF THIS DOCUMENT OR THE INFORMATION OR WORKS - PROVIDED HEREUNDER, AND DISCLAIMS LIABILITY FOR DAMAGES RESULTING FROM - THE USE OF THIS DOCUMENT OR THE INFORMATION OR WORKS PROVIDED - HEREUNDER. - -Statement of Purpose - -The laws of most jurisdictions throughout the world automatically confer -exclusive Copyright and Related Rights (defined below) upon the creator -and subsequent owner(s) (each and all, an "owner") of an original work of -authorship and/or a database (each, a "Work"). - -Certain owners wish to permanently relinquish those rights to a Work for -the purpose of contributing to a commons of creative, cultural and -scientific works ("Commons") that the public can reliably and without fear -of later claims of infringement build upon, modify, incorporate in other -works, reuse and redistribute as freely as possible in any form whatsoever -and for any purposes, including without limitation commercial purposes. -These owners may contribute to the Commons to promote the ideal of a free -culture and the further production of creative, cultural and scientific -works, or to gain reputation or greater distribution for their Work in -part through the use and efforts of others. - -For these and/or other purposes and motivations, and without any -expectation of additional consideration or compensation, the person -associating CC0 with a Work (the "Affirmer"), to the extent that he or she -is an owner of Copyright and Related Rights in the Work, voluntarily -elects to apply CC0 to the Work and publicly distribute the Work under its -terms, with knowledge of his or her Copyright and Related Rights in the -Work and the meaning and intended legal effect of CC0 on those rights. - -1. Copyright and Related Rights. A Work made available under CC0 may be -protected by copyright and related or neighboring rights ("Copyright and -Related Rights"). Copyright and Related Rights include, but are not -limited to, the following: - - i. the right to reproduce, adapt, distribute, perform, display, - communicate, and translate a Work; - ii. moral rights retained by the original author(s) and/or performer(s); -iii. publicity and privacy rights pertaining to a person's image or - likeness depicted in a Work; - iv. rights protecting against unfair competition in regards to a Work, - subject to the limitations in paragraph 4(a), below; - v. rights protecting the extraction, dissemination, use and reuse of data - in a Work; - vi. database rights (such as those arising under Directive 96/9/EC of the - European Parliament and of the Council of 11 March 1996 on the legal - protection of databases, and under any national implementation - thereof, including any amended or successor version of such - directive); and -vii. other similar, equivalent or corresponding rights throughout the - world based on applicable law or treaty, and any national - implementations thereof. - -2. Waiver. To the greatest extent permitted by, but not in contravention -of, applicable law, Affirmer hereby overtly, fully, permanently, -irrevocably and unconditionally waives, abandons, and surrenders all of -Affirmer's Copyright and Related Rights and associated claims and causes -of action, whether now known or unknown (including existing as well as -future claims and causes of action), in the Work (i) in all territories -worldwide, (ii) for the maximum duration provided by applicable law or -treaty (including future time extensions), (iii) in any current or future -medium and for any number of copies, and (iv) for any purpose whatsoever, -including without limitation commercial, advertising or promotional -purposes (the "Waiver"). Affirmer makes the Waiver for the benefit of each -member of the public at large and to the detriment of Affirmer's heirs and -successors, fully intending that such Waiver shall not be subject to -revocation, rescission, cancellation, termination, or any other legal or -equitable action to disrupt the quiet enjoyment of the Work by the public -as contemplated by Affirmer's express Statement of Purpose. - -3. Public License Fallback. Should any part of the Waiver for any reason -be judged legally invalid or ineffective under applicable law, then the -Waiver shall be preserved to the maximum extent permitted taking into -account Affirmer's express Statement of Purpose. In addition, to the -extent the Waiver is so judged Affirmer hereby grants to each affected -person a royalty-free, non transferable, non sublicensable, non exclusive, -irrevocable and unconditional license to exercise Affirmer's Copyright and -Related Rights in the Work (i) in all territories worldwide, (ii) for the -maximum duration provided by applicable law or treaty (including future -time extensions), (iii) in any current or future medium and for any number -of copies, and (iv) for any purpose whatsoever, including without -limitation commercial, advertising or promotional purposes (the -"License"). The License shall be deemed effective as of the date CC0 was -applied by Affirmer to the Work. Should any part of the License for any -reason be judged legally invalid or ineffective under applicable law, such -partial invalidity or ineffectiveness shall not invalidate the remainder -of the License, and in such case Affirmer hereby affirms that he or she -will not (i) exercise any of his or her remaining Copyright and Related -Rights in the Work or (ii) assert any associated claims and causes of -action with respect to the Work, in either case contrary to Affirmer's -express Statement of Purpose. - -4. Limitations and Disclaimers. - - a. No trademark or patent rights held by Affirmer are waived, abandoned, - surrendered, licensed or otherwise affected by this document. - b. Affirmer offers the Work as-is and makes no representations or - warranties of any kind concerning the Work, express, implied, - statutory or otherwise, including without limitation warranties of - title, merchantability, fitness for a particular purpose, non - infringement, or the absence of latent or other defects, accuracy, or - the present or absence of errors, whether or not discoverable, all to - the greatest extent permissible under applicable law. - c. Affirmer disclaims responsibility for clearing rights of other persons - that may apply to the Work or any use thereof, including without - limitation any person's Copyright and Related Rights in the Work. - Further, Affirmer disclaims responsibility for obtaining any necessary - consents, permissions or other rights required for any use of the - Work. - d. Affirmer understands and acknowledges that Creative Commons is not a - party to this document and has no duty or obligation with respect to - this CC0 or use of the Work. diff --git a/OPENAPI_GENERATOR.md b/OPENAPI_GENERATOR.md deleted file mode 100644 index 1957b78..0000000 --- a/OPENAPI_GENERATOR.md +++ /dev/null @@ -1,741 +0,0 @@ -# Rust API client for openapi - -This documentation describes the Forgejo 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: 14.0.2-2-84240ce3a2+gitea-1.22.0 -- Package version: 14.0.2-2-84240ce3a2+gitea-1.22.0 -- Generator version: 7.19.0 -- Build package: `org.openapitools.codegen.languages.RustClientCodegen` - -## Installation - -Put the package under your project folder in a directory named `openapi` and add the following to `Cargo.toml` under `[dependencies]`: - -``` -openapi = { path = "./openapi" } -``` - -## Documentation for API Endpoints - -All URIs are relative to */api/v1* - -Class | Method | HTTP request | Description ------------- | ------------- | ------------- | ------------- -*ActivitypubApi* | [**activitypub_instance_actor**](docs/ActivitypubApi.md#activitypub_instance_actor) | **GET** /activitypub/actor | Returns the instance's Actor -*ActivitypubApi* | [**activitypub_instance_actor_inbox**](docs/ActivitypubApi.md#activitypub_instance_actor_inbox) | **POST** /activitypub/actor/inbox | Send to the inbox -*ActivitypubApi* | [**activitypub_instance_actor_outbox**](docs/ActivitypubApi.md#activitypub_instance_actor_outbox) | **POST** /activitypub/actor/outbox | Display the outbox (always empty) -*ActivitypubApi* | [**activitypub_person**](docs/ActivitypubApi.md#activitypub_person) | **GET** /activitypub/user-id/{user_id} | Returns the Person actor for a user -*ActivitypubApi* | [**activitypub_person_activity**](docs/ActivitypubApi.md#activitypub_person_activity) | **GET** /activitypub/user-id/{user_id}/activities/{activity_id}/activity | Get a specific activity of the user -*ActivitypubApi* | [**activitypub_person_activity_note**](docs/ActivitypubApi.md#activitypub_person_activity_note) | **GET** /activitypub/user-id/{user_id}/activities/{activity_id} | Get a specific activity object of the user -*ActivitypubApi* | [**activitypub_person_feed**](docs/ActivitypubApi.md#activitypub_person_feed) | **GET** /activitypub/user-id/{user_id}/outbox | List the user's recorded activity -*ActivitypubApi* | [**activitypub_person_inbox**](docs/ActivitypubApi.md#activitypub_person_inbox) | **POST** /activitypub/user-id/{user_id}/inbox | Send to the inbox -*ActivitypubApi* | [**activitypub_repository**](docs/ActivitypubApi.md#activitypub_repository) | **GET** /activitypub/repository-id/{repository_id} | Returns the Repository actor for a repo -*ActivitypubApi* | [**activitypub_repository_inbox**](docs/ActivitypubApi.md#activitypub_repository_inbox) | **POST** /activitypub/repository-id/{repository_id}/inbox | Send to the inbox -*ActivitypubApi* | [**activitypub_repository_outbox**](docs/ActivitypubApi.md#activitypub_repository_outbox) | **POST** /activitypub/repository-id/{repository_id}/outbox | Display the outbox -*AdminApi* | [**admin_add_rule_to_quota_group**](docs/AdminApi.md#admin_add_rule_to_quota_group) | **PUT** /admin/quota/groups/{quotagroup}/rules/{quotarule} | Adds a rule to a quota group -*AdminApi* | [**admin_add_user_to_quota_group**](docs/AdminApi.md#admin_add_user_to_quota_group) | **PUT** /admin/quota/groups/{quotagroup}/users/{username} | Add a user to a quota group -*AdminApi* | [**admin_adopt_repository**](docs/AdminApi.md#admin_adopt_repository) | **POST** /admin/unadopted/{owner}/{repo} | Adopt unadopted files as a repository -*AdminApi* | [**admin_create_hook**](docs/AdminApi.md#admin_create_hook) | **POST** /admin/hooks | Create a hook -*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 an SSH public key to user's account -*AdminApi* | [**admin_create_quota_group**](docs/AdminApi.md#admin_create_quota_group) | **POST** /admin/quota/groups | Create a new quota group -*AdminApi* | [**admin_create_quota_rule**](docs/AdminApi.md#admin_create_quota_rule) | **POST** /admin/quota/rules | Create a new quota rule -*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 account -*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_hook**](docs/AdminApi.md#admin_delete_hook) | **DELETE** /admin/hooks/{id} | Delete a hook -*AdminApi* | [**admin_delete_quota_group**](docs/AdminApi.md#admin_delete_quota_group) | **DELETE** /admin/quota/groups/{quotagroup} | Delete a quota group -*AdminApi* | [**admin_delete_quota_rule**](docs/AdminApi.md#admin_delete_quota_rule) | **DELETE** /admin/quota/rules/{quotarule} | Deletes a quota rule -*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 user account -*AdminApi* | [**admin_delete_user_emails**](docs/AdminApi.md#admin_delete_user_emails) | **DELETE** /admin/users/{username}/emails | Delete email addresses from a user's account -*AdminApi* | [**admin_delete_user_public_key**](docs/AdminApi.md#admin_delete_user_public_key) | **DELETE** /admin/users/{username}/keys/{id} | Remove a public key from user's account -*AdminApi* | [**admin_edit_hook**](docs/AdminApi.md#admin_edit_hook) | **PATCH** /admin/hooks/{id} | Update a hook -*AdminApi* | [**admin_edit_quota_rule**](docs/AdminApi.md#admin_edit_quota_rule) | **PATCH** /admin/quota/rules/{quotarule} | Change an existing quota rule -*AdminApi* | [**admin_edit_user**](docs/AdminApi.md#admin_edit_user) | **PATCH** /admin/users/{username} | Edit an existing user -*AdminApi* | [**admin_get_all_emails**](docs/AdminApi.md#admin_get_all_emails) | **GET** /admin/emails | List all users' email addresses -*AdminApi* | [**admin_get_all_orgs**](docs/AdminApi.md#admin_get_all_orgs) | **GET** /admin/orgs | List all organizations -*AdminApi* | [**admin_get_hook**](docs/AdminApi.md#admin_get_hook) | **GET** /admin/hooks/{id} | Get a hook -*AdminApi* | [**admin_get_quota_group**](docs/AdminApi.md#admin_get_quota_group) | **GET** /admin/quota/groups/{quotagroup} | Get information about the quota group -*AdminApi* | [**admin_get_quota_rule**](docs/AdminApi.md#admin_get_quota_rule) | **GET** /admin/quota/rules/{quotarule} | Get information about a quota rule -*AdminApi* | [**admin_get_runner_registration_token**](docs/AdminApi.md#admin_get_runner_registration_token) | **GET** /admin/runners/registration-token | Get an global actions runner registration token -*AdminApi* | [**admin_get_user_quota**](docs/AdminApi.md#admin_get_user_quota) | **GET** /admin/users/{username}/quota | Get the user's quota info -*AdminApi* | [**admin_list_hooks**](docs/AdminApi.md#admin_list_hooks) | **GET** /admin/hooks | List global (system) webhooks -*AdminApi* | [**admin_list_quota_groups**](docs/AdminApi.md#admin_list_quota_groups) | **GET** /admin/quota/groups | List the available quota groups -*AdminApi* | [**admin_list_quota_rules**](docs/AdminApi.md#admin_list_quota_rules) | **GET** /admin/quota/rules | List the available quota rules -*AdminApi* | [**admin_list_user_emails**](docs/AdminApi.md#admin_list_user_emails) | **GET** /admin/users/{username}/emails | List all email addresses for a user -*AdminApi* | [**admin_list_users_in_quota_group**](docs/AdminApi.md#admin_list_users_in_quota_group) | **GET** /admin/quota/groups/{quotagroup}/users | List users in a quota group -*AdminApi* | [**admin_remove_rule_from_quota_group**](docs/AdminApi.md#admin_remove_rule_from_quota_group) | **DELETE** /admin/quota/groups/{quotagroup}/rules/{quotarule} | Removes a rule from a quota group -*AdminApi* | [**admin_remove_user_from_quota_group**](docs/AdminApi.md#admin_remove_user_from_quota_group) | **DELETE** /admin/quota/groups/{quotagroup}/users/{username} | Remove a user from a quota group -*AdminApi* | [**admin_rename_user**](docs/AdminApi.md#admin_rename_user) | **POST** /admin/users/{username}/rename | Rename a user -*AdminApi* | [**admin_search_emails**](docs/AdminApi.md#admin_search_emails) | **GET** /admin/emails/search | Search users' email addresses -*AdminApi* | [**admin_search_run_jobs**](docs/AdminApi.md#admin_search_run_jobs) | **GET** /admin/runners/jobs | Search action jobs according filter conditions -*AdminApi* | [**admin_search_users**](docs/AdminApi.md#admin_search_users) | **GET** /admin/users | Search users according filter conditions -*AdminApi* | [**admin_set_user_quota_groups**](docs/AdminApi.md#admin_set_user_quota_groups) | **POST** /admin/users/{username}/quota/groups | Set the user's quota groups to a given list. -*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_issue_attachment**](docs/IssueApi.md#issue_create_issue_attachment) | **POST** /repos/{owner}/{repo}/issues/{index}/assets | Create an issue attachment -*IssueApi* | [**issue_create_issue_blocking**](docs/IssueApi.md#issue_create_issue_blocking) | **POST** /repos/{owner}/{repo}/issues/{index}/blocks | Block the issue given in the body by the issue in path -*IssueApi* | [**issue_create_issue_comment_attachment**](docs/IssueApi.md#issue_create_issue_comment_attachment) | **POST** /repos/{owner}/{repo}/issues/comments/{id}/assets | Create a comment attachment -*IssueApi* | [**issue_create_issue_dependencies**](docs/IssueApi.md#issue_create_issue_dependencies) | **POST** /repos/{owner}/{repo}/issues/{index}/dependencies | Make the issue in the url depend on the issue in the form. -*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_attachment**](docs/IssueApi.md#issue_delete_issue_attachment) | **DELETE** /repos/{owner}/{repo}/issues/{index}/assets/{attachment_id} | Delete an issue attachment -*IssueApi* | [**issue_delete_issue_comment_attachment**](docs/IssueApi.md#issue_delete_issue_comment_attachment) | **DELETE** /repos/{owner}/{repo}/issues/comments/{id}/assets/{attachment_id} | Delete a comment attachment -*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_attachment**](docs/IssueApi.md#issue_edit_issue_attachment) | **PATCH** /repos/{owner}/{repo}/issues/{index}/assets/{attachment_id} | Edit an issue attachment -*IssueApi* | [**issue_edit_issue_comment_attachment**](docs/IssueApi.md#issue_edit_issue_comment_attachment) | **PATCH** /repos/{owner}/{repo}/issues/comments/{id}/assets/{attachment_id} | Edit a comment attachment -*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_attachment**](docs/IssueApi.md#issue_get_issue_attachment) | **GET** /repos/{owner}/{repo}/issues/{index}/assets/{attachment_id} | Get an issue attachment -*IssueApi* | [**issue_get_issue_comment_attachment**](docs/IssueApi.md#issue_get_issue_comment_attachment) | **GET** /repos/{owner}/{repo}/issues/comments/{id}/assets/{attachment_id} | Get a comment attachment -*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_blocks**](docs/IssueApi.md#issue_list_blocks) | **GET** /repos/{owner}/{repo}/issues/{index}/blocks | List issues that are blocked by this issue -*IssueApi* | [**issue_list_issue_attachments**](docs/IssueApi.md#issue_list_issue_attachments) | **GET** /repos/{owner}/{repo}/issues/{index}/assets | List issue's attachments -*IssueApi* | [**issue_list_issue_comment_attachments**](docs/IssueApi.md#issue_list_issue_comment_attachments) | **GET** /repos/{owner}/{repo}/issues/comments/{id}/assets | List comment's attachments -*IssueApi* | [**issue_list_issue_dependencies**](docs/IssueApi.md#issue_list_issue_dependencies) | **GET** /repos/{owner}/{repo}/issues/{index}/dependencies | List an issue's dependencies, i.e all issues that block this issue. -*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_issue_blocking**](docs/IssueApi.md#issue_remove_issue_blocking) | **DELETE** /repos/{owner}/{repo}/issues/{index}/blocks | Unblock the issue given in the body by the issue in path -*IssueApi* | [**issue_remove_issue_dependencies**](docs/IssueApi.md#issue_remove_issue_dependencies) | **DELETE** /repos/{owner}/{repo}/issues/{index}/dependencies | Remove an issue dependency -*IssueApi* | [**issue_remove_label**](docs/IssueApi.md#issue_remove_label) | **DELETE** /repos/{owner}/{repo}/issues/{index}/labels/{identifier} | 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 -*IssueApi* | [**move_issue_pin**](docs/IssueApi.md#move_issue_pin) | **PATCH** /repos/{owner}/{repo}/issues/{index}/pin/{position} | Moves the Pin to the given Position -*IssueApi* | [**pin_issue**](docs/IssueApi.md#pin_issue) | **POST** /repos/{owner}/{repo}/issues/{index}/pin | Pin an Issue -*IssueApi* | [**unpin_issue**](docs/IssueApi.md#unpin_issue) | **DELETE** /repos/{owner}/{repo}/issues/{index}/pin | Unpin an Issue -*MiscellaneousApi* | [**get_gitignore_template_info**](docs/MiscellaneousApi.md#get_gitignore_template_info) | **GET** /gitignore/templates/{name} | Returns information about a gitignore template -*MiscellaneousApi* | [**get_label_template_info**](docs/MiscellaneousApi.md#get_label_template_info) | **GET** /label/templates/{name} | Returns all labels in a template -*MiscellaneousApi* | [**get_license_template_info**](docs/MiscellaneousApi.md#get_license_template_info) | **GET** /licenses/{name} | Returns information about a license template -*MiscellaneousApi* | [**get_node_info**](docs/MiscellaneousApi.md#get_node_info) | **GET** /nodeinfo | Returns the nodeinfo of the Forgejo application -*MiscellaneousApi* | [**get_signing_key**](docs/MiscellaneousApi.md#get_signing_key) | **GET** /signing-key.gpg | Get default signing-key.gpg -*MiscellaneousApi* | [**get_ssh_signing_key**](docs/MiscellaneousApi.md#get_ssh_signing_key) | **GET** /signing-key.ssh | Get default signing-key.ssh -*MiscellaneousApi* | [**get_version**](docs/MiscellaneousApi.md#get_version) | **GET** /version | Returns the version of the running application -*MiscellaneousApi* | [**list_gitignores_templates**](docs/MiscellaneousApi.md#list_gitignores_templates) | **GET** /gitignore/templates | Returns a list of all gitignore templates -*MiscellaneousApi* | [**list_label_templates**](docs/MiscellaneousApi.md#list_label_templates) | **GET** /label/templates | Returns a list of all label templates -*MiscellaneousApi* | [**list_license_templates**](docs/MiscellaneousApi.md#list_license_templates) | **GET** /licenses | Returns a list of all license templates -*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 -*MiscellaneousApi* | [**render_markup**](docs/MiscellaneousApi.md#render_markup) | **POST** /markup | Render a markup document 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* | [**create_org_variable**](docs/OrganizationApi.md#create_org_variable) | **POST** /orgs/{org}/actions/variables/{variablename} | Create a new variable in organization -*OrganizationApi* | [**delete_org_secret**](docs/OrganizationApi.md#delete_org_secret) | **DELETE** /orgs/{org}/actions/secrets/{secretname} | Delete a secret in an organization -*OrganizationApi* | [**delete_org_variable**](docs/OrganizationApi.md#delete_org_variable) | **DELETE** /orgs/{org}/actions/variables/{variablename} | Delete organization's variable by name -*OrganizationApi* | [**get_org_variable**](docs/OrganizationApi.md#get_org_variable) | **GET** /orgs/{org}/actions/variables/{variablename} | Get organization's variable by name -*OrganizationApi* | [**get_org_variables_list**](docs/OrganizationApi.md#get_org_variables_list) | **GET** /orgs/{org}/actions/variables | List variables of 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_block_user**](docs/OrganizationApi.md#org_block_user) | **PUT** /orgs/{org}/block/{username} | Blocks a user from the organization -*OrganizationApi* | [**org_check_quota**](docs/OrganizationApi.md#org_check_quota) | **GET** /orgs/{org}/quota/check | Check if the organization is over quota for a given subject -*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_avatar**](docs/OrganizationApi.md#org_delete_avatar) | **DELETE** /orgs/{org}/avatar | Delete an organization's avatar. It will be replaced by a default one -*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 | List all 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_quota**](docs/OrganizationApi.md#org_get_quota) | **GET** /orgs/{org}/quota | Get quota information for an organization -*OrganizationApi* | [**org_get_runner_registration_token**](docs/OrganizationApi.md#org_get_runner_registration_token) | **GET** /orgs/{org}/actions/runners/registration-token | Get an organization's actions runner registration token -*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_actions_secrets**](docs/OrganizationApi.md#org_list_actions_secrets) | **GET** /orgs/{org}/actions/secrets | List actions secrets of an organization -*OrganizationApi* | [**org_list_activity_feeds**](docs/OrganizationApi.md#org_list_activity_feeds) | **GET** /orgs/{org}/activities/feeds | List an organization's activity feeds -*OrganizationApi* | [**org_list_blocked_users**](docs/OrganizationApi.md#org_list_blocked_users) | **GET** /orgs/{org}/list_blocked | List the organization's blocked users -*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_quota_artifacts**](docs/OrganizationApi.md#org_list_quota_artifacts) | **GET** /orgs/{org}/quota/artifacts | List the artifacts affecting the organization's quota -*OrganizationApi* | [**org_list_quota_attachments**](docs/OrganizationApi.md#org_list_quota_attachments) | **GET** /orgs/{org}/quota/attachments | List the attachments affecting the organization's quota -*OrganizationApi* | [**org_list_quota_packages**](docs/OrganizationApi.md#org_list_quota_packages) | **GET** /orgs/{org}/quota/packages | List the packages affecting the organization's quota -*OrganizationApi* | [**org_list_repos**](docs/OrganizationApi.md#org_list_repos) | **GET** /orgs/{org}/repos | List an organization's repos -*OrganizationApi* | [**org_list_team_activity_feeds**](docs/OrganizationApi.md#org_list_team_activity_feeds) | **GET** /teams/{id}/activities/feeds | List a team's activity feeds -*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* | [**org_search_run_jobs**](docs/OrganizationApi.md#org_search_run_jobs) | **GET** /orgs/{org}/actions/runners/jobs | Search for organization's action jobs according filter conditions -*OrganizationApi* | [**org_unblock_user**](docs/OrganizationApi.md#org_unblock_user) | **PUT** /orgs/{org}/unblock/{username} | Unblock a user from the organization -*OrganizationApi* | [**org_update_avatar**](docs/OrganizationApi.md#org_update_avatar) | **POST** /orgs/{org}/avatar | Update an organization's avatar -*OrganizationApi* | [**rename_org**](docs/OrganizationApi.md#rename_org) | **POST** /orgs/{org}/rename | Rename an organization -*OrganizationApi* | [**team_search**](docs/OrganizationApi.md#team_search) | **GET** /orgs/{org}/teams/search | Search for teams within an organization -*OrganizationApi* | [**update_org_secret**](docs/OrganizationApi.md#update_org_secret) | **PUT** /orgs/{org}/actions/secrets/{secretname} | Create or Update a secret value in an organization -*OrganizationApi* | [**update_org_variable**](docs/OrganizationApi.md#update_org_variable) | **PUT** /orgs/{org}/actions/variables/{variablename} | Update variable in 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* | [**link_package**](docs/PackageApi.md#link_package) | **POST** /packages/{owner}/{type}/{name}/-/link/{repo_name} | Link a package to a repository -*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 -*PackageApi* | [**unlink_package**](docs/PackageApi.md#unlink_package) | **POST** /packages/{owner}/{type}/{name}/-/unlink | Unlink a package from a repository -*RepositoryApi* | [**accept_repo_transfer**](docs/RepositoryApi.md#accept_repo_transfer) | **POST** /repos/{owner}/{repo}/transfer/accept | Accept a repo transfer -*RepositoryApi* | [**action_run**](docs/RepositoryApi.md#action_run) | **GET** /repos/{owner}/{repo}/actions/runs/{run_id} | Get an action run -*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* | [**create_repo_variable**](docs/RepositoryApi.md#create_repo_variable) | **POST** /repos/{owner}/{repo}/actions/variables/{variablename} | Create a repo-level variable -*RepositoryApi* | [**delete_repo_secret**](docs/RepositoryApi.md#delete_repo_secret) | **DELETE** /repos/{owner}/{repo}/actions/secrets/{secretname} | Delete a secret in a repository -*RepositoryApi* | [**delete_repo_variable**](docs/RepositoryApi.md#delete_repo_variable) | **DELETE** /repos/{owner}/{repo}/actions/variables/{variablename} | Delete a repo-level variable -*RepositoryApi* | [**dispatch_workflow**](docs/RepositoryApi.md#dispatch_workflow) | **POST** /repos/{owner}/{repo}/actions/workflows/{workflowfilename}/dispatches | Dispatches a workflow -*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_blobs**](docs/RepositoryApi.md#get_blobs) | **GET** /repos/{owner}/{repo}/git/blobs | Gets multiple blobs of a repository. -*RepositoryApi* | [**get_repo_variable**](docs/RepositoryApi.md#get_repo_variable) | **GET** /repos/{owner}/{repo}/actions/variables/{variablename} | Get a repo-level variable -*RepositoryApi* | [**get_repo_variables_list**](docs/RepositoryApi.md#get_repo_variables_list) | **GET** /repos/{owner}/{repo}/actions/variables | Get repo-level variables list -*RepositoryApi* | [**get_tree**](docs/RepositoryApi.md#get_tree) | **GET** /repos/{owner}/{repo}/git/trees/{sha} | Gets the tree of a repository. -*RepositoryApi* | [**list_action_runs**](docs/RepositoryApi.md#list_action_runs) | **GET** /repos/{owner}/{repo}/actions/runs | List a repository's action runs -*RepositoryApi* | [**list_action_tasks**](docs/RepositoryApi.md#list_action_tasks) | **GET** /repos/{owner}/{repo}/actions/tasks | List a repository's action tasks -*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_flag**](docs/RepositoryApi.md#repo_add_flag) | **PUT** /repos/{owner}/{repo}/flags/{flag} | Add a flag to a repository -*RepositoryApi* | [**repo_add_push_mirror**](docs/RepositoryApi.md#repo_add_push_mirror) | **POST** /repos/{owner}/{repo}/push_mirrors | Set up a new push mirror in 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_change_files**](docs/RepositoryApi.md#repo_change_files) | **POST** /repos/{owner}/{repo}/contents | Modify multiple files in a repository -*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_flag**](docs/RepositoryApi.md#repo_check_flag) | **GET** /repos/{owner}/{repo}/flags/{flag} | Check if a repository has a given flag -*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_compare_diff**](docs/RepositoryApi.md#repo_compare_diff) | **GET** /repos/{owner}/{repo}/compare/{basehead} | Get commit comparison information -*RepositoryApi* | [**repo_convert**](docs/RepositoryApi.md#repo_convert) | **POST** /repos/{owner}/{repo}/convert | Convert a mirror repo to a normal repo. -*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_comment**](docs/RepositoryApi.md#repo_create_pull_review_comment) | **POST** /repos/{owner}/{repo}/pulls/{index}/reviews/{id}/comments | Add a new comment to a pull request review -*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_tag_protection**](docs/RepositoryApi.md#repo_create_tag_protection) | **POST** /repos/{owner}/{repo}/tag_protections | Create a tag protections for 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_all_flags**](docs/RepositoryApi.md#repo_delete_all_flags) | **DELETE** /repos/{owner}/{repo}/flags | Remove all flags from a repository -*RepositoryApi* | [**repo_delete_avatar**](docs/RepositoryApi.md#repo_delete_avatar) | **DELETE** /repos/{owner}/{repo}/avatar | Delete a repository's avatar -*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_flag**](docs/RepositoryApi.md#repo_delete_flag) | **DELETE** /repos/{owner}/{repo}/flags/{flag} | Remove a flag from 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_comment**](docs/RepositoryApi.md#repo_delete_pull_review_comment) | **DELETE** /repos/{owner}/{repo}/pulls/{index}/reviews/{id}/comments/{comment} | Delete a pull review comment -*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_push_mirror**](docs/RepositoryApi.md#repo_delete_push_mirror) | **DELETE** /repos/{owner}/{repo}/push_mirrors/{name} | Remove a push mirror from a repository by remoteName -*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_tag_protection**](docs/RepositoryApi.md#repo_delete_tag_protection) | **DELETE** /repos/{owner}/{repo}/tag_protections/{id} | Delete a specific tag protection for the repository -*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_tag_protection**](docs/RepositoryApi.md#repo_edit_tag_protection) | **PATCH** /repos/{owner}/{repo}/tag_protections/{id} | Edit a tag protections for a repository. Only fields that are set will be changed -*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_commit_pull_request**](docs/RepositoryApi.md#repo_get_commit_pull_request) | **GET** /repos/{owner}/{repo}/commits/{sha}/pull | Get the pull request of the commit -*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_config**](docs/RepositoryApi.md#repo_get_issue_config) | **GET** /repos/{owner}/{repo}/issue_config | Returns the issue config for a repo -*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_latest_release**](docs/RepositoryApi.md#repo_get_latest_release) | **GET** /repos/{owner}/{repo}/releases/latest | Gets the most recent non-prerelease, non-draft release of a repository, sorted by created_at -*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_by_base_head**](docs/RepositoryApi.md#repo_get_pull_request_by_base_head) | **GET** /repos/{owner}/{repo}/pulls/{base}/{head} | Get a pull request by base and head -*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_request_files**](docs/RepositoryApi.md#repo_get_pull_request_files) | **GET** /repos/{owner}/{repo}/pulls/{index}/files | Get changed files 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_comment**](docs/RepositoryApi.md#repo_get_pull_review_comment) | **GET** /repos/{owner}/{repo}/pulls/{index}/reviews/{id}/comments/{comment} | Get a pull review comment -*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_push_mirror_by_remote_name**](docs/RepositoryApi.md#repo_get_push_mirror_by_remote_name) | **GET** /repos/{owner}/{repo}/push_mirrors/{name} | Get push mirror of the repository by remoteName -*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_runner_registration_token**](docs/RepositoryApi.md#repo_get_runner_registration_token) | **GET** /repos/{owner}/{repo}/actions/runners/registration-token | Get a repository's actions runner registration token -*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_tag_protection**](docs/RepositoryApi.md#repo_get_tag_protection) | **GET** /repos/{owner}/{repo}/tag_protections/{id} | Get a specific tag protection for the repository -*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_actions_secrets**](docs/RepositoryApi.md#repo_list_actions_secrets) | **GET** /repos/{owner}/{repo}/actions/secrets | List an repo's actions secrets -*RepositoryApi* | [**repo_list_activity_feeds**](docs/RepositoryApi.md#repo_list_activity_feeds) | **GET** /repos/{owner}/{repo}/activities/feeds | List a repository's activity feeds -*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_flags**](docs/RepositoryApi.md#repo_list_flags) | **GET** /repos/{owner}/{repo}/flags | List a repository's flags -*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_pinned_issues**](docs/RepositoryApi.md#repo_list_pinned_issues) | **GET** /repos/{owner}/{repo}/issues/pinned | List a repo's pinned issues -*RepositoryApi* | [**repo_list_pinned_pull_requests**](docs/RepositoryApi.md#repo_list_pinned_pull_requests) | **GET** /repos/{owner}/{repo}/pulls/pinned | List a repo's pinned pull requests -*RepositoryApi* | [**repo_list_pull_requests**](docs/RepositoryApi.md#repo_list_pull_requests) | **GET** /repos/{owner}/{repo}/pulls | List a repo's pull requests. If a pull request is selected but fails to be retrieved for any reason, it will be a null value in the list of results. -*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_push_mirrors**](docs/RepositoryApi.md#repo_list_push_mirrors) | **GET** /repos/{owner}/{repo}/push_mirrors | Get all push mirrors of the repository -*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_tag_protection**](docs/RepositoryApi.md#repo_list_tag_protection) | **GET** /repos/{owner}/{repo}/tag_protections | List tag protections for a repository -*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_new_pin_allowed**](docs/RepositoryApi.md#repo_new_pin_allowed) | **GET** /repos/{owner}/{repo}/new_pin_allowed | Returns if new Issue Pins are allowed -*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_push_mirror_sync**](docs/RepositoryApi.md#repo_push_mirror_sync) | **POST** /repos/{owner}/{repo}/push_mirrors-sync | Sync all push mirrored repository -*RepositoryApi* | [**repo_remove_note**](docs/RepositoryApi.md#repo_remove_note) | **DELETE** /repos/{owner}/{repo}/git/notes/{sha} | Removes a note corresponding to a single commit from a repository -*RepositoryApi* | [**repo_replace_all_flags**](docs/RepositoryApi.md#repo_replace_all_flags) | **PUT** /repos/{owner}/{repo}/flags | Replace all flags of a repository -*RepositoryApi* | [**repo_search**](docs/RepositoryApi.md#repo_search) | **GET** /repos/search | Search for repositories -*RepositoryApi* | [**repo_search_run_jobs**](docs/RepositoryApi.md#repo_search_run_jobs) | **GET** /repos/{owner}/{repo}/actions/runners/jobs | Search for repository's action jobs according filter conditions -*RepositoryApi* | [**repo_set_note**](docs/RepositoryApi.md#repo_set_note) | **POST** /repos/{owner}/{repo}/git/notes/{sha} | Set a note corresponding to a single commit from a repository -*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_sync_fork_branch**](docs/RepositoryApi.md#repo_sync_fork_branch) | **POST** /repos/{owner}/{repo}/sync_fork/{branch} | Syncs a fork branch with the base branch -*RepositoryApi* | [**repo_sync_fork_branch_info**](docs/RepositoryApi.md#repo_sync_fork_branch_info) | **GET** /repos/{owner}/{repo}/sync_fork/{branch} | Gets information about syncing a fork branch with the base branch -*RepositoryApi* | [**repo_sync_fork_default**](docs/RepositoryApi.md#repo_sync_fork_default) | **POST** /repos/{owner}/{repo}/sync_fork | Syncs the default branch of a fork with the base branch -*RepositoryApi* | [**repo_sync_fork_default_info**](docs/RepositoryApi.md#repo_sync_fork_default_info) | **GET** /repos/{owner}/{repo}/sync_fork | Gets information about syncing the fork default branch with the base branch -*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_avatar**](docs/RepositoryApi.md#repo_update_avatar) | **POST** /repos/{owner}/{repo}/avatar | Update a repository's avatar -*RepositoryApi* | [**repo_update_branch**](docs/RepositoryApi.md#repo_update_branch) | **PATCH** /repos/{owner}/{repo}/branches/{branch} | Update a branch -*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* | [**repo_validate_issue_config**](docs/RepositoryApi.md#repo_validate_issue_config) | **GET** /repos/{owner}/{repo}/issue_config/validate | Returns the validation information for a issue config -*RepositoryApi* | [**topic_search**](docs/RepositoryApi.md#topic_search) | **GET** /topics/search | Search for topics by keyword -*RepositoryApi* | [**update_repo_secret**](docs/RepositoryApi.md#update_repo_secret) | **PUT** /repos/{owner}/{repo}/actions/secrets/{secretname} | Create or Update a secret value in a repository -*RepositoryApi* | [**update_repo_variable**](docs/RepositoryApi.md#update_repo_variable) | **PUT** /repos/{owner}/{repo}/actions/variables/{variablename} | Update a repo-level variable -*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* | [**create_user_variable**](docs/UserApi.md#create_user_variable) | **POST** /user/actions/variables/{variablename} | Create a user-level variable -*UserApi* | [**delete_user_secret**](docs/UserApi.md#delete_user_secret) | **DELETE** /user/actions/secrets/{secretname} | Delete a secret in a user scope -*UserApi* | [**delete_user_variable**](docs/UserApi.md#delete_user_variable) | **DELETE** /user/actions/variables/{variablename} | Delete a user-level variable which is created by current doer -*UserApi* | [**get_user_settings**](docs/UserApi.md#get_user_settings) | **GET** /user/settings | Get current user's account settings -*UserApi* | [**get_user_variable**](docs/UserApi.md#get_user_variable) | **GET** /user/actions/variables/{variablename} | Get a user-level variable which is created by current doer -*UserApi* | [**get_user_variables_list**](docs/UserApi.md#get_user_variables_list) | **GET** /user/actions/variables | Get the user-level list of variables which is created by current doer -*UserApi* | [**get_verification_token**](docs/UserApi.md#get_verification_token) | **GET** /user/gpg_key_token | Get a Token to verify -*UserApi* | [**update_user_secret**](docs/UserApi.md#update_user_secret) | **PUT** /user/actions/secrets/{secretname} | Create or Update a secret value in a user scope -*UserApi* | [**update_user_settings**](docs/UserApi.md#update_user_settings) | **PATCH** /user/settings | Update settings in current user's account -*UserApi* | [**update_user_variable**](docs/UserApi.md#update_user_variable) | **PUT** /user/actions/variables/{variablename} | Update a user-level variable which is created by current doer -*UserApi* | [**user_add_email**](docs/UserApi.md#user_add_email) | **POST** /user/emails | Add an email addresses to the current user's account -*UserApi* | [**user_block_user**](docs/UserApi.md#user_block_user) | **PUT** /user/block/{username} | Blocks a user from the doer -*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_check_quota**](docs/UserApi.md#user_check_quota) | **GET** /user/quota/check | Check if the authenticated user is over quota for a given subject -*UserApi* | [**user_create_hook**](docs/UserApi.md#user_create_hook) | **POST** /user/hooks | Create a hook -*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 | Generate an access token for the specified user -*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 public key from current user's account -*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 | Add a GPG public key to current user's account -*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 from the specified user's account -*UserApi* | [**user_delete_avatar**](docs/UserApi.md#user_delete_avatar) | **DELETE** /user/avatar | Delete avatar of the current user. It will be replaced by a default one -*UserApi* | [**user_delete_email**](docs/UserApi.md#user_delete_email) | **DELETE** /user/emails | Delete email addresses from the current user's account -*UserApi* | [**user_delete_hook**](docs/UserApi.md#user_delete_hook) | **DELETE** /user/hooks/{id} | Delete a hook -*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_edit_hook**](docs/UserApi.md#user_edit_hook) | **PATCH** /user/hooks/{id} | Update a hook -*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_hook**](docs/UserApi.md#user_get_hook) | **GET** /user/hooks/{id} | Get a hook -*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_o_auth2_applications**](docs/UserApi.md#user_get_o_auth2_applications) | **GET** /user/applications/oauth2 | List the authenticated user's oauth2 applications -*UserApi* | [**user_get_quota**](docs/UserApi.md#user_get_quota) | **GET** /user/quota | Get quota information for the authenticated user -*UserApi* | [**user_get_runner_registration_token**](docs/UserApi.md#user_get_runner_registration_token) | **GET** /user/actions/runners/registration-token | Get an user's actions runner registration token -*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 specified user's access tokens -*UserApi* | [**user_list_activity_feeds**](docs/UserApi.md#user_list_activity_feeds) | **GET** /users/{username}/activities/feeds | List a user's activity feeds -*UserApi* | [**user_list_blocked_users**](docs/UserApi.md#user_list_blocked_users) | **GET** /user/list_blocked | List the authenticated user's blocked users -*UserApi* | [**user_list_emails**](docs/UserApi.md#user_list_emails) | **GET** /user/emails | List all email addresses of the current user -*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_hooks**](docs/UserApi.md#user_list_hooks) | **GET** /user/hooks | List the authenticated user's webhooks -*UserApi* | [**user_list_keys**](docs/UserApi.md#user_list_keys) | **GET** /users/{username}/keys | List the given user's public keys -*UserApi* | [**user_list_quota_artifacts**](docs/UserApi.md#user_list_quota_artifacts) | **GET** /user/quota/artifacts | List the artifacts affecting the authenticated user's quota -*UserApi* | [**user_list_quota_attachments**](docs/UserApi.md#user_list_quota_attachments) | **GET** /user/quota/attachments | List the attachments affecting the authenticated user's quota -*UserApi* | [**user_list_quota_packages**](docs/UserApi.md#user_list_quota_packages) | **GET** /user/quota/packages | List the packages affecting the authenticated user's quota -*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_search_run_jobs**](docs/UserApi.md#user_search_run_jobs) | **GET** /user/actions/runners/jobs | Search for user's action jobs according filter conditions -*UserApi* | [**user_unblock_user**](docs/UserApi.md#user_unblock_user) | **PUT** /user/unblock/{username} | Unblocks a user from the doer -*UserApi* | [**user_update_avatar**](docs/UserApi.md#user_update_avatar) | **POST** /user/avatar | Update avatar of the current user -*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) - - [ActionRun](docs/ActionRun.md) - - [ActionRunJob](docs/ActionRunJob.md) - - [ActionTask](docs/ActionTask.md) - - [ActionTaskResponse](docs/ActionTaskResponse.md) - - [ActionVariable](docs/ActionVariable.md) - - [Activity](docs/Activity.md) - - [ActivityPub](docs/ActivityPub.md) - - [AddCollaboratorOption](docs/AddCollaboratorOption.md) - - [AddTimeOption](docs/AddTimeOption.md) - - [AnnotatedTag](docs/AnnotatedTag.md) - - [AnnotatedTagObject](docs/AnnotatedTagObject.md) - - [ApiError](docs/ApiError.md) - - [ApiForbiddenError](docs/ApiForbiddenError.md) - - [ApiInternalServerError](docs/ApiInternalServerError.md) - - [ApiInvalidTopicsError](docs/ApiInvalidTopicsError.md) - - [ApiNotFound](docs/ApiNotFound.md) - - [ApiRepoArchivedError](docs/ApiRepoArchivedError.md) - - [ApiUnauthorizedError](docs/ApiUnauthorizedError.md) - - [ApiValidationError](docs/ApiValidationError.md) - - [Attachment](docs/Attachment.md) - - [BlockedUser](docs/BlockedUser.md) - - [Branch](docs/Branch.md) - - [BranchProtection](docs/BranchProtection.md) - - [ChangeFileOperation](docs/ChangeFileOperation.md) - - [ChangeFilesOptions](docs/ChangeFilesOptions.md) - - [ChangedFile](docs/ChangedFile.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) - - [Compare](docs/Compare.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) - - [CreateOrUpdateSecretOption](docs/CreateOrUpdateSecretOption.md) - - [CreateOrgOption](docs/CreateOrgOption.md) - - [CreatePullRequestOption](docs/CreatePullRequestOption.md) - - [CreatePullReviewComment](docs/CreatePullReviewComment.md) - - [CreatePullReviewOptions](docs/CreatePullReviewOptions.md) - - [CreatePushMirrorOption](docs/CreatePushMirrorOption.md) - - [CreateQuotaGroupOptions](docs/CreateQuotaGroupOptions.md) - - [CreateQuotaRuleOptions](docs/CreateQuotaRuleOptions.md) - - [CreateReleaseOption](docs/CreateReleaseOption.md) - - [CreateRepoOption](docs/CreateRepoOption.md) - - [CreateStatusOption](docs/CreateStatusOption.md) - - [CreateTagOption](docs/CreateTagOption.md) - - [CreateTagProtectionOption](docs/CreateTagProtectionOption.md) - - [CreateTeamOption](docs/CreateTeamOption.md) - - [CreateUserOption](docs/CreateUserOption.md) - - [CreateVariableOption](docs/CreateVariableOption.md) - - [CreateWikiPageOptions](docs/CreateWikiPageOptions.md) - - [Cron](docs/Cron.md) - - [DeleteEmailOption](docs/DeleteEmailOption.md) - - [DeleteFileOptions](docs/DeleteFileOptions.md) - - [DeleteLabelsOption](docs/DeleteLabelsOption.md) - - [DeployKey](docs/DeployKey.md) - - [DismissPullReviewOptions](docs/DismissPullReviewOptions.md) - - [DispatchWorkflowOption](docs/DispatchWorkflowOption.md) - - [DispatchWorkflowRun](docs/DispatchWorkflowRun.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) - - [EditQuotaRuleOptions](docs/EditQuotaRuleOptions.md) - - [EditReactionOption](docs/EditReactionOption.md) - - [EditReleaseOption](docs/EditReleaseOption.md) - - [EditRepoOption](docs/EditRepoOption.md) - - [EditTagProtectionOption](docs/EditTagProtectionOption.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) - - [FilesResponse](docs/FilesResponse.md) - - [GeneralApiSettings](docs/GeneralApiSettings.md) - - [GeneralAttachmentSettings](docs/GeneralAttachmentSettings.md) - - [GeneralRepoSettings](docs/GeneralRepoSettings.md) - - [GeneralUiSettings](docs/GeneralUiSettings.md) - - [GenerateRepoOption](docs/GenerateRepoOption.md) - - [GitBlob](docs/GitBlob.md) - - [GitEntry](docs/GitEntry.md) - - [GitHook](docs/GitHook.md) - - [GitObject](docs/GitObject.md) - - [GitTreeResponse](docs/GitTreeResponse.md) - - [GitignoreTemplateInfo](docs/GitignoreTemplateInfo.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) - - [IssueConfig](docs/IssueConfig.md) - - [IssueConfigContactLink](docs/IssueConfigContactLink.md) - - [IssueConfigValidation](docs/IssueConfigValidation.md) - - [IssueDeadline](docs/IssueDeadline.md) - - [IssueFormField](docs/IssueFormField.md) - - [IssueLabelsOption](docs/IssueLabelsOption.md) - - [IssueMeta](docs/IssueMeta.md) - - [IssueTemplate](docs/IssueTemplate.md) - - [Label](docs/Label.md) - - [LabelTemplate](docs/LabelTemplate.md) - - [LicenseTemplateInfo](docs/LicenseTemplateInfo.md) - - [LicensesTemplateListEntry](docs/LicensesTemplateListEntry.md) - - [ListActionRunResponse](docs/ListActionRunResponse.md) - - [MarkdownOption](docs/MarkdownOption.md) - - [MarkupOption](docs/MarkupOption.md) - - [MergePullRequestOption](docs/MergePullRequestOption.md) - - [MigrateRepoOptions](docs/MigrateRepoOptions.md) - - [Milestone](docs/Milestone.md) - - [NewIssuePinsAllowed](docs/NewIssuePinsAllowed.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) - - [NoteOptions](docs/NoteOptions.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) - - [PushMirror](docs/PushMirror.md) - - [QuotaGroup](docs/QuotaGroup.md) - - [QuotaInfo](docs/QuotaInfo.md) - - [QuotaRuleInfo](docs/QuotaRuleInfo.md) - - [QuotaUsed](docs/QuotaUsed.md) - - [QuotaUsedArtifact](docs/QuotaUsedArtifact.md) - - [QuotaUsedAttachment](docs/QuotaUsedAttachment.md) - - [QuotaUsedAttachmentContainedIn](docs/QuotaUsedAttachmentContainedIn.md) - - [QuotaUsedPackage](docs/QuotaUsedPackage.md) - - [QuotaUsedSize](docs/QuotaUsedSize.md) - - [QuotaUsedSizeAssets](docs/QuotaUsedSizeAssets.md) - - [QuotaUsedSizeAssetsAttachments](docs/QuotaUsedSizeAssetsAttachments.md) - - [QuotaUsedSizeAssetsPackages](docs/QuotaUsedSizeAssetsPackages.md) - - [QuotaUsedSizeGit](docs/QuotaUsedSizeGit.md) - - [QuotaUsedSizeRepos](docs/QuotaUsedSizeRepos.md) - - [Reaction](docs/Reaction.md) - - [Reference](docs/Reference.md) - - [RegistrationToken](docs/RegistrationToken.md) - - [Release](docs/Release.md) - - [RenameOrgOption](docs/RenameOrgOption.md) - - [RenameUserOption](docs/RenameUserOption.md) - - [ReplaceFlagsOption](docs/ReplaceFlagsOption.md) - - [RepoCollaboratorPermission](docs/RepoCollaboratorPermission.md) - - [RepoCommit](docs/RepoCommit.md) - - [RepoCreateReleaseAttachmentRequest](docs/RepoCreateReleaseAttachmentRequest.md) - - [RepoTopicOptions](docs/RepoTopicOptions.md) - - [RepoTransfer](docs/RepoTransfer.md) - - [Repository](docs/Repository.md) - - [RepositoryMeta](docs/RepositoryMeta.md) - - [SearchResults](docs/SearchResults.md) - - [Secret](docs/Secret.md) - - [ServerVersion](docs/ServerVersion.md) - - [SetUserQuotaGroupsOptions](docs/SetUserQuotaGroupsOptions.md) - - [StopWatch](docs/StopWatch.md) - - [SubmitPullReviewOptions](docs/SubmitPullReviewOptions.md) - - [SyncForkInfo](docs/SyncForkInfo.md) - - [Tag](docs/Tag.md) - - [TagArchiveDownloadCount](docs/TagArchiveDownloadCount.md) - - [TagProtection](docs/TagProtection.md) - - [Team](docs/Team.md) - - [TeamSearchResults](docs/TeamSearchResults.md) - - [TimelineComment](docs/TimelineComment.md) - - [TopicName](docs/TopicName.md) - - [TopicResponse](docs/TopicResponse.md) - - [TopicSearchResults](docs/TopicSearchResults.md) - - [TrackedTime](docs/TrackedTime.md) - - [TransferRepoOption](docs/TransferRepoOption.md) - - [UpdateBranchRepoOption](docs/UpdateBranchRepoOption.md) - - [UpdateFileOptions](docs/UpdateFileOptions.md) - - [UpdateRepoAvatarOption](docs/UpdateRepoAvatarOption.md) - - [UpdateUserAvatarOption](docs/UpdateUserAvatarOption.md) - - [UpdateVariableOption](docs/UpdateVariableOption.md) - - [User](docs/User.md) - - [UserHeatmapData](docs/UserHeatmapData.md) - - [UserSearchResults](docs/UserSearchResults.md) - - [UserSettings](docs/UserSettings.md) - - [UserSettingsOptions](docs/UserSettingsOptions.md) - - [VerifyGpgKeyOption](docs/VerifyGpgKeyOption.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 -``` diff --git a/README.md b/README.md deleted file mode 100644 index f5aa1bc..0000000 --- a/README.md +++ /dev/null @@ -1,29 +0,0 @@ -Forgejo client based off [OpenAPI endpoint definition](https://v14.next.forgejo.org/swagger.v1.json). - -Absolute majority of this code was _generated_ by [OpenAPI generator tool](openapi-generator). For more info, [see its own `README`](OPENAPI_GENERATOR.md). - -# Reproduction -(shush) - -You need to have JRE binaries in your path, and [download one of tool's releases](https://github.com/OpenAPITools/openapi-generator/releases). Release `7.19.0` was used to generate this code. - -Then, -```sh -java -jar openapi-generator-cli-7.19.0.jar generate \ - -i https://v14.next.forgejo.org/swagger.v1.json \ - -g rust \ - -o ./forgejo-openapi -``` - -And delete any extra files you don't need. For help, -```sh -java -jar openapi-generator-cli-7.19.0.jar help -``` - -# Licence - -This code was generated by the [OpenAPI generator tool](openapi-generator). According to [tool's README](https://github.com/OpenAPITools/openapi-generator?tab=readme-ov-file#34---license-information-on-generated-code): - -> Generated code is intentionally not subject to the parent project license - -And so this code is licensed under [CC0](https://creativecommons.org/publicdomain/zero/1.0/). diff --git a/docs/AccessToken.md b/docs/AccessToken.md deleted file mode 100644 index d52fb41..0000000 --- a/docs/AccessToken.md +++ /dev/null @@ -1,15 +0,0 @@ -# AccessToken - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**id** | Option<**i64**> | | [optional] -**name** | Option<**String**> | | [optional] -**scopes** | Option<**Vec**> | | [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/docs/ActionRun.md b/docs/ActionRun.md deleted file mode 100644 index 8114d38..0000000 --- a/docs/ActionRun.md +++ /dev/null @@ -1,33 +0,0 @@ -# ActionRun - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**schedule_id** | Option<**i64**> | the cron id for the schedule trigger | [optional] -**approved_by** | Option<**i64**> | who approved this action run | [optional] -**commit_sha** | Option<**String**> | the commit sha the action run ran on | [optional] -**created** | Option<**String**> | when the action run was created | [optional] -**duration** | Option<**i64**> | A Duration represents the elapsed time between two instants as an int64 nanosecond count. The representation limits the largest representable duration to approximately 290 years. | [optional] -**event** | Option<**String**> | the webhook event that causes the workflow to run | [optional] -**event_payload** | Option<**String**> | the payload of the webhook event that causes the workflow to run | [optional] -**html_url** | Option<**String**> | the url of this action run | [optional] -**id** | Option<**i64**> | the action run id | [optional] -**index_in_repo** | Option<**i64**> | a unique number for each run of a repository | [optional] -**is_fork_pull_request** | Option<**bool**> | If this is triggered by a PR from a forked repository or an untrusted user, we need to check if it is approved and limit permissions when running the workflow. | [optional] -**is_ref_deleted** | Option<**bool**> | has the commit/tag/… the action run ran on been deleted | [optional] -**need_approval** | Option<**bool**> | may need approval if it's a fork pull request | [optional] -**prettyref** | Option<**String**> | the commit/tag/… the action run ran on | [optional] -**repository** | Option<[**models::Repository**](Repository.md)> | | [optional] -**started** | Option<**String**> | when the action run was started | [optional] -**status** | Option<**String**> | the current status of this run | [optional] -**stopped** | Option<**String**> | when the action run was stopped | [optional] -**title** | Option<**String**> | the action run's title | [optional] -**trigger_event** | Option<**String**> | the trigger event defined in the `on` configuration of the triggered workflow | [optional] -**trigger_user** | Option<[**models::User**](User.md)> | | [optional] -**updated** | Option<**String**> | when the action run was last updated | [optional] -**workflow_id** | Option<**String**> | the name of workflow file | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/docs/ActionRunJob.md b/docs/ActionRunJob.md deleted file mode 100644 index ca0887c..0000000 --- a/docs/ActionRunJob.md +++ /dev/null @@ -1,18 +0,0 @@ -# ActionRunJob - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**id** | Option<**i64**> | the action run job id | [optional] -**name** | Option<**String**> | the action run job name | [optional] -**needs** | Option<**Vec**> | the action run job needed ids | [optional] -**owner_id** | Option<**i64**> | the owner id | [optional] -**repo_id** | Option<**i64**> | the repository id | [optional] -**runs_on** | Option<**Vec**> | the action run job labels to run on | [optional] -**status** | Option<**String**> | the action run job status | [optional] -**task_id** | Option<**i64**> | the action run job latest task id | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/docs/ActionTask.md b/docs/ActionTask.md deleted file mode 100644 index 3f70af3..0000000 --- a/docs/ActionTask.md +++ /dev/null @@ -1,23 +0,0 @@ -# ActionTask - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**created_at** | Option<**String**> | | [optional] -**display_title** | Option<**String**> | | [optional] -**event** | Option<**String**> | | [optional] -**head_branch** | Option<**String**> | | [optional] -**head_sha** | Option<**String**> | | [optional] -**id** | Option<**i64**> | | [optional] -**name** | Option<**String**> | | [optional] -**run_number** | Option<**i64**> | | [optional] -**run_started_at** | Option<**String**> | | [optional] -**status** | Option<**String**> | | [optional] -**updated_at** | Option<**String**> | | [optional] -**url** | Option<**String**> | | [optional] -**workflow_id** | 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/docs/ActionTaskResponse.md b/docs/ActionTaskResponse.md deleted file mode 100644 index 3eeb5a4..0000000 --- a/docs/ActionTaskResponse.md +++ /dev/null @@ -1,12 +0,0 @@ -# ActionTaskResponse - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**total_count** | Option<**i64**> | | [optional] -**workflow_runs** | Option<[**Vec**](ActionTask.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/docs/ActionVariable.md b/docs/ActionVariable.md deleted file mode 100644 index 663b9c0..0000000 --- a/docs/ActionVariable.md +++ /dev/null @@ -1,14 +0,0 @@ -# ActionVariable - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**data** | Option<**String**> | the value of the variable | [optional] -**name** | Option<**String**> | the name of the variable | [optional] -**owner_id** | Option<**i64**> | the owner to which the variable belongs | [optional] -**repo_id** | Option<**i64**> | the repository to which the variable belongs | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/docs/Activity.md b/docs/Activity.md deleted file mode 100644 index 3163858..0000000 --- a/docs/Activity.md +++ /dev/null @@ -1,23 +0,0 @@ -# Activity - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**act_user** | Option<[**models::User**](User.md)> | | [optional] -**act_user_id** | Option<**i64**> | | [optional] -**comment** | Option<[**models::Comment**](Comment.md)> | | [optional] -**comment_id** | Option<**i64**> | | [optional] -**content** | Option<**String**> | | [optional] -**created** | Option<**String**> | | [optional] -**id** | Option<**i64**> | | [optional] -**is_private** | Option<**bool**> | | [optional] -**op_type** | Option<**OpType**> | the type of action (enum: create_repo, rename_repo, star_repo, watch_repo, commit_repo, create_issue, create_pull_request, transfer_repo, push_tag, comment_issue, merge_pull_request, close_issue, reopen_issue, close_pull_request, reopen_pull_request, delete_tag, delete_branch, mirror_sync_push, mirror_sync_create, mirror_sync_delete, approve_pull_request, reject_pull_request, comment_pull, publish_release, pull_review_dismissed, pull_request_ready_for_review, auto_merge_pull_request) | [optional] -**ref_name** | Option<**String**> | | [optional] -**repo** | Option<[**models::Repository**](Repository.md)> | | [optional] -**repo_id** | Option<**i64**> | | [optional] -**user_id** | 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/docs/ActivityPub.md b/docs/ActivityPub.md deleted file mode 100644 index 433610d..0000000 --- a/docs/ActivityPub.md +++ /dev/null @@ -1,11 +0,0 @@ -# ActivityPub - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**at_context** | 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/docs/ActivitypubApi.md b/docs/ActivitypubApi.md deleted file mode 100644 index b788087..0000000 --- a/docs/ActivitypubApi.md +++ /dev/null @@ -1,321 +0,0 @@ -# \ActivitypubApi - -All URIs are relative to */api/v1* - -Method | HTTP request | Description -------------- | ------------- | ------------- -[**activitypub_instance_actor**](ActivitypubApi.md#activitypub_instance_actor) | **GET** /activitypub/actor | Returns the instance's Actor -[**activitypub_instance_actor_inbox**](ActivitypubApi.md#activitypub_instance_actor_inbox) | **POST** /activitypub/actor/inbox | Send to the inbox -[**activitypub_instance_actor_outbox**](ActivitypubApi.md#activitypub_instance_actor_outbox) | **POST** /activitypub/actor/outbox | Display the outbox (always empty) -[**activitypub_person**](ActivitypubApi.md#activitypub_person) | **GET** /activitypub/user-id/{user_id} | Returns the Person actor for a user -[**activitypub_person_activity**](ActivitypubApi.md#activitypub_person_activity) | **GET** /activitypub/user-id/{user_id}/activities/{activity_id}/activity | Get a specific activity of the user -[**activitypub_person_activity_note**](ActivitypubApi.md#activitypub_person_activity_note) | **GET** /activitypub/user-id/{user_id}/activities/{activity_id} | Get a specific activity object of the user -[**activitypub_person_feed**](ActivitypubApi.md#activitypub_person_feed) | **GET** /activitypub/user-id/{user_id}/outbox | List the user's recorded activity -[**activitypub_person_inbox**](ActivitypubApi.md#activitypub_person_inbox) | **POST** /activitypub/user-id/{user_id}/inbox | Send to the inbox -[**activitypub_repository**](ActivitypubApi.md#activitypub_repository) | **GET** /activitypub/repository-id/{repository_id} | Returns the Repository actor for a repo -[**activitypub_repository_inbox**](ActivitypubApi.md#activitypub_repository_inbox) | **POST** /activitypub/repository-id/{repository_id}/inbox | Send to the inbox -[**activitypub_repository_outbox**](ActivitypubApi.md#activitypub_repository_outbox) | **POST** /activitypub/repository-id/{repository_id}/outbox | Display the outbox - - - -## activitypub_instance_actor - -> models::ActivityPub activitypub_instance_actor() -Returns the instance's Actor - -### Parameters - -This endpoint does not need any parameter. - -### Return type - -[**models::ActivityPub**](ActivityPub.md) - -### Authorization - -[TOTPHeader](../README.md#TOTPHeader), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [SudoHeader](../README.md#SudoHeader), [BasicAuth](../README.md#BasicAuth), [AccessToken](../README.md#AccessToken), [SudoParam](../README.md#SudoParam), [Token](../README.md#Token) - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - - -## activitypub_instance_actor_inbox - -> activitypub_instance_actor_inbox() -Send to the inbox - -### Parameters - -This endpoint does not need any parameter. - -### Return type - - (empty response body) - -### Authorization - -[TOTPHeader](../README.md#TOTPHeader), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [SudoHeader](../README.md#SudoHeader), [BasicAuth](../README.md#BasicAuth), [AccessToken](../README.md#AccessToken), [SudoParam](../README.md#SudoParam), [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) - - -## activitypub_instance_actor_outbox - -> serde_json::Value activitypub_instance_actor_outbox() -Display the outbox (always empty) - -### Parameters - -This endpoint does not need any parameter. - -### Return type - -[**serde_json::Value**](serde_json::Value.md) - -### Authorization - -[TOTPHeader](../README.md#TOTPHeader), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [SudoHeader](../README.md#SudoHeader), [BasicAuth](../README.md#BasicAuth), [AccessToken](../README.md#AccessToken), [SudoParam](../README.md#SudoParam), [Token](../README.md#Token) - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: application/ld+json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - - -## activitypub_person - -> models::ActivityPub activitypub_person(user_id) -Returns the Person actor for a user - -### Parameters - - -Name | Type | Description | Required | Notes -------------- | ------------- | ------------- | ------------- | ------------- -**user_id** | **i64** | user ID of the user | [required] | - -### Return type - -[**models::ActivityPub**](ActivityPub.md) - -### Authorization - -[TOTPHeader](../README.md#TOTPHeader), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [SudoHeader](../README.md#SudoHeader), [BasicAuth](../README.md#BasicAuth), [AccessToken](../README.md#AccessToken), [SudoParam](../README.md#SudoParam), [Token](../README.md#Token) - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - - -## activitypub_person_activity - -> models::ActivityPub activitypub_person_activity(user_id, activity_id) -Get a specific activity of the user - -### Parameters - - -Name | Type | Description | Required | Notes -------------- | ------------- | ------------- | ------------- | ------------- -**user_id** | **i32** | user ID of the user | [required] | -**activity_id** | **i32** | activity ID of the sought activity | [required] | - -### Return type - -[**models::ActivityPub**](ActivityPub.md) - -### Authorization - -[TOTPHeader](../README.md#TOTPHeader), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [SudoHeader](../README.md#SudoHeader), [BasicAuth](../README.md#BasicAuth), [AccessToken](../README.md#AccessToken), [SudoParam](../README.md#SudoParam), [Token](../README.md#Token) - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - - -## activitypub_person_activity_note - -> models::ActivityPub activitypub_person_activity_note(user_id, activity_id) -Get a specific activity object of the user - -### Parameters - - -Name | Type | Description | Required | Notes -------------- | ------------- | ------------- | ------------- | ------------- -**user_id** | **i32** | user ID of the user | [required] | -**activity_id** | **i32** | activity ID of the sought activity | [required] | - -### Return type - -[**models::ActivityPub**](ActivityPub.md) - -### Authorization - -[TOTPHeader](../README.md#TOTPHeader), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [SudoHeader](../README.md#SudoHeader), [BasicAuth](../README.md#BasicAuth), [AccessToken](../README.md#AccessToken), [SudoParam](../README.md#SudoParam), [Token](../README.md#Token) - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - - -## activitypub_person_feed - -> serde_json::Value activitypub_person_feed(user_id) -List the user's recorded activity - -### Parameters - - -Name | Type | Description | Required | Notes -------------- | ------------- | ------------- | ------------- | ------------- -**user_id** | **i32** | user ID of the user | [required] | - -### Return type - -[**serde_json::Value**](serde_json::Value.md) - -### Authorization - -[TOTPHeader](../README.md#TOTPHeader), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [SudoHeader](../README.md#SudoHeader), [BasicAuth](../README.md#BasicAuth), [AccessToken](../README.md#AccessToken), [SudoParam](../README.md#SudoParam), [Token](../README.md#Token) - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - - -## activitypub_person_inbox - -> activitypub_person_inbox(user_id) -Send to the inbox - -### Parameters - - -Name | Type | Description | Required | Notes -------------- | ------------- | ------------- | ------------- | ------------- -**user_id** | **i64** | user ID of the user | [required] | - -### Return type - - (empty response body) - -### Authorization - -[TOTPHeader](../README.md#TOTPHeader), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [SudoHeader](../README.md#SudoHeader), [BasicAuth](../README.md#BasicAuth), [AccessToken](../README.md#AccessToken), [SudoParam](../README.md#SudoParam), [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) - - -## activitypub_repository - -> models::ActivityPub activitypub_repository(repository_id) -Returns the Repository actor for a repo - -### Parameters - - -Name | Type | Description | Required | Notes -------------- | ------------- | ------------- | ------------- | ------------- -**repository_id** | **i64** | repository ID of the repo | [required] | - -### Return type - -[**models::ActivityPub**](ActivityPub.md) - -### Authorization - -[TOTPHeader](../README.md#TOTPHeader), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [SudoHeader](../README.md#SudoHeader), [BasicAuth](../README.md#BasicAuth), [AccessToken](../README.md#AccessToken), [SudoParam](../README.md#SudoParam), [Token](../README.md#Token) - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - - -## activitypub_repository_inbox - -> activitypub_repository_inbox(repository_id, body) -Send to the inbox - -### Parameters - - -Name | Type | Description | Required | Notes -------------- | ------------- | ------------- | ------------- | ------------- -**repository_id** | **i64** | repository ID of the repo | [required] | -**body** | Option<**serde_json::Value**> | | | - -### Return type - - (empty response body) - -### Authorization - -[TOTPHeader](../README.md#TOTPHeader), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [SudoHeader](../README.md#SudoHeader), [BasicAuth](../README.md#BasicAuth), [AccessToken](../README.md#AccessToken), [SudoParam](../README.md#SudoParam), [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) - - -## activitypub_repository_outbox - -> serde_json::Value activitypub_repository_outbox(repository_id) -Display the outbox - -### Parameters - - -Name | Type | Description | Required | Notes -------------- | ------------- | ------------- | ------------- | ------------- -**repository_id** | **i64** | repository ID of the repo | [required] | - -### Return type - -[**serde_json::Value**](serde_json::Value.md) - -### Authorization - -[TOTPHeader](../README.md#TOTPHeader), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [SudoHeader](../README.md#SudoHeader), [BasicAuth](../README.md#BasicAuth), [AccessToken](../README.md#AccessToken), [SudoParam](../README.md#SudoParam), [Token](../README.md#Token) - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: application/ld+json - -[[Back to top]](#) [[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/docs/AddCollaboratorOption.md b/docs/AddCollaboratorOption.md deleted file mode 100644 index c614fd6..0000000 --- a/docs/AddCollaboratorOption.md +++ /dev/null @@ -1,11 +0,0 @@ -# AddCollaboratorOption - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**permission** | Option<**Permission**> | (enum: read, write, admin) | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/docs/AddTimeOption.md b/docs/AddTimeOption.md deleted file mode 100644 index e64bdc4..0000000 --- a/docs/AddTimeOption.md +++ /dev/null @@ -1,13 +0,0 @@ -# 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/docs/AdminApi.md b/docs/AdminApi.md deleted file mode 100644 index cb89920..0000000 --- a/docs/AdminApi.md +++ /dev/null @@ -1,1246 +0,0 @@ -# \AdminApi - -All URIs are relative to */api/v1* - -Method | HTTP request | Description -------------- | ------------- | ------------- -[**admin_add_rule_to_quota_group**](AdminApi.md#admin_add_rule_to_quota_group) | **PUT** /admin/quota/groups/{quotagroup}/rules/{quotarule} | Adds a rule to a quota group -[**admin_add_user_to_quota_group**](AdminApi.md#admin_add_user_to_quota_group) | **PUT** /admin/quota/groups/{quotagroup}/users/{username} | Add a user to a quota group -[**admin_adopt_repository**](AdminApi.md#admin_adopt_repository) | **POST** /admin/unadopted/{owner}/{repo} | Adopt unadopted files as a repository -[**admin_create_hook**](AdminApi.md#admin_create_hook) | **POST** /admin/hooks | Create a hook -[**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 an SSH public key to user's account -[**admin_create_quota_group**](AdminApi.md#admin_create_quota_group) | **POST** /admin/quota/groups | Create a new quota group -[**admin_create_quota_rule**](AdminApi.md#admin_create_quota_rule) | **POST** /admin/quota/rules | Create a new quota rule -[**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 account -[**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_hook**](AdminApi.md#admin_delete_hook) | **DELETE** /admin/hooks/{id} | Delete a hook -[**admin_delete_quota_group**](AdminApi.md#admin_delete_quota_group) | **DELETE** /admin/quota/groups/{quotagroup} | Delete a quota group -[**admin_delete_quota_rule**](AdminApi.md#admin_delete_quota_rule) | **DELETE** /admin/quota/rules/{quotarule} | Deletes a quota rule -[**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 user account -[**admin_delete_user_emails**](AdminApi.md#admin_delete_user_emails) | **DELETE** /admin/users/{username}/emails | Delete email addresses from a user's account -[**admin_delete_user_public_key**](AdminApi.md#admin_delete_user_public_key) | **DELETE** /admin/users/{username}/keys/{id} | Remove a public key from user's account -[**admin_edit_hook**](AdminApi.md#admin_edit_hook) | **PATCH** /admin/hooks/{id} | Update a hook -[**admin_edit_quota_rule**](AdminApi.md#admin_edit_quota_rule) | **PATCH** /admin/quota/rules/{quotarule} | Change an existing quota rule -[**admin_edit_user**](AdminApi.md#admin_edit_user) | **PATCH** /admin/users/{username} | Edit an existing user -[**admin_get_all_emails**](AdminApi.md#admin_get_all_emails) | **GET** /admin/emails | List all users' email addresses -[**admin_get_all_orgs**](AdminApi.md#admin_get_all_orgs) | **GET** /admin/orgs | List all organizations -[**admin_get_hook**](AdminApi.md#admin_get_hook) | **GET** /admin/hooks/{id} | Get a hook -[**admin_get_quota_group**](AdminApi.md#admin_get_quota_group) | **GET** /admin/quota/groups/{quotagroup} | Get information about the quota group -[**admin_get_quota_rule**](AdminApi.md#admin_get_quota_rule) | **GET** /admin/quota/rules/{quotarule} | Get information about a quota rule -[**admin_get_runner_registration_token**](AdminApi.md#admin_get_runner_registration_token) | **GET** /admin/runners/registration-token | Get an global actions runner registration token -[**admin_get_user_quota**](AdminApi.md#admin_get_user_quota) | **GET** /admin/users/{username}/quota | Get the user's quota info -[**admin_list_hooks**](AdminApi.md#admin_list_hooks) | **GET** /admin/hooks | List global (system) webhooks -[**admin_list_quota_groups**](AdminApi.md#admin_list_quota_groups) | **GET** /admin/quota/groups | List the available quota groups -[**admin_list_quota_rules**](AdminApi.md#admin_list_quota_rules) | **GET** /admin/quota/rules | List the available quota rules -[**admin_list_user_emails**](AdminApi.md#admin_list_user_emails) | **GET** /admin/users/{username}/emails | List all email addresses for a user -[**admin_list_users_in_quota_group**](AdminApi.md#admin_list_users_in_quota_group) | **GET** /admin/quota/groups/{quotagroup}/users | List users in a quota group -[**admin_remove_rule_from_quota_group**](AdminApi.md#admin_remove_rule_from_quota_group) | **DELETE** /admin/quota/groups/{quotagroup}/rules/{quotarule} | Removes a rule from a quota group -[**admin_remove_user_from_quota_group**](AdminApi.md#admin_remove_user_from_quota_group) | **DELETE** /admin/quota/groups/{quotagroup}/users/{username} | Remove a user from a quota group -[**admin_rename_user**](AdminApi.md#admin_rename_user) | **POST** /admin/users/{username}/rename | Rename a user -[**admin_search_emails**](AdminApi.md#admin_search_emails) | **GET** /admin/emails/search | Search users' email addresses -[**admin_search_run_jobs**](AdminApi.md#admin_search_run_jobs) | **GET** /admin/runners/jobs | Search action jobs according filter conditions -[**admin_search_users**](AdminApi.md#admin_search_users) | **GET** /admin/users | Search users according filter conditions -[**admin_set_user_quota_groups**](AdminApi.md#admin_set_user_quota_groups) | **POST** /admin/users/{username}/quota/groups | Set the user's quota groups to a given list. -[**admin_unadopted_list**](AdminApi.md#admin_unadopted_list) | **GET** /admin/unadopted | List unadopted repositories - - - -## admin_add_rule_to_quota_group - -> admin_add_rule_to_quota_group(quotagroup, quotarule) -Adds a rule to a quota group - -### Parameters - - -Name | Type | Description | Required | Notes -------------- | ------------- | ------------- | ------------- | ------------- -**quotagroup** | **String** | quota group to add a rule to | [required] | -**quotarule** | **String** | the name of the quota rule to add to the group | [required] | - -### Return type - - (empty response body) - -### Authorization - -[TOTPHeader](../README.md#TOTPHeader), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [SudoHeader](../README.md#SudoHeader), [BasicAuth](../README.md#BasicAuth), [AccessToken](../README.md#AccessToken), [SudoParam](../README.md#SudoParam), [Token](../README.md#Token) - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: application/json - -[[Back to top]](#) [[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_add_user_to_quota_group - -> admin_add_user_to_quota_group(quotagroup, username) -Add a user to a quota group - -### Parameters - - -Name | Type | Description | Required | Notes -------------- | ------------- | ------------- | ------------- | ------------- -**quotagroup** | **String** | quota group to add the user to | [required] | -**username** | **String** | username of the user to add to the quota group | [required] | - -### Return type - - (empty response body) - -### Authorization - -[TOTPHeader](../README.md#TOTPHeader), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [SudoHeader](../README.md#SudoHeader), [BasicAuth](../README.md#BasicAuth), [AccessToken](../README.md#AccessToken), [SudoParam](../README.md#SudoParam), [Token](../README.md#Token) - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: application/json - -[[Back to top]](#) [[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_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 - -[TOTPHeader](../README.md#TOTPHeader), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [SudoHeader](../README.md#SudoHeader), [BasicAuth](../README.md#BasicAuth), [AccessToken](../README.md#AccessToken), [SudoParam](../README.md#SudoParam), [Token](../README.md#Token) - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: application/json - -[[Back to top]](#) [[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_hook - -> models::Hook admin_create_hook(body) -Create a hook - -### Parameters - - -Name | Type | Description | Required | Notes -------------- | ------------- | ------------- | ------------- | ------------- -**body** | [**CreateHookOption**](CreateHookOption.md) | | [required] | - -### Return type - -[**models::Hook**](Hook.md) - -### Authorization - -[TOTPHeader](../README.md#TOTPHeader), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [SudoHeader](../README.md#SudoHeader), [BasicAuth](../README.md#BasicAuth), [AccessToken](../README.md#AccessToken), [SudoParam](../README.md#SudoParam), [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_org - -> 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 - -[**models::Organization**](Organization.md) - -### Authorization - -[TOTPHeader](../README.md#TOTPHeader), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [SudoHeader](../README.md#SudoHeader), [BasicAuth](../README.md#BasicAuth), [AccessToken](../README.md#AccessToken), [SudoParam](../README.md#SudoParam), [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 - -> models::PublicKey admin_create_public_key(username, key) -Add an SSH public key to user's account - -### Parameters - - -Name | Type | Description | Required | Notes -------------- | ------------- | ------------- | ------------- | ------------- -**username** | **String** | username of the user | [required] | -**key** | Option<[**CreateKeyOption**](CreateKeyOption.md)> | | | - -### Return type - -[**models::PublicKey**](PublicKey.md) - -### Authorization - -[TOTPHeader](../README.md#TOTPHeader), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [SudoHeader](../README.md#SudoHeader), [BasicAuth](../README.md#BasicAuth), [AccessToken](../README.md#AccessToken), [SudoParam](../README.md#SudoParam), [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_quota_group - -> models::QuotaGroup admin_create_quota_group(group) -Create a new quota group - -### Parameters - - -Name | Type | Description | Required | Notes -------------- | ------------- | ------------- | ------------- | ------------- -**group** | [**CreateQuotaGroupOptions**](CreateQuotaGroupOptions.md) | Definition of the quota group | [required] | - -### Return type - -[**models::QuotaGroup**](QuotaGroup.md) - -### Authorization - -[TOTPHeader](../README.md#TOTPHeader), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [SudoHeader](../README.md#SudoHeader), [BasicAuth](../README.md#BasicAuth), [AccessToken](../README.md#AccessToken), [SudoParam](../README.md#SudoParam), [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) - - -## admin_create_quota_rule - -> models::QuotaRuleInfo admin_create_quota_rule(rule) -Create a new quota rule - -### Parameters - - -Name | Type | Description | Required | Notes -------------- | ------------- | ------------- | ------------- | ------------- -**rule** | [**CreateQuotaRuleOptions**](CreateQuotaRuleOptions.md) | Definition of the quota rule | [required] | - -### Return type - -[**models::QuotaRuleInfo**](QuotaRuleInfo.md) - -### Authorization - -[TOTPHeader](../README.md#TOTPHeader), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [SudoHeader](../README.md#SudoHeader), [BasicAuth](../README.md#BasicAuth), [AccessToken](../README.md#AccessToken), [SudoParam](../README.md#SudoParam), [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) - - -## admin_create_repo - -> 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 - -[**models::Repository**](Repository.md) - -### Authorization - -[TOTPHeader](../README.md#TOTPHeader), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [SudoHeader](../README.md#SudoHeader), [BasicAuth](../README.md#BasicAuth), [AccessToken](../README.md#AccessToken), [SudoParam](../README.md#SudoParam), [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 - -> models::User admin_create_user(body) -Create a user account - -### Parameters - - -Name | Type | Description | Required | Notes -------------- | ------------- | ------------- | ------------- | ------------- -**body** | Option<[**CreateUserOption**](CreateUserOption.md)> | | | - -### Return type - -[**models::User**](User.md) - -### Authorization - -[TOTPHeader](../README.md#TOTPHeader), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [SudoHeader](../README.md#SudoHeader), [BasicAuth](../README.md#BasicAuth), [AccessToken](../README.md#AccessToken), [SudoParam](../README.md#SudoParam), [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 - -[TOTPHeader](../README.md#TOTPHeader), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [SudoHeader](../README.md#SudoHeader), [BasicAuth](../README.md#BasicAuth), [AccessToken](../README.md#AccessToken), [SudoParam](../README.md#SudoParam), [Token](../README.md#Token) - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: application/json - -[[Back to top]](#) [[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 - -[TOTPHeader](../README.md#TOTPHeader), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [SudoHeader](../README.md#SudoHeader), [BasicAuth](../README.md#BasicAuth), [AccessToken](../README.md#AccessToken), [SudoParam](../README.md#SudoParam), [Token](../README.md#Token) - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: application/json - -[[Back to top]](#) [[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_hook - -> admin_delete_hook(id) -Delete a hook - -### Parameters - - -Name | Type | Description | Required | Notes -------------- | ------------- | ------------- | ------------- | ------------- -**id** | **i64** | id of the hook to delete | [required] | - -### Return type - - (empty response body) - -### Authorization - -[TOTPHeader](../README.md#TOTPHeader), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [SudoHeader](../README.md#SudoHeader), [BasicAuth](../README.md#BasicAuth), [AccessToken](../README.md#AccessToken), [SudoParam](../README.md#SudoParam), [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_quota_group - -> admin_delete_quota_group(quotagroup) -Delete a quota group - -### Parameters - - -Name | Type | Description | Required | Notes -------------- | ------------- | ------------- | ------------- | ------------- -**quotagroup** | **String** | quota group to delete | [required] | - -### Return type - - (empty response body) - -### Authorization - -[TOTPHeader](../README.md#TOTPHeader), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [SudoHeader](../README.md#SudoHeader), [BasicAuth](../README.md#BasicAuth), [AccessToken](../README.md#AccessToken), [SudoParam](../README.md#SudoParam), [Token](../README.md#Token) - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: application/json - -[[Back to top]](#) [[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_quota_rule - -> admin_delete_quota_rule(quotarule) -Deletes a quota rule - -### Parameters - - -Name | Type | Description | Required | Notes -------------- | ------------- | ------------- | ------------- | ------------- -**quotarule** | **String** | quota rule to delete | [required] | - -### Return type - - (empty response body) - -### Authorization - -[TOTPHeader](../README.md#TOTPHeader), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [SudoHeader](../README.md#SudoHeader), [BasicAuth](../README.md#BasicAuth), [AccessToken](../README.md#AccessToken), [SudoParam](../README.md#SudoParam), [Token](../README.md#Token) - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: application/json - -[[Back to top]](#) [[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 - -[TOTPHeader](../README.md#TOTPHeader), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [SudoHeader](../README.md#SudoHeader), [BasicAuth](../README.md#BasicAuth), [AccessToken](../README.md#AccessToken), [SudoParam](../README.md#SudoParam), [Token](../README.md#Token) - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: application/json - -[[Back to top]](#) [[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, purge) -Delete user account - -### Parameters - - -Name | Type | Description | Required | Notes -------------- | ------------- | ------------- | ------------- | ------------- -**username** | **String** | username of user to delete | [required] | -**purge** | Option<**bool**> | purge the user from the system completely | | - -### Return type - - (empty response body) - -### Authorization - -[TOTPHeader](../README.md#TOTPHeader), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [SudoHeader](../README.md#SudoHeader), [BasicAuth](../README.md#BasicAuth), [AccessToken](../README.md#AccessToken), [SudoParam](../README.md#SudoParam), [Token](../README.md#Token) - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: application/json - -[[Back to top]](#) [[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_emails - -> admin_delete_user_emails(username, body) -Delete email addresses from a user's account - -### Parameters - - -Name | Type | Description | Required | Notes -------------- | ------------- | ------------- | ------------- | ------------- -**username** | **String** | username of user to delete email addresses from | [required] | -**body** | Option<[**DeleteEmailOption**](DeleteEmailOption.md)> | | | - -### Return type - - (empty response body) - -### Authorization - -[TOTPHeader](../README.md#TOTPHeader), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [SudoHeader](../README.md#SudoHeader), [BasicAuth](../README.md#BasicAuth), [AccessToken](../README.md#AccessToken), [SudoParam](../README.md#SudoParam), [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) - - -## admin_delete_user_public_key - -> admin_delete_user_public_key(username, id) -Remove a public key from user's account - -### 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 - -[TOTPHeader](../README.md#TOTPHeader), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [SudoHeader](../README.md#SudoHeader), [BasicAuth](../README.md#BasicAuth), [AccessToken](../README.md#AccessToken), [SudoParam](../README.md#SudoParam), [Token](../README.md#Token) - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: application/json - -[[Back to top]](#) [[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_hook - -> models::Hook admin_edit_hook(id, body) -Update a hook - -### Parameters - - -Name | Type | Description | Required | Notes -------------- | ------------- | ------------- | ------------- | ------------- -**id** | **i64** | id of the hook to update | [required] | -**body** | Option<[**EditHookOption**](EditHookOption.md)> | | | - -### Return type - -[**models::Hook**](Hook.md) - -### Authorization - -[TOTPHeader](../README.md#TOTPHeader), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [SudoHeader](../README.md#SudoHeader), [BasicAuth](../README.md#BasicAuth), [AccessToken](../README.md#AccessToken), [SudoParam](../README.md#SudoParam), [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_edit_quota_rule - -> models::QuotaRuleInfo admin_edit_quota_rule(quotarule, rule) -Change an existing quota rule - -### Parameters - - -Name | Type | Description | Required | Notes -------------- | ------------- | ------------- | ------------- | ------------- -**quotarule** | **String** | Quota rule to change | [required] | -**rule** | [**EditQuotaRuleOptions**](EditQuotaRuleOptions.md) | | [required] | - -### Return type - -[**models::QuotaRuleInfo**](QuotaRuleInfo.md) - -### Authorization - -[TOTPHeader](../README.md#TOTPHeader), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [SudoHeader](../README.md#SudoHeader), [BasicAuth](../README.md#BasicAuth), [AccessToken](../README.md#AccessToken), [SudoParam](../README.md#SudoParam), [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) - - -## admin_edit_user - -> 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 - -[**models::User**](User.md) - -### Authorization - -[TOTPHeader](../README.md#TOTPHeader), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [SudoHeader](../README.md#SudoHeader), [BasicAuth](../README.md#BasicAuth), [AccessToken](../README.md#AccessToken), [SudoParam](../README.md#SudoParam), [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_emails - -> Vec admin_get_all_emails(page, limit) -List all users' email addresses - -### 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**](Email.md) - -### Authorization - -[TOTPHeader](../README.md#TOTPHeader), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [SudoHeader](../README.md#SudoHeader), [BasicAuth](../README.md#BasicAuth), [AccessToken](../README.md#AccessToken), [SudoParam](../README.md#SudoParam), [Token](../README.md#Token) - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: application/json - -[[Back to top]](#) [[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 - -[TOTPHeader](../README.md#TOTPHeader), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [SudoHeader](../README.md#SudoHeader), [BasicAuth](../README.md#BasicAuth), [AccessToken](../README.md#AccessToken), [SudoParam](../README.md#SudoParam), [Token](../README.md#Token) - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: application/json - -[[Back to top]](#) [[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_hook - -> models::Hook admin_get_hook(id) -Get a hook - -### Parameters - - -Name | Type | Description | Required | Notes -------------- | ------------- | ------------- | ------------- | ------------- -**id** | **i64** | id of the hook to get | [required] | - -### Return type - -[**models::Hook**](Hook.md) - -### Authorization - -[TOTPHeader](../README.md#TOTPHeader), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [SudoHeader](../README.md#SudoHeader), [BasicAuth](../README.md#BasicAuth), [AccessToken](../README.md#AccessToken), [SudoParam](../README.md#SudoParam), [Token](../README.md#Token) - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: application/json - -[[Back to top]](#) [[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_quota_group - -> models::QuotaGroup admin_get_quota_group(quotagroup) -Get information about the quota group - -### Parameters - - -Name | Type | Description | Required | Notes -------------- | ------------- | ------------- | ------------- | ------------- -**quotagroup** | **String** | quota group to query | [required] | - -### Return type - -[**models::QuotaGroup**](QuotaGroup.md) - -### Authorization - -[TOTPHeader](../README.md#TOTPHeader), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [SudoHeader](../README.md#SudoHeader), [BasicAuth](../README.md#BasicAuth), [AccessToken](../README.md#AccessToken), [SudoParam](../README.md#SudoParam), [Token](../README.md#Token) - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: application/json - -[[Back to top]](#) [[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_quota_rule - -> models::QuotaRuleInfo admin_get_quota_rule(quotarule) -Get information about a quota rule - -### Parameters - - -Name | Type | Description | Required | Notes -------------- | ------------- | ------------- | ------------- | ------------- -**quotarule** | **String** | quota rule to query | [required] | - -### Return type - -[**models::QuotaRuleInfo**](QuotaRuleInfo.md) - -### Authorization - -[TOTPHeader](../README.md#TOTPHeader), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [SudoHeader](../README.md#SudoHeader), [BasicAuth](../README.md#BasicAuth), [AccessToken](../README.md#AccessToken), [SudoParam](../README.md#SudoParam), [Token](../README.md#Token) - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: application/json - -[[Back to top]](#) [[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_runner_registration_token - -> models::RegistrationToken admin_get_runner_registration_token() -Get an global actions runner registration token - -### Parameters - -This endpoint does not need any parameter. - -### Return type - -[**models::RegistrationToken**](RegistrationToken.md) - -### Authorization - -[TOTPHeader](../README.md#TOTPHeader), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [SudoHeader](../README.md#SudoHeader), [BasicAuth](../README.md#BasicAuth), [AccessToken](../README.md#AccessToken), [SudoParam](../README.md#SudoParam), [Token](../README.md#Token) - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: application/json - -[[Back to top]](#) [[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_user_quota - -> models::QuotaInfo admin_get_user_quota(username) -Get the user's quota info - -### Parameters - - -Name | Type | Description | Required | Notes -------------- | ------------- | ------------- | ------------- | ------------- -**username** | **String** | username of user to query | [required] | - -### Return type - -[**models::QuotaInfo**](QuotaInfo.md) - -### Authorization - -[TOTPHeader](../README.md#TOTPHeader), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [SudoHeader](../README.md#SudoHeader), [BasicAuth](../README.md#BasicAuth), [AccessToken](../README.md#AccessToken), [SudoParam](../README.md#SudoParam), [Token](../README.md#Token) - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: application/json - -[[Back to top]](#) [[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_list_hooks - -> Vec admin_list_hooks(page, limit) -List global (system) webhooks - -### 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**](Hook.md) - -### Authorization - -[TOTPHeader](../README.md#TOTPHeader), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [SudoHeader](../README.md#SudoHeader), [BasicAuth](../README.md#BasicAuth), [AccessToken](../README.md#AccessToken), [SudoParam](../README.md#SudoParam), [Token](../README.md#Token) - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: application/json - -[[Back to top]](#) [[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_list_quota_groups - -> Vec admin_list_quota_groups() -List the available quota groups - -### Parameters - -This endpoint does not need any parameter. - -### Return type - -[**Vec**](QuotaGroup.md) - -### Authorization - -[TOTPHeader](../README.md#TOTPHeader), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [SudoHeader](../README.md#SudoHeader), [BasicAuth](../README.md#BasicAuth), [AccessToken](../README.md#AccessToken), [SudoParam](../README.md#SudoParam), [Token](../README.md#Token) - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: application/json - -[[Back to top]](#) [[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_list_quota_rules - -> Vec admin_list_quota_rules() -List the available quota rules - -### Parameters - -This endpoint does not need any parameter. - -### Return type - -[**Vec**](QuotaRuleInfo.md) - -### Authorization - -[TOTPHeader](../README.md#TOTPHeader), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [SudoHeader](../README.md#SudoHeader), [BasicAuth](../README.md#BasicAuth), [AccessToken](../README.md#AccessToken), [SudoParam](../README.md#SudoParam), [Token](../README.md#Token) - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: application/json - -[[Back to top]](#) [[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_list_user_emails - -> Vec admin_list_user_emails(username) -List all email addresses for a user - -### Parameters - - -Name | Type | Description | Required | Notes -------------- | ------------- | ------------- | ------------- | ------------- -**username** | **String** | username of user to get email addresses of | [required] | - -### Return type - -[**Vec**](Email.md) - -### Authorization - -[TOTPHeader](../README.md#TOTPHeader), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [SudoHeader](../README.md#SudoHeader), [BasicAuth](../README.md#BasicAuth), [AccessToken](../README.md#AccessToken), [SudoParam](../README.md#SudoParam), [Token](../README.md#Token) - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: application/json - -[[Back to top]](#) [[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_list_users_in_quota_group - -> Vec admin_list_users_in_quota_group(quotagroup) -List users in a quota group - -### Parameters - - -Name | Type | Description | Required | Notes -------------- | ------------- | ------------- | ------------- | ------------- -**quotagroup** | **String** | quota group to list members of | [required] | - -### Return type - -[**Vec**](User.md) - -### Authorization - -[TOTPHeader](../README.md#TOTPHeader), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [SudoHeader](../README.md#SudoHeader), [BasicAuth](../README.md#BasicAuth), [AccessToken](../README.md#AccessToken), [SudoParam](../README.md#SudoParam), [Token](../README.md#Token) - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: application/json - -[[Back to top]](#) [[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_remove_rule_from_quota_group - -> admin_remove_rule_from_quota_group(quotagroup, quotarule) -Removes a rule from a quota group - -### Parameters - - -Name | Type | Description | Required | Notes -------------- | ------------- | ------------- | ------------- | ------------- -**quotagroup** | **String** | quota group to remove a rule from | [required] | -**quotarule** | **String** | the name of the quota rule to remove from the group | [required] | - -### Return type - - (empty response body) - -### Authorization - -[TOTPHeader](../README.md#TOTPHeader), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [SudoHeader](../README.md#SudoHeader), [BasicAuth](../README.md#BasicAuth), [AccessToken](../README.md#AccessToken), [SudoParam](../README.md#SudoParam), [Token](../README.md#Token) - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: application/json - -[[Back to top]](#) [[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_remove_user_from_quota_group - -> admin_remove_user_from_quota_group(quotagroup, username) -Remove a user from a quota group - -### Parameters - - -Name | Type | Description | Required | Notes -------------- | ------------- | ------------- | ------------- | ------------- -**quotagroup** | **String** | quota group to remove a user from | [required] | -**username** | **String** | username of the user to remove from the quota group | [required] | - -### Return type - - (empty response body) - -### Authorization - -[TOTPHeader](../README.md#TOTPHeader), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [SudoHeader](../README.md#SudoHeader), [BasicAuth](../README.md#BasicAuth), [AccessToken](../README.md#AccessToken), [SudoParam](../README.md#SudoParam), [Token](../README.md#Token) - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: application/json - -[[Back to top]](#) [[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_rename_user - -> admin_rename_user(username, body) -Rename a user - -### Parameters - - -Name | Type | Description | Required | Notes -------------- | ------------- | ------------- | ------------- | ------------- -**username** | **String** | existing username of user | [required] | -**body** | [**RenameUserOption**](RenameUserOption.md) | | [required] | - -### Return type - - (empty response body) - -### Authorization - -[TOTPHeader](../README.md#TOTPHeader), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [SudoHeader](../README.md#SudoHeader), [BasicAuth](../README.md#BasicAuth), [AccessToken](../README.md#AccessToken), [SudoParam](../README.md#SudoParam), [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) - - -## admin_search_emails - -> Vec admin_search_emails(q, page, limit) -Search users' email addresses - -### Parameters - - -Name | Type | Description | Required | Notes -------------- | ------------- | ------------- | ------------- | ------------- -**q** | Option<**String**> | keyword | | -**page** | Option<**i32**> | page number of results to return (1-based) | | -**limit** | Option<**i32**> | page size of results | | - -### Return type - -[**Vec**](Email.md) - -### Authorization - -[TOTPHeader](../README.md#TOTPHeader), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [SudoHeader](../README.md#SudoHeader), [BasicAuth](../README.md#BasicAuth), [AccessToken](../README.md#AccessToken), [SudoParam](../README.md#SudoParam), [Token](../README.md#Token) - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: application/json - -[[Back to top]](#) [[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_search_run_jobs - -> Vec admin_search_run_jobs(labels) -Search action jobs according filter conditions - -### Parameters - - -Name | Type | Description | Required | Notes -------------- | ------------- | ------------- | ------------- | ------------- -**labels** | Option<**String**> | a comma separated list of run job labels to search for | | - -### Return type - -[**Vec**](ActionRunJob.md) - -### Authorization - -[TOTPHeader](../README.md#TOTPHeader), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [SudoHeader](../README.md#SudoHeader), [BasicAuth](../README.md#BasicAuth), [AccessToken](../README.md#AccessToken), [SudoParam](../README.md#SudoParam), [Token](../README.md#Token) - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: application/json - -[[Back to top]](#) [[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_search_users - -> Vec admin_search_users(source_id, login_name, sort, page, limit) -Search users according filter conditions - -### Parameters - - -Name | Type | Description | Required | Notes -------------- | ------------- | ------------- | ------------- | ------------- -**source_id** | Option<**i64**> | ID of the user's login source to search for | | -**login_name** | Option<**String**> | user's login name to search for | | -**sort** | Option<**String**> | sort order of results | | -**page** | Option<**i32**> | page number of results to return (1-based) | | -**limit** | Option<**i32**> | page size of results | | - -### Return type - -[**Vec**](User.md) - -### Authorization - -[TOTPHeader](../README.md#TOTPHeader), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [SudoHeader](../README.md#SudoHeader), [BasicAuth](../README.md#BasicAuth), [AccessToken](../README.md#AccessToken), [SudoParam](../README.md#SudoParam), [Token](../README.md#Token) - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: application/json - -[[Back to top]](#) [[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_set_user_quota_groups - -> admin_set_user_quota_groups(username, groups) -Set the user's quota groups to a given list. - -### Parameters - - -Name | Type | Description | Required | Notes -------------- | ------------- | ------------- | ------------- | ------------- -**username** | **String** | username of the user to modify the quota groups from | [required] | -**groups** | [**SetUserQuotaGroupsOptions**](SetUserQuotaGroupsOptions.md) | list of groups that the user should be a member of | [required] | - -### Return type - - (empty response body) - -### Authorization - -[TOTPHeader](../README.md#TOTPHeader), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [SudoHeader](../README.md#SudoHeader), [BasicAuth](../README.md#BasicAuth), [AccessToken](../README.md#AccessToken), [SudoParam](../README.md#SudoParam), [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) - - -## 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 - -[TOTPHeader](../README.md#TOTPHeader), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [SudoHeader](../README.md#SudoHeader), [BasicAuth](../README.md#BasicAuth), [AccessToken](../README.md#AccessToken), [SudoParam](../README.md#SudoParam), [Token](../README.md#Token) - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: application/json - -[[Back to top]](#) [[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/docs/AnnotatedTag.md b/docs/AnnotatedTag.md deleted file mode 100644 index 69fec26..0000000 --- a/docs/AnnotatedTag.md +++ /dev/null @@ -1,18 +0,0 @@ -# AnnotatedTag - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**archive_download_count** | Option<[**models::TagArchiveDownloadCount**](TagArchiveDownloadCount.md)> | | [optional] -**message** | Option<**String**> | | [optional] -**object** | Option<[**models::AnnotatedTagObject**](AnnotatedTagObject.md)> | | [optional] -**sha** | Option<**String**> | | [optional] -**tag** | Option<**String**> | | [optional] -**tagger** | Option<[**models::CommitUser**](CommitUser.md)> | | [optional] -**url** | Option<**String**> | | [optional] -**verification** | Option<[**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/docs/AnnotatedTagObject.md b/docs/AnnotatedTagObject.md deleted file mode 100644 index 01837b9..0000000 --- a/docs/AnnotatedTagObject.md +++ /dev/null @@ -1,13 +0,0 @@ -# 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/docs/ApiError.md b/docs/ApiError.md deleted file mode 100644 index 94e66d5..0000000 --- a/docs/ApiError.md +++ /dev/null @@ -1,12 +0,0 @@ -# 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/docs/ApiForbiddenError.md b/docs/ApiForbiddenError.md deleted file mode 100644 index b786de3..0000000 --- a/docs/ApiForbiddenError.md +++ /dev/null @@ -1,12 +0,0 @@ -# ApiForbiddenError - -## 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/docs/ApiInternalServerError.md b/docs/ApiInternalServerError.md deleted file mode 100644 index 07fb4ac..0000000 --- a/docs/ApiInternalServerError.md +++ /dev/null @@ -1,12 +0,0 @@ -# ApiInternalServerError - -## 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/docs/ApiInvalidTopicsError.md b/docs/ApiInvalidTopicsError.md deleted file mode 100644 index 6bf2d24..0000000 --- a/docs/ApiInvalidTopicsError.md +++ /dev/null @@ -1,12 +0,0 @@ -# ApiInvalidTopicsError - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**invalid_topics** | Option<**Vec**> | | [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/docs/ApiNotFound.md b/docs/ApiNotFound.md deleted file mode 100644 index 18d5230..0000000 --- a/docs/ApiNotFound.md +++ /dev/null @@ -1,13 +0,0 @@ -# ApiNotFound - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**errors** | Option<**Vec**> | | [optional] -**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/docs/ApiRepoArchivedError.md b/docs/ApiRepoArchivedError.md deleted file mode 100644 index 5b2f93c..0000000 --- a/docs/ApiRepoArchivedError.md +++ /dev/null @@ -1,12 +0,0 @@ -# ApiRepoArchivedError - -## 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/docs/ApiUnauthorizedError.md b/docs/ApiUnauthorizedError.md deleted file mode 100644 index 6ce0171..0000000 --- a/docs/ApiUnauthorizedError.md +++ /dev/null @@ -1,12 +0,0 @@ -# ApiUnauthorizedError - -## 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/docs/ApiValidationError.md b/docs/ApiValidationError.md deleted file mode 100644 index e074c1a..0000000 --- a/docs/ApiValidationError.md +++ /dev/null @@ -1,12 +0,0 @@ -# ApiValidationError - -## 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/docs/Attachment.md b/docs/Attachment.md deleted file mode 100644 index d57ae79..0000000 --- a/docs/Attachment.md +++ /dev/null @@ -1,18 +0,0 @@ -# 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] -**r#type** | Option<**Type**> | (enum: attachment, external) | [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/docs/BlockedUser.md b/docs/BlockedUser.md deleted file mode 100644 index 0cd7f99..0000000 --- a/docs/BlockedUser.md +++ /dev/null @@ -1,12 +0,0 @@ -# BlockedUser - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**block_id** | Option<**i64**> | | [optional] -**created_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/docs/Branch.md b/docs/Branch.md deleted file mode 100644 index 4f50aa0..0000000 --- a/docs/Branch.md +++ /dev/null @@ -1,19 +0,0 @@ -# Branch - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**commit** | Option<[**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/docs/BranchProtection.md b/docs/BranchProtection.md deleted file mode 100644 index 6ecc625..0000000 --- a/docs/BranchProtection.md +++ /dev/null @@ -1,37 +0,0 @@ -# BranchProtection - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**apply_to_admins** | Option<**bool**> | | [optional] -**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**> | Deprecated: true | [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] -**ignore_stale_approvals** | 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] -**rule_name** | Option<**String**> | | [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/docs/ChangeFileOperation.md b/docs/ChangeFileOperation.md deleted file mode 100644 index e960e92..0000000 --- a/docs/ChangeFileOperation.md +++ /dev/null @@ -1,15 +0,0 @@ -# ChangeFileOperation - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**content** | Option<**String**> | new or updated file content, must be base64 encoded | [optional] -**from_path** | Option<**String**> | old path of the file to move | [optional] -**operation** | **Operation** | indicates what to do with the file (enum: create, update, delete) | -**path** | **String** | path to the existing or new file | -**sha** | Option<**String**> | sha is the SHA for the file that already exists, required for update or 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/docs/ChangeFilesOptions.md b/docs/ChangeFilesOptions.md deleted file mode 100644 index afee795..0000000 --- a/docs/ChangeFilesOptions.md +++ /dev/null @@ -1,18 +0,0 @@ -# ChangeFilesOptions - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**author** | Option<[**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<[**models::Identity**](Identity.md)> | | [optional] -**dates** | Option<[**models::CommitDateOptions**](CommitDateOptions.md)> | | [optional] -**files** | [**Vec**](ChangeFileOperation.md) | list of file operations | -**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/docs/ChangedFile.md b/docs/ChangedFile.md deleted file mode 100644 index 680133b..0000000 --- a/docs/ChangedFile.md +++ /dev/null @@ -1,19 +0,0 @@ -# ChangedFile - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**additions** | Option<**i64**> | | [optional] -**changes** | Option<**i64**> | | [optional] -**contents_url** | Option<**String**> | | [optional] -**deletions** | Option<**i64**> | | [optional] -**filename** | Option<**String**> | | [optional] -**html_url** | Option<**String**> | | [optional] -**previous_filename** | Option<**String**> | | [optional] -**raw_url** | Option<**String**> | | [optional] -**status** | 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/docs/CombinedStatus.md b/docs/CombinedStatus.md deleted file mode 100644 index 5adaf8f..0000000 --- a/docs/CombinedStatus.md +++ /dev/null @@ -1,17 +0,0 @@ -# CombinedStatus - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**commit_url** | Option<**String**> | | [optional] -**repository** | Option<[**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/docs/Comment.md b/docs/Comment.md deleted file mode 100644 index fcf0484..0000000 --- a/docs/Comment.md +++ /dev/null @@ -1,21 +0,0 @@ -# Comment - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**assets** | Option<[**Vec**](Attachment.md)> | | [optional] -**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<[**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/docs/Commit.md b/docs/Commit.md deleted file mode 100644 index 6bc6fd8..0000000 --- a/docs/Commit.md +++ /dev/null @@ -1,20 +0,0 @@ -# Commit - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**author** | Option<[**models::User**](User.md)> | | [optional] -**commit** | Option<[**models::RepoCommit**](RepoCommit.md)> | | [optional] -**committer** | Option<[**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<[**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/docs/CommitAffectedFiles.md b/docs/CommitAffectedFiles.md deleted file mode 100644 index 04ca21e..0000000 --- a/docs/CommitAffectedFiles.md +++ /dev/null @@ -1,12 +0,0 @@ -# CommitAffectedFiles - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**filename** | Option<**String**> | | [optional] -**status** | 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/docs/CommitDateOptions.md b/docs/CommitDateOptions.md deleted file mode 100644 index b118f48..0000000 --- a/docs/CommitDateOptions.md +++ /dev/null @@ -1,12 +0,0 @@ -# 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/docs/CommitMeta.md b/docs/CommitMeta.md deleted file mode 100644 index e026016..0000000 --- a/docs/CommitMeta.md +++ /dev/null @@ -1,13 +0,0 @@ -# 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/docs/CommitStats.md b/docs/CommitStats.md deleted file mode 100644 index 1ebf9e2..0000000 --- a/docs/CommitStats.md +++ /dev/null @@ -1,13 +0,0 @@ -# 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/docs/CommitStatus.md b/docs/CommitStatus.md deleted file mode 100644 index e78b65b..0000000 --- a/docs/CommitStatus.md +++ /dev/null @@ -1,19 +0,0 @@ -# CommitStatus - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**context** | Option<**String**> | | [optional] -**created_at** | Option<**String**> | | [optional] -**creator** | Option<[**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/docs/CommitUser.md b/docs/CommitUser.md deleted file mode 100644 index cafe69d..0000000 --- a/docs/CommitUser.md +++ /dev/null @@ -1,13 +0,0 @@ -# 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/docs/Compare.md b/docs/Compare.md deleted file mode 100644 index 3b3618f..0000000 --- a/docs/Compare.md +++ /dev/null @@ -1,13 +0,0 @@ -# Compare - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**commits** | Option<[**Vec**](Commit.md)> | | [optional] -**files** | Option<[**Vec**](CommitAffectedFiles.md)> | | [optional] -**total_commits** | 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/docs/ContentsResponse.md b/docs/ContentsResponse.md deleted file mode 100644 index 6fe7047..0000000 --- a/docs/ContentsResponse.md +++ /dev/null @@ -1,26 +0,0 @@ -# ContentsResponse - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**_links** | Option<[**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] -**last_commit_sha** | Option<**String**> | | [optional] -**last_commit_when** | 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/docs/CreateAccessTokenOption.md b/docs/CreateAccessTokenOption.md deleted file mode 100644 index 604b7d9..0000000 --- a/docs/CreateAccessTokenOption.md +++ /dev/null @@ -1,12 +0,0 @@ -# CreateAccessTokenOption - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**name** | **String** | | -**scopes** | 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/docs/CreateBranchProtectionOption.md b/docs/CreateBranchProtectionOption.md deleted file mode 100644 index 44f565e..0000000 --- a/docs/CreateBranchProtectionOption.md +++ /dev/null @@ -1,35 +0,0 @@ -# CreateBranchProtectionOption - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**apply_to_admins** | Option<**bool**> | | [optional] -**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**> | Deprecated: true | [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] -**ignore_stale_approvals** | 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] -**rule_name** | Option<**String**> | | [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/docs/CreateBranchRepoOption.md b/docs/CreateBranchRepoOption.md deleted file mode 100644 index d46da8e..0000000 --- a/docs/CreateBranchRepoOption.md +++ /dev/null @@ -1,13 +0,0 @@ -# CreateBranchRepoOption - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**new_branch_name** | **String** | Name of the branch to create | -**old_branch_name** | Option<**String**> | Deprecated: true Name of the old branch to create from | [optional] -**old_ref_name** | Option<**String**> | Name of the old branch/tag/commit 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/docs/CreateEmailOption.md b/docs/CreateEmailOption.md deleted file mode 100644 index 1224abf..0000000 --- a/docs/CreateEmailOption.md +++ /dev/null @@ -1,11 +0,0 @@ -# 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/docs/CreateFileOptions.md b/docs/CreateFileOptions.md deleted file mode 100644 index ff20b70..0000000 --- a/docs/CreateFileOptions.md +++ /dev/null @@ -1,18 +0,0 @@ -# CreateFileOptions - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**author** | Option<[**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<[**models::Identity**](Identity.md)> | | [optional] -**content** | **String** | content must be base64 encoded | -**dates** | Option<[**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/docs/CreateForkOption.md b/docs/CreateForkOption.md deleted file mode 100644 index f24a7cc..0000000 --- a/docs/CreateForkOption.md +++ /dev/null @@ -1,12 +0,0 @@ -# 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/docs/CreateGpgKeyOption.md b/docs/CreateGpgKeyOption.md deleted file mode 100644 index a96e002..0000000 --- a/docs/CreateGpgKeyOption.md +++ /dev/null @@ -1,12 +0,0 @@ -# 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/docs/CreateHookOption.md b/docs/CreateHookOption.md deleted file mode 100644 index 9c0e765..0000000 --- a/docs/CreateHookOption.md +++ /dev/null @@ -1,16 +0,0 @@ -# CreateHookOption - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**active** | Option<**bool**> | | [optional][default to false] -**authorization_header** | Option<**String**> | | [optional] -**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** | **Type** | (enum: forgejo, dingtalk, discord, gitea, gogs, msteams, slack, telegram, feishu, wechatwork, packagist) | - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/docs/CreateIssueCommentOption.md b/docs/CreateIssueCommentOption.md deleted file mode 100644 index 5e00325..0000000 --- a/docs/CreateIssueCommentOption.md +++ /dev/null @@ -1,12 +0,0 @@ -# CreateIssueCommentOption - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**body** | **String** | | -**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/docs/CreateIssueOption.md b/docs/CreateIssueOption.md deleted file mode 100644 index 08e71d6..0000000 --- a/docs/CreateIssueOption.md +++ /dev/null @@ -1,19 +0,0 @@ -# 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/docs/CreateKeyOption.md b/docs/CreateKeyOption.md deleted file mode 100644 index cdab8a1..0000000 --- a/docs/CreateKeyOption.md +++ /dev/null @@ -1,13 +0,0 @@ -# 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/docs/CreateLabelOption.md b/docs/CreateLabelOption.md deleted file mode 100644 index 4db4045..0000000 --- a/docs/CreateLabelOption.md +++ /dev/null @@ -1,15 +0,0 @@ -# CreateLabelOption - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**color** | **String** | | -**description** | Option<**String**> | | [optional] -**exclusive** | Option<**bool**> | | [optional] -**is_archived** | Option<**bool**> | | [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/docs/CreateMilestoneOption.md b/docs/CreateMilestoneOption.md deleted file mode 100644 index bd356db..0000000 --- a/docs/CreateMilestoneOption.md +++ /dev/null @@ -1,14 +0,0 @@ -# CreateMilestoneOption - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**description** | Option<**String**> | | [optional] -**due_on** | Option<**String**> | | [optional] -**state** | Option<**State**> | (enum: open, closed) | [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/docs/CreateOAuth2ApplicationOptions.md b/docs/CreateOAuth2ApplicationOptions.md deleted file mode 100644 index da5608c..0000000 --- a/docs/CreateOAuth2ApplicationOptions.md +++ /dev/null @@ -1,13 +0,0 @@ -# CreateOAuth2ApplicationOptions - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**confidential_client** | Option<**bool**> | | [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/docs/CreateOrUpdateSecretOption.md b/docs/CreateOrUpdateSecretOption.md deleted file mode 100644 index 0bebb3d..0000000 --- a/docs/CreateOrUpdateSecretOption.md +++ /dev/null @@ -1,11 +0,0 @@ -# CreateOrUpdateSecretOption - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**data** | **String** | Data of the secret to update | - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/docs/CreateOrgOption.md b/docs/CreateOrgOption.md deleted file mode 100644 index d398d89..0000000 --- a/docs/CreateOrgOption.md +++ /dev/null @@ -1,18 +0,0 @@ -# CreateOrgOption - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**description** | Option<**String**> | | [optional] -**email** | Option<**String**> | | [optional] -**full_name** | Option<**String**> | | [optional] -**location** | Option<**String**> | | [optional] -**repo_admin_change_team_access** | Option<**bool**> | | [optional] -**username** | **String** | | -**visibility** | Option<**Visibility**> | possible values are `public` (default), `limited` or `private` (enum: public, limited, 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/docs/CreatePullRequestOption.md b/docs/CreatePullRequestOption.md deleted file mode 100644 index 1028806..0000000 --- a/docs/CreatePullRequestOption.md +++ /dev/null @@ -1,19 +0,0 @@ -# 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/docs/CreatePullReviewComment.md b/docs/CreatePullReviewComment.md deleted file mode 100644 index 62985a9..0000000 --- a/docs/CreatePullReviewComment.md +++ /dev/null @@ -1,14 +0,0 @@ -# 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/docs/CreatePullReviewOptions.md b/docs/CreatePullReviewOptions.md deleted file mode 100644 index 7e3331b..0000000 --- a/docs/CreatePullReviewOptions.md +++ /dev/null @@ -1,14 +0,0 @@ -# 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/docs/CreatePushMirrorOption.md b/docs/CreatePushMirrorOption.md deleted file mode 100644 index a0baa9f..0000000 --- a/docs/CreatePushMirrorOption.md +++ /dev/null @@ -1,17 +0,0 @@ -# CreatePushMirrorOption - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**branch_filter** | Option<**String**> | | [optional] -**interval** | Option<**String**> | | [optional] -**remote_address** | Option<**String**> | | [optional] -**remote_password** | Option<**String**> | | [optional] -**remote_username** | Option<**String**> | | [optional] -**sync_on_commit** | Option<**bool**> | | [optional] -**use_ssh** | 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/docs/CreateQuotaGroupOptions.md b/docs/CreateQuotaGroupOptions.md deleted file mode 100644 index 4a5abe5..0000000 --- a/docs/CreateQuotaGroupOptions.md +++ /dev/null @@ -1,12 +0,0 @@ -# CreateQuotaGroupOptions - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**name** | Option<**String**> | Name of the quota group to create | [optional] -**rules** | Option<[**Vec**](CreateQuotaRuleOptions.md)> | Rules to add to the newly created group. If a rule does not exist, it will be created. | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/docs/CreateQuotaRuleOptions.md b/docs/CreateQuotaRuleOptions.md deleted file mode 100644 index 167b2f1..0000000 --- a/docs/CreateQuotaRuleOptions.md +++ /dev/null @@ -1,13 +0,0 @@ -# CreateQuotaRuleOptions - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**limit** | Option<**i64**> | The limit set by the rule | [optional] -**name** | Option<**String**> | Name of the rule to create | [optional] -**subjects** | Option<**Vec**> | The subjects affected by the rule | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/docs/CreateReleaseOption.md b/docs/CreateReleaseOption.md deleted file mode 100644 index fae07ab..0000000 --- a/docs/CreateReleaseOption.md +++ /dev/null @@ -1,17 +0,0 @@ -# CreateReleaseOption - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**body** | Option<**String**> | | [optional] -**draft** | Option<**bool**> | | [optional] -**hide_archive_links** | 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/docs/CreateRepoOption.md b/docs/CreateRepoOption.md deleted file mode 100644 index 09763cc..0000000 --- a/docs/CreateRepoOption.md +++ /dev/null @@ -1,22 +0,0 @@ -# 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 | -**object_format_name** | Option<**ObjectFormatName**> | ObjectFormatName of the underlying git repository (enum: sha1, sha256) | [optional] -**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<**TrustModel**> | TrustModel of the repository (enum: default, collaborator, committer, collaboratorcommitter) | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/docs/CreateStatusOption.md b/docs/CreateStatusOption.md deleted file mode 100644 index 81cad3a..0000000 --- a/docs/CreateStatusOption.md +++ /dev/null @@ -1,14 +0,0 @@ -# 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/docs/CreateTagOption.md b/docs/CreateTagOption.md deleted file mode 100644 index 475f578..0000000 --- a/docs/CreateTagOption.md +++ /dev/null @@ -1,13 +0,0 @@ -# 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/docs/CreateTagProtectionOption.md b/docs/CreateTagProtectionOption.md deleted file mode 100644 index 847480a..0000000 --- a/docs/CreateTagProtectionOption.md +++ /dev/null @@ -1,13 +0,0 @@ -# CreateTagProtectionOption - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**name_pattern** | Option<**String**> | | [optional] -**whitelist_teams** | Option<**Vec**> | | [optional] -**whitelist_usernames** | 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/docs/CreateTeamOption.md b/docs/CreateTeamOption.md deleted file mode 100644 index 535c009..0000000 --- a/docs/CreateTeamOption.md +++ /dev/null @@ -1,17 +0,0 @@ -# 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<**Permission**> | (enum: read, write, admin) | [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/docs/CreateUserOption.md b/docs/CreateUserOption.md deleted file mode 100644 index 56b0d9d..0000000 --- a/docs/CreateUserOption.md +++ /dev/null @@ -1,21 +0,0 @@ -# CreateUserOption - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**created_at** | Option<**String**> | For explicitly setting the user creation timestamp. Useful when users are migrated from other systems. When omitted, the user's creation timestamp will be set to \"now\". | [optional] -**email** | **String** | | -**full_name** | Option<**String**> | | [optional] -**login_name** | Option<**String**> | | [optional] -**must_change_password** | Option<**bool**> | | [optional] -**password** | Option<**String**> | | [optional] -**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/docs/CreateVariableOption.md b/docs/CreateVariableOption.md deleted file mode 100644 index efce49f..0000000 --- a/docs/CreateVariableOption.md +++ /dev/null @@ -1,11 +0,0 @@ -# CreateVariableOption - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**value** | **String** | Value of the variable to create | - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/docs/CreateWikiPageOptions.md b/docs/CreateWikiPageOptions.md deleted file mode 100644 index 3b90c8d..0000000 --- a/docs/CreateWikiPageOptions.md +++ /dev/null @@ -1,13 +0,0 @@ -# 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/docs/Cron.md b/docs/Cron.md deleted file mode 100644 index 5fc02c3..0000000 --- a/docs/Cron.md +++ /dev/null @@ -1,15 +0,0 @@ -# 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/docs/DeleteEmailOption.md b/docs/DeleteEmailOption.md deleted file mode 100644 index 0c15e6e..0000000 --- a/docs/DeleteEmailOption.md +++ /dev/null @@ -1,11 +0,0 @@ -# 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/docs/DeleteFileOptions.md b/docs/DeleteFileOptions.md deleted file mode 100644 index c17bdc5..0000000 --- a/docs/DeleteFileOptions.md +++ /dev/null @@ -1,18 +0,0 @@ -# DeleteFileOptions - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**author** | Option<[**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<[**models::Identity**](Identity.md)> | | [optional] -**dates** | Option<[**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/docs/DeleteLabelsOption.md b/docs/DeleteLabelsOption.md deleted file mode 100644 index 04a15b7..0000000 --- a/docs/DeleteLabelsOption.md +++ /dev/null @@ -1,11 +0,0 @@ -# DeleteLabelsOption - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**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/docs/DeployKey.md b/docs/DeployKey.md deleted file mode 100644 index 8167696..0000000 --- a/docs/DeployKey.md +++ /dev/null @@ -1,19 +0,0 @@ -# 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<[**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/docs/DismissPullReviewOptions.md b/docs/DismissPullReviewOptions.md deleted file mode 100644 index 58cbdb7..0000000 --- a/docs/DismissPullReviewOptions.md +++ /dev/null @@ -1,12 +0,0 @@ -# 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/docs/DispatchWorkflowOption.md b/docs/DispatchWorkflowOption.md deleted file mode 100644 index dd01ac6..0000000 --- a/docs/DispatchWorkflowOption.md +++ /dev/null @@ -1,13 +0,0 @@ -# DispatchWorkflowOption - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**inputs** | Option<**std::collections::HashMap**> | Input keys and values configured in the workflow file. | [optional] -**r#ref** | **String** | Git reference for the workflow | -**return_run_info** | Option<**bool**> | Flag to return the run info | [optional][default to false] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/docs/DispatchWorkflowRun.md b/docs/DispatchWorkflowRun.md deleted file mode 100644 index 4fc758b..0000000 --- a/docs/DispatchWorkflowRun.md +++ /dev/null @@ -1,13 +0,0 @@ -# DispatchWorkflowRun - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**id** | Option<**i64**> | the workflow run id | [optional] -**jobs** | Option<**Vec**> | the jobs name | [optional] -**run_number** | Option<**i64**> | a unique number for each run of a 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/docs/EditAttachmentOptions.md b/docs/EditAttachmentOptions.md deleted file mode 100644 index 14b5972..0000000 --- a/docs/EditAttachmentOptions.md +++ /dev/null @@ -1,12 +0,0 @@ -# EditAttachmentOptions - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**browser_download_url** | Option<**String**> | (Can only be set if existing attachment is of external type) | [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/docs/EditBranchProtectionOption.md b/docs/EditBranchProtectionOption.md deleted file mode 100644 index 65edf57..0000000 --- a/docs/EditBranchProtectionOption.md +++ /dev/null @@ -1,33 +0,0 @@ -# EditBranchProtectionOption - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**apply_to_admins** | Option<**bool**> | | [optional] -**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] -**ignore_stale_approvals** | 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/docs/EditDeadlineOption.md b/docs/EditDeadlineOption.md deleted file mode 100644 index 2924880..0000000 --- a/docs/EditDeadlineOption.md +++ /dev/null @@ -1,11 +0,0 @@ -# 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/docs/EditGitHookOption.md b/docs/EditGitHookOption.md deleted file mode 100644 index 01bd2a8..0000000 --- a/docs/EditGitHookOption.md +++ /dev/null @@ -1,11 +0,0 @@ -# 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/docs/EditHookOption.md b/docs/EditHookOption.md deleted file mode 100644 index f62d9ce..0000000 --- a/docs/EditHookOption.md +++ /dev/null @@ -1,15 +0,0 @@ -# EditHookOption - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**active** | Option<**bool**> | | [optional] -**authorization_header** | Option<**String**> | | [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/docs/EditIssueCommentOption.md b/docs/EditIssueCommentOption.md deleted file mode 100644 index 05f5501..0000000 --- a/docs/EditIssueCommentOption.md +++ /dev/null @@ -1,12 +0,0 @@ -# EditIssueCommentOption - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**body** | **String** | | -**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/docs/EditIssueOption.md b/docs/EditIssueOption.md deleted file mode 100644 index a08b665..0000000 --- a/docs/EditIssueOption.md +++ /dev/null @@ -1,20 +0,0 @@ -# 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] -**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/docs/EditLabelOption.md b/docs/EditLabelOption.md deleted file mode 100644 index 6385abe..0000000 --- a/docs/EditLabelOption.md +++ /dev/null @@ -1,15 +0,0 @@ -# EditLabelOption - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**color** | Option<**String**> | | [optional] -**description** | Option<**String**> | | [optional] -**exclusive** | Option<**bool**> | | [optional] -**is_archived** | 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/docs/EditMilestoneOption.md b/docs/EditMilestoneOption.md deleted file mode 100644 index e266c1c..0000000 --- a/docs/EditMilestoneOption.md +++ /dev/null @@ -1,14 +0,0 @@ -# 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/docs/EditOrgOption.md b/docs/EditOrgOption.md deleted file mode 100644 index e97f5be..0000000 --- a/docs/EditOrgOption.md +++ /dev/null @@ -1,17 +0,0 @@ -# EditOrgOption - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**description** | Option<**String**> | | [optional] -**email** | Option<**String**> | | [optional] -**full_name** | Option<**String**> | | [optional] -**location** | Option<**String**> | | [optional] -**repo_admin_change_team_access** | Option<**bool**> | | [optional] -**visibility** | Option<**Visibility**> | possible values are `public`, `limited` or `private` (enum: public, limited, 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/docs/EditPullRequestOption.md b/docs/EditPullRequestOption.md deleted file mode 100644 index fe31231..0000000 --- a/docs/EditPullRequestOption.md +++ /dev/null @@ -1,21 +0,0 @@ -# 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/docs/EditQuotaRuleOptions.md b/docs/EditQuotaRuleOptions.md deleted file mode 100644 index 5cb1dfa..0000000 --- a/docs/EditQuotaRuleOptions.md +++ /dev/null @@ -1,12 +0,0 @@ -# EditQuotaRuleOptions - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**limit** | Option<**i64**> | The limit set by the rule | [optional] -**subjects** | Option<**Vec**> | The subjects affected by the rule | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/docs/EditReactionOption.md b/docs/EditReactionOption.md deleted file mode 100644 index 6f01410..0000000 --- a/docs/EditReactionOption.md +++ /dev/null @@ -1,11 +0,0 @@ -# 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/docs/EditReleaseOption.md b/docs/EditReleaseOption.md deleted file mode 100644 index adbc849..0000000 --- a/docs/EditReleaseOption.md +++ /dev/null @@ -1,17 +0,0 @@ -# EditReleaseOption - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**body** | Option<**String**> | | [optional] -**draft** | Option<**bool**> | | [optional] -**hide_archive_links** | 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/docs/EditRepoOption.md b/docs/EditRepoOption.md deleted file mode 100644 index 8291e2c..0000000 --- a/docs/EditRepoOption.md +++ /dev/null @@ -1,44 +0,0 @@ -# EditRepoOption - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**allow_fast_forward_only_merge** | Option<**bool**> | either `true` to allow fast-forward-only merging pull requests, or `false` to prevent fast-forward-only merging. | [optional] -**allow_manual_merge** | Option<**bool**> | either `true` to allow mark pr as merged manually, or `false` to prevent it. | [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. | [optional] -**allow_rebase** | Option<**bool**> | either `true` to allow rebase-merging pull requests, or `false` to prevent rebase-merging. | [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. | [optional] -**allow_rebase_update** | Option<**bool**> | either `true` to allow updating pull request branch by rebase, or `false` to prevent it. | [optional] -**allow_squash_merge** | Option<**bool**> | either `true` to allow squash-merging pull requests, or `false` to prevent squash-merging. | [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. Note: In some special cases, misjudgments can occur. | [optional] -**default_allow_maintainer_edit** | Option<**bool**> | set to `true` to allow edits from maintainers by default | [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\", \"squash\", \"fast-forward-only\", \"manually-merged\", or \"rebase-update-only\". | [optional] -**default_update_style** | Option<**String**> | set to a update style to be used by this repository: \"rebase\" or \"merge\" | [optional] -**description** | Option<**String**> | a short description of the repository. | [optional] -**enable_prune** | Option<**bool**> | enable prune - remove obsolete remote-tracking references when mirroring | [optional] -**external_tracker** | Option<[**models::ExternalTracker**](ExternalTracker.md)> | | [optional] -**external_wiki** | Option<[**models::ExternalWiki**](ExternalWiki.md)> | | [optional] -**globally_editable_wiki** | Option<**bool**> | set the globally editable state of the wiki | [optional] -**has_actions** | Option<**bool**> | either `true` to enable actions unit, or `false` to disable them. | [optional] -**has_issues** | Option<**bool**> | either `true` to enable issues for this repository or `false` to disable them. | [optional] -**has_packages** | Option<**bool**> | either `true` to enable packages unit, 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_releases** | Option<**bool**> | either `true` to enable releases unit, or `false` to disable them. | [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. | [optional] -**internal_tracker** | Option<[**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] -**wiki_branch** | Option<**String**> | sets the branch used for this repository's 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/docs/EditTagProtectionOption.md b/docs/EditTagProtectionOption.md deleted file mode 100644 index 906ac9a..0000000 --- a/docs/EditTagProtectionOption.md +++ /dev/null @@ -1,13 +0,0 @@ -# EditTagProtectionOption - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**name_pattern** | Option<**String**> | | [optional] -**whitelist_teams** | Option<**Vec**> | | [optional] -**whitelist_usernames** | 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/docs/EditTeamOption.md b/docs/EditTeamOption.md deleted file mode 100644 index cacb70d..0000000 --- a/docs/EditTeamOption.md +++ /dev/null @@ -1,17 +0,0 @@ -# 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<**Permission**> | (enum: read, write, admin) | [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/docs/EditUserOption.md b/docs/EditUserOption.md deleted file mode 100644 index fec62cb..0000000 --- a/docs/EditUserOption.md +++ /dev/null @@ -1,30 +0,0 @@ -# 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] -**hide_email** | Option<**bool**> | | [optional] -**location** | Option<**String**> | | [optional] -**login_name** | Option<**String**> | | [optional] -**max_repo_creation** | Option<**i64**> | | [optional] -**must_change_password** | Option<**bool**> | | [optional] -**password** | Option<**String**> | | [optional] -**prohibit_login** | Option<**bool**> | | [optional] -**pronouns** | Option<**String**> | | [optional] -**restricted** | Option<**bool**> | | [optional] -**source_id** | Option<**i64**> | | [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/docs/Email.md b/docs/Email.md deleted file mode 100644 index 0b0d7f7..0000000 --- a/docs/Email.md +++ /dev/null @@ -1,15 +0,0 @@ -# Email - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**email** | Option<**String**> | | [optional] -**primary** | Option<**bool**> | | [optional] -**user_id** | Option<**i64**> | | [optional] -**username** | 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/docs/ExternalTracker.md b/docs/ExternalTracker.md deleted file mode 100644 index 11ba791..0000000 --- a/docs/ExternalTracker.md +++ /dev/null @@ -1,14 +0,0 @@ -# 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_regexp_pattern** | Option<**String**> | External Issue Tracker issue regular expression | [optional] -**external_tracker_style** | Option<**String**> | External Issue Tracker Number Format, either `numeric`, `alphanumeric`, or `regexp` | [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/docs/ExternalWiki.md b/docs/ExternalWiki.md deleted file mode 100644 index 73c0abd..0000000 --- a/docs/ExternalWiki.md +++ /dev/null @@ -1,11 +0,0 @@ -# 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/docs/FileCommitResponse.md b/docs/FileCommitResponse.md deleted file mode 100644 index 300ca9f..0000000 --- a/docs/FileCommitResponse.md +++ /dev/null @@ -1,19 +0,0 @@ -# FileCommitResponse - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**author** | Option<[**models::CommitUser**](CommitUser.md)> | | [optional] -**committer** | Option<[**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<[**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/docs/FileDeleteResponse.md b/docs/FileDeleteResponse.md deleted file mode 100644 index ef7e876..0000000 --- a/docs/FileDeleteResponse.md +++ /dev/null @@ -1,13 +0,0 @@ -# FileDeleteResponse - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**commit** | Option<[**models::FileCommitResponse**](FileCommitResponse.md)> | | [optional] -**content** | Option<**serde_json::Value**> | | [optional] -**verification** | Option<[**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/docs/FileLinksResponse.md b/docs/FileLinksResponse.md deleted file mode 100644 index c6f1372..0000000 --- a/docs/FileLinksResponse.md +++ /dev/null @@ -1,13 +0,0 @@ -# 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/docs/FileResponse.md b/docs/FileResponse.md deleted file mode 100644 index b9a0a3f..0000000 --- a/docs/FileResponse.md +++ /dev/null @@ -1,13 +0,0 @@ -# FileResponse - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**commit** | Option<[**models::FileCommitResponse**](FileCommitResponse.md)> | | [optional] -**content** | Option<[**models::ContentsResponse**](ContentsResponse.md)> | | [optional] -**verification** | Option<[**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/docs/FilesResponse.md b/docs/FilesResponse.md deleted file mode 100644 index cd78f4a..0000000 --- a/docs/FilesResponse.md +++ /dev/null @@ -1,13 +0,0 @@ -# FilesResponse - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**commit** | Option<[**models::FileCommitResponse**](FileCommitResponse.md)> | | [optional] -**files** | Option<[**Vec**](ContentsResponse.md)> | | [optional] -**verification** | Option<[**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/docs/GeneralApiSettings.md b/docs/GeneralApiSettings.md deleted file mode 100644 index 70a12c7..0000000 --- a/docs/GeneralApiSettings.md +++ /dev/null @@ -1,14 +0,0 @@ -# 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/docs/GeneralAttachmentSettings.md b/docs/GeneralAttachmentSettings.md deleted file mode 100644 index 3597dc2..0000000 --- a/docs/GeneralAttachmentSettings.md +++ /dev/null @@ -1,14 +0,0 @@ -# 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/docs/GeneralRepoSettings.md b/docs/GeneralRepoSettings.md deleted file mode 100644 index 7b36fcc..0000000 --- a/docs/GeneralRepoSettings.md +++ /dev/null @@ -1,17 +0,0 @@ -# GeneralRepoSettings - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**forks_disabled** | Option<**bool**> | | [optional] -**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/docs/GeneralUiSettings.md b/docs/GeneralUiSettings.md deleted file mode 100644 index bdec13d..0000000 --- a/docs/GeneralUiSettings.md +++ /dev/null @@ -1,13 +0,0 @@ -# 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/docs/GenerateRepoOption.md b/docs/GenerateRepoOption.md deleted file mode 100644 index 997d4ef..0000000 --- a/docs/GenerateRepoOption.md +++ /dev/null @@ -1,22 +0,0 @@ -# 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] -**protected_branch** | Option<**bool**> | include protected branches in template repo | [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/docs/GitBlob.md b/docs/GitBlob.md deleted file mode 100644 index 8c8de9c..0000000 --- a/docs/GitBlob.md +++ /dev/null @@ -1,15 +0,0 @@ -# GitBlob - -## 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/docs/GitEntry.md b/docs/GitEntry.md deleted file mode 100644 index c0acd13..0000000 --- a/docs/GitEntry.md +++ /dev/null @@ -1,16 +0,0 @@ -# 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/docs/GitHook.md b/docs/GitHook.md deleted file mode 100644 index 9d52a95..0000000 --- a/docs/GitHook.md +++ /dev/null @@ -1,13 +0,0 @@ -# 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/docs/GitObject.md b/docs/GitObject.md deleted file mode 100644 index 4ed7c79..0000000 --- a/docs/GitObject.md +++ /dev/null @@ -1,13 +0,0 @@ -# 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/docs/GitTreeResponse.md b/docs/GitTreeResponse.md deleted file mode 100644 index 390705d..0000000 --- a/docs/GitTreeResponse.md +++ /dev/null @@ -1,16 +0,0 @@ -# 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/docs/GitignoreTemplateInfo.md b/docs/GitignoreTemplateInfo.md deleted file mode 100644 index 67edca5..0000000 --- a/docs/GitignoreTemplateInfo.md +++ /dev/null @@ -1,12 +0,0 @@ -# GitignoreTemplateInfo - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**name** | Option<**String**> | | [optional] -**source** | 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/docs/GpgKey.md b/docs/GpgKey.md deleted file mode 100644 index 608c7b4..0000000 --- a/docs/GpgKey.md +++ /dev/null @@ -1,23 +0,0 @@ -# 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/docs/GpgKeyEmail.md b/docs/GpgKeyEmail.md deleted file mode 100644 index 191cd58..0000000 --- a/docs/GpgKeyEmail.md +++ /dev/null @@ -1,12 +0,0 @@ -# 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/docs/Hook.md b/docs/Hook.md deleted file mode 100644 index f74a62d..0000000 --- a/docs/Hook.md +++ /dev/null @@ -1,22 +0,0 @@ -# Hook - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**active** | Option<**bool**> | | [optional] -**authorization_header** | Option<**String**> | | [optional] -**branch_filter** | Option<**String**> | | [optional] -**config** | Option<**std::collections::HashMap**> | Deprecated: use Metadata instead | [optional] -**content_type** | Option<**String**> | | [optional] -**created_at** | Option<**String**> | | [optional] -**events** | Option<**Vec**> | | [optional] -**id** | Option<**i64**> | | [optional] -**metadata** | Option<**serde_json::Value**> | | [optional] -**r#type** | 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/docs/Identity.md b/docs/Identity.md deleted file mode 100644 index 3f1e0a2..0000000 --- a/docs/Identity.md +++ /dev/null @@ -1,12 +0,0 @@ -# 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/docs/InternalTracker.md b/docs/InternalTracker.md deleted file mode 100644 index 6daf626..0000000 --- a/docs/InternalTracker.md +++ /dev/null @@ -1,13 +0,0 @@ -# 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/docs/Issue.md b/docs/Issue.md deleted file mode 100644 index da68428..0000000 --- a/docs/Issue.md +++ /dev/null @@ -1,35 +0,0 @@ -# Issue - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**assets** | Option<[**Vec**](Attachment.md)> | | [optional] -**assignee** | Option<[**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<[**models::Milestone**](Milestone.md)> | | [optional] -**number** | Option<**i64**> | | [optional] -**original_author** | Option<**String**> | | [optional] -**original_author_id** | Option<**i64**> | | [optional] -**pin_order** | Option<**i64**> | | [optional] -**pull_request** | Option<[**models::PullRequestMeta**](PullRequestMeta.md)> | | [optional] -**r#ref** | Option<**String**> | | [optional] -**repository** | Option<[**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<[**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/docs/IssueApi.md b/docs/IssueApi.md deleted file mode 100644 index fc6ad35..0000000 --- a/docs/IssueApi.md +++ /dev/null @@ -1,2180 +0,0 @@ -# \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_issue_attachment**](IssueApi.md#issue_create_issue_attachment) | **POST** /repos/{owner}/{repo}/issues/{index}/assets | Create an issue attachment -[**issue_create_issue_blocking**](IssueApi.md#issue_create_issue_blocking) | **POST** /repos/{owner}/{repo}/issues/{index}/blocks | Block the issue given in the body by the issue in path -[**issue_create_issue_comment_attachment**](IssueApi.md#issue_create_issue_comment_attachment) | **POST** /repos/{owner}/{repo}/issues/comments/{id}/assets | Create a comment attachment -[**issue_create_issue_dependencies**](IssueApi.md#issue_create_issue_dependencies) | **POST** /repos/{owner}/{repo}/issues/{index}/dependencies | Make the issue in the url depend on the issue in the form. -[**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_attachment**](IssueApi.md#issue_delete_issue_attachment) | **DELETE** /repos/{owner}/{repo}/issues/{index}/assets/{attachment_id} | Delete an issue attachment -[**issue_delete_issue_comment_attachment**](IssueApi.md#issue_delete_issue_comment_attachment) | **DELETE** /repos/{owner}/{repo}/issues/comments/{id}/assets/{attachment_id} | Delete a comment attachment -[**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_attachment**](IssueApi.md#issue_edit_issue_attachment) | **PATCH** /repos/{owner}/{repo}/issues/{index}/assets/{attachment_id} | Edit an issue attachment -[**issue_edit_issue_comment_attachment**](IssueApi.md#issue_edit_issue_comment_attachment) | **PATCH** /repos/{owner}/{repo}/issues/comments/{id}/assets/{attachment_id} | Edit a comment attachment -[**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_attachment**](IssueApi.md#issue_get_issue_attachment) | **GET** /repos/{owner}/{repo}/issues/{index}/assets/{attachment_id} | Get an issue attachment -[**issue_get_issue_comment_attachment**](IssueApi.md#issue_get_issue_comment_attachment) | **GET** /repos/{owner}/{repo}/issues/comments/{id}/assets/{attachment_id} | Get a comment attachment -[**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_blocks**](IssueApi.md#issue_list_blocks) | **GET** /repos/{owner}/{repo}/issues/{index}/blocks | List issues that are blocked by this issue -[**issue_list_issue_attachments**](IssueApi.md#issue_list_issue_attachments) | **GET** /repos/{owner}/{repo}/issues/{index}/assets | List issue's attachments -[**issue_list_issue_comment_attachments**](IssueApi.md#issue_list_issue_comment_attachments) | **GET** /repos/{owner}/{repo}/issues/comments/{id}/assets | List comment's attachments -[**issue_list_issue_dependencies**](IssueApi.md#issue_list_issue_dependencies) | **GET** /repos/{owner}/{repo}/issues/{index}/dependencies | List an issue's dependencies, i.e all issues that block this issue. -[**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_issue_blocking**](IssueApi.md#issue_remove_issue_blocking) | **DELETE** /repos/{owner}/{repo}/issues/{index}/blocks | Unblock the issue given in the body by the issue in path -[**issue_remove_issue_dependencies**](IssueApi.md#issue_remove_issue_dependencies) | **DELETE** /repos/{owner}/{repo}/issues/{index}/dependencies | Remove an issue dependency -[**issue_remove_label**](IssueApi.md#issue_remove_label) | **DELETE** /repos/{owner}/{repo}/issues/{index}/labels/{identifier} | 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 -[**move_issue_pin**](IssueApi.md#move_issue_pin) | **PATCH** /repos/{owner}/{repo}/issues/{index}/pin/{position} | Moves the Pin to the given Position -[**pin_issue**](IssueApi.md#pin_issue) | **POST** /repos/{owner}/{repo}/issues/{index}/pin | Pin an Issue -[**unpin_issue**](IssueApi.md#unpin_issue) | **DELETE** /repos/{owner}/{repo}/issues/{index}/pin | Unpin an Issue - - - -## 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 - -[TOTPHeader](../README.md#TOTPHeader), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [SudoHeader](../README.md#SudoHeader), [BasicAuth](../README.md#BasicAuth), [AccessToken](../README.md#AccessToken), [SudoParam](../README.md#SudoParam), [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 - -[TOTPHeader](../README.md#TOTPHeader), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [SudoHeader](../README.md#SudoHeader), [BasicAuth](../README.md#BasicAuth), [AccessToken](../README.md#AccessToken), [SudoParam](../README.md#SudoParam), [Token](../README.md#Token) - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: application/json - -[[Back to top]](#) [[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 - -> 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 - -[**models::TrackedTime**](TrackedTime.md) - -### Authorization - -[TOTPHeader](../README.md#TOTPHeader), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [SudoHeader](../README.md#SudoHeader), [BasicAuth](../README.md#BasicAuth), [AccessToken](../README.md#AccessToken), [SudoParam](../README.md#SudoParam), [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 - -> 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 - -[**models::WatchInfo**](WatchInfo.md) - -### Authorization - -[TOTPHeader](../README.md#TOTPHeader), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [SudoHeader](../README.md#SudoHeader), [BasicAuth](../README.md#BasicAuth), [AccessToken](../README.md#AccessToken), [SudoParam](../README.md#SudoParam), [Token](../README.md#Token) - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: application/json - -[[Back to top]](#) [[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, body) -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] | -**body** | Option<[**DeleteLabelsOption**](DeleteLabelsOption.md)> | | | - -### Return type - - (empty response body) - -### Authorization - -[TOTPHeader](../README.md#TOTPHeader), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [SudoHeader](../README.md#SudoHeader), [BasicAuth](../README.md#BasicAuth), [AccessToken](../README.md#AccessToken), [SudoParam](../README.md#SudoParam), [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) - - -## issue_create_comment - -> 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 - -[**models::Comment**](Comment.md) - -### Authorization - -[TOTPHeader](../README.md#TOTPHeader), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [SudoHeader](../README.md#SudoHeader), [BasicAuth](../README.md#BasicAuth), [AccessToken](../README.md#AccessToken), [SudoParam](../README.md#SudoParam), [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 - -> 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 - -[**models::Issue**](Issue.md) - -### Authorization - -[TOTPHeader](../README.md#TOTPHeader), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [SudoHeader](../README.md#SudoHeader), [BasicAuth](../README.md#BasicAuth), [AccessToken](../README.md#AccessToken), [SudoParam](../README.md#SudoParam), [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_attachment - -> models::Attachment issue_create_issue_attachment(owner, repo, index, attachment, name, updated_at) -Create an issue attachment - -### 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] | -**attachment** | **std::path::PathBuf** | attachment to upload | [required] | -**name** | Option<**String**> | name of the attachment | | -**updated_at** | Option<**String**> | time of the attachment's creation. This is a timestamp in RFC 3339 format | | - -### Return type - -[**models::Attachment**](Attachment.md) - -### Authorization - -[TOTPHeader](../README.md#TOTPHeader), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [SudoHeader](../README.md#SudoHeader), [BasicAuth](../README.md#BasicAuth), [AccessToken](../README.md#AccessToken), [SudoParam](../README.md#SudoParam), [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) - - -## issue_create_issue_blocking - -> models::Issue issue_create_issue_blocking(owner, repo, index, body) -Block the issue given in the body by the issue in path - -### 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<[**IssueMeta**](IssueMeta.md)> | | | - -### Return type - -[**models::Issue**](Issue.md) - -### Authorization - -[TOTPHeader](../README.md#TOTPHeader), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [SudoHeader](../README.md#SudoHeader), [BasicAuth](../README.md#BasicAuth), [AccessToken](../README.md#AccessToken), [SudoParam](../README.md#SudoParam), [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) - - -## issue_create_issue_comment_attachment - -> models::Attachment issue_create_issue_comment_attachment(owner, repo, id, attachment, name, updated_at) -Create a comment 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 comment | [required] | -**attachment** | **std::path::PathBuf** | attachment to upload | [required] | -**name** | Option<**String**> | name of the attachment | | -**updated_at** | Option<**String**> | time of the attachment's creation. This is a timestamp in RFC 3339 format | | - -### Return type - -[**models::Attachment**](Attachment.md) - -### Authorization - -[TOTPHeader](../README.md#TOTPHeader), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [SudoHeader](../README.md#SudoHeader), [BasicAuth](../README.md#BasicAuth), [AccessToken](../README.md#AccessToken), [SudoParam](../README.md#SudoParam), [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) - - -## issue_create_issue_dependencies - -> models::Issue issue_create_issue_dependencies(owner, repo, index, body) -Make the issue in the url depend on the issue in the form. - -### 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<[**IssueMeta**](IssueMeta.md)> | | | - -### Return type - -[**models::Issue**](Issue.md) - -### Authorization - -[TOTPHeader](../README.md#TOTPHeader), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [SudoHeader](../README.md#SudoHeader), [BasicAuth](../README.md#BasicAuth), [AccessToken](../README.md#AccessToken), [SudoParam](../README.md#SudoParam), [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) - - -## issue_create_label - -> 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 - -[**models::Label**](Label.md) - -### Authorization - -[TOTPHeader](../README.md#TOTPHeader), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [SudoHeader](../README.md#SudoHeader), [BasicAuth](../README.md#BasicAuth), [AccessToken](../README.md#AccessToken), [SudoParam](../README.md#SudoParam), [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 - -> 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 - -[**models::Milestone**](Milestone.md) - -### Authorization - -[TOTPHeader](../README.md#TOTPHeader), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [SudoHeader](../README.md#SudoHeader), [BasicAuth](../README.md#BasicAuth), [AccessToken](../README.md#AccessToken), [SudoParam](../README.md#SudoParam), [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 - -[TOTPHeader](../README.md#TOTPHeader), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [SudoHeader](../README.md#SudoHeader), [BasicAuth](../README.md#BasicAuth), [AccessToken](../README.md#AccessToken), [SudoParam](../README.md#SudoParam), [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) - - -## 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 - -[TOTPHeader](../README.md#TOTPHeader), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [SudoHeader](../README.md#SudoHeader), [BasicAuth](../README.md#BasicAuth), [AccessToken](../README.md#AccessToken), [SudoParam](../README.md#SudoParam), [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) - - -## 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 - -[TOTPHeader](../README.md#TOTPHeader), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [SudoHeader](../README.md#SudoHeader), [BasicAuth](../README.md#BasicAuth), [AccessToken](../README.md#AccessToken), [SudoParam](../README.md#SudoParam), [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) - - -## 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 - -[TOTPHeader](../README.md#TOTPHeader), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [SudoHeader](../README.md#SudoHeader), [BasicAuth](../README.md#BasicAuth), [AccessToken](../README.md#AccessToken), [SudoParam](../README.md#SudoParam), [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_attachment - -> issue_delete_issue_attachment(owner, repo, index, attachment_id) -Delete an issue attachment - -### 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] | -**attachment_id** | **i64** | id of the attachment to delete | [required] | - -### Return type - - (empty response body) - -### Authorization - -[TOTPHeader](../README.md#TOTPHeader), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [SudoHeader](../README.md#SudoHeader), [BasicAuth](../README.md#BasicAuth), [AccessToken](../README.md#AccessToken), [SudoParam](../README.md#SudoParam), [Token](../README.md#Token) - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: application/json - -[[Back to top]](#) [[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_comment_attachment - -> issue_delete_issue_comment_attachment(owner, repo, id, attachment_id) -Delete a comment 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 comment | [required] | -**attachment_id** | **i64** | id of the attachment to delete | [required] | - -### Return type - - (empty response body) - -### Authorization - -[TOTPHeader](../README.md#TOTPHeader), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [SudoHeader](../README.md#SudoHeader), [BasicAuth](../README.md#BasicAuth), [AccessToken](../README.md#AccessToken), [SudoParam](../README.md#SudoParam), [Token](../README.md#Token) - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: application/json - -[[Back to top]](#) [[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 - -[TOTPHeader](../README.md#TOTPHeader), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [SudoHeader](../README.md#SudoHeader), [BasicAuth](../README.md#BasicAuth), [AccessToken](../README.md#AccessToken), [SudoParam](../README.md#SudoParam), [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_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 - -[TOTPHeader](../README.md#TOTPHeader), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [SudoHeader](../README.md#SudoHeader), [BasicAuth](../README.md#BasicAuth), [AccessToken](../README.md#AccessToken), [SudoParam](../README.md#SudoParam), [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) - - -## 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** | **i64** | the milestone to delete, identified by ID and if not available by name | [required] | - -### Return type - - (empty response body) - -### Authorization - -[TOTPHeader](../README.md#TOTPHeader), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [SudoHeader](../README.md#SudoHeader), [BasicAuth](../README.md#BasicAuth), [AccessToken](../README.md#AccessToken), [SudoParam](../README.md#SudoParam), [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) - - -## 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 - -[TOTPHeader](../README.md#TOTPHeader), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [SudoHeader](../README.md#SudoHeader), [BasicAuth](../README.md#BasicAuth), [AccessToken](../README.md#AccessToken), [SudoParam](../README.md#SudoParam), [Token](../README.md#Token) - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: application/json - -[[Back to top]](#) [[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 - -[TOTPHeader](../README.md#TOTPHeader), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [SudoHeader](../README.md#SudoHeader), [BasicAuth](../README.md#BasicAuth), [AccessToken](../README.md#AccessToken), [SudoParam](../README.md#SudoParam), [Token](../README.md#Token) - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: application/json - -[[Back to top]](#) [[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 - -[TOTPHeader](../README.md#TOTPHeader), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [SudoHeader](../README.md#SudoHeader), [BasicAuth](../README.md#BasicAuth), [AccessToken](../README.md#AccessToken), [SudoParam](../README.md#SudoParam), [Token](../README.md#Token) - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: application/json - -[[Back to top]](#) [[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 - -> 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 - -[**models::Comment**](Comment.md) - -### Authorization - -[TOTPHeader](../README.md#TOTPHeader), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [SudoHeader](../README.md#SudoHeader), [BasicAuth](../README.md#BasicAuth), [AccessToken](../README.md#AccessToken), [SudoParam](../README.md#SudoParam), [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 - -> 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 - -[**models::Comment**](Comment.md) - -### Authorization - -[TOTPHeader](../README.md#TOTPHeader), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [SudoHeader](../README.md#SudoHeader), [BasicAuth](../README.md#BasicAuth), [AccessToken](../README.md#AccessToken), [SudoParam](../README.md#SudoParam), [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 - -> 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 - -[**models::Issue**](Issue.md) - -### Authorization - -[TOTPHeader](../README.md#TOTPHeader), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [SudoHeader](../README.md#SudoHeader), [BasicAuth](../README.md#BasicAuth), [AccessToken](../README.md#AccessToken), [SudoParam](../README.md#SudoParam), [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_attachment - -> models::Attachment issue_edit_issue_attachment(owner, repo, index, attachment_id, body) -Edit an issue attachment - -### 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] | -**attachment_id** | **i64** | id of the attachment to edit | [required] | -**body** | Option<[**EditAttachmentOptions**](EditAttachmentOptions.md)> | | | - -### Return type - -[**models::Attachment**](Attachment.md) - -### Authorization - -[TOTPHeader](../README.md#TOTPHeader), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [SudoHeader](../README.md#SudoHeader), [BasicAuth](../README.md#BasicAuth), [AccessToken](../README.md#AccessToken), [SudoParam](../README.md#SudoParam), [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_comment_attachment - -> models::Attachment issue_edit_issue_comment_attachment(owner, repo, id, attachment_id, body) -Edit a comment 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 comment | [required] | -**attachment_id** | **i64** | id of the attachment to edit | [required] | -**body** | Option<[**EditAttachmentOptions**](EditAttachmentOptions.md)> | | | - -### Return type - -[**models::Attachment**](Attachment.md) - -### Authorization - -[TOTPHeader](../README.md#TOTPHeader), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [SudoHeader](../README.md#SudoHeader), [BasicAuth](../README.md#BasicAuth), [AccessToken](../README.md#AccessToken), [SudoParam](../README.md#SudoParam), [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 - -> 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 - -[**models::IssueDeadline**](IssueDeadline.md) - -### Authorization - -[TOTPHeader](../README.md#TOTPHeader), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [SudoHeader](../README.md#SudoHeader), [BasicAuth](../README.md#BasicAuth), [AccessToken](../README.md#AccessToken), [SudoParam](../README.md#SudoParam), [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 - -> 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 - -[**models::Label**](Label.md) - -### Authorization - -[TOTPHeader](../README.md#TOTPHeader), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [SudoHeader](../README.md#SudoHeader), [BasicAuth](../README.md#BasicAuth), [AccessToken](../README.md#AccessToken), [SudoParam](../README.md#SudoParam), [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 - -> 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** | **i64** | the milestone to edit, identified by ID and if not available by name | [required] | -**body** | Option<[**EditMilestoneOption**](EditMilestoneOption.md)> | | | - -### Return type - -[**models::Milestone**](Milestone.md) - -### Authorization - -[TOTPHeader](../README.md#TOTPHeader), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [SudoHeader](../README.md#SudoHeader), [BasicAuth](../README.md#BasicAuth), [AccessToken](../README.md#AccessToken), [SudoParam](../README.md#SudoParam), [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 - -> 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 - -[**models::Comment**](Comment.md) - -### Authorization - -[TOTPHeader](../README.md#TOTPHeader), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [SudoHeader](../README.md#SudoHeader), [BasicAuth](../README.md#BasicAuth), [AccessToken](../README.md#AccessToken), [SudoParam](../README.md#SudoParam), [Token](../README.md#Token) - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: application/json - -[[Back to top]](#) [[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 - -[TOTPHeader](../README.md#TOTPHeader), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [SudoHeader](../README.md#SudoHeader), [BasicAuth](../README.md#BasicAuth), [AccessToken](../README.md#AccessToken), [SudoParam](../README.md#SudoParam), [Token](../README.md#Token) - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: application/json - -[[Back to top]](#) [[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 - -[TOTPHeader](../README.md#TOTPHeader), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [SudoHeader](../README.md#SudoHeader), [BasicAuth](../README.md#BasicAuth), [AccessToken](../README.md#AccessToken), [SudoParam](../README.md#SudoParam), [Token](../README.md#Token) - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: application/json - -[[Back to top]](#) [[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 - -[TOTPHeader](../README.md#TOTPHeader), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [SudoHeader](../README.md#SudoHeader), [BasicAuth](../README.md#BasicAuth), [AccessToken](../README.md#AccessToken), [SudoParam](../README.md#SudoParam), [Token](../README.md#Token) - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: application/json - -[[Back to top]](#) [[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 - -> 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 - -[**models::Issue**](Issue.md) - -### Authorization - -[TOTPHeader](../README.md#TOTPHeader), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [SudoHeader](../README.md#SudoHeader), [BasicAuth](../README.md#BasicAuth), [AccessToken](../README.md#AccessToken), [SudoParam](../README.md#SudoParam), [Token](../README.md#Token) - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: application/json - -[[Back to top]](#) [[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_attachment - -> models::Attachment issue_get_issue_attachment(owner, repo, index, attachment_id) -Get an issue attachment - -### 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] | -**attachment_id** | **i64** | id of the attachment to get | [required] | - -### Return type - -[**models::Attachment**](Attachment.md) - -### Authorization - -[TOTPHeader](../README.md#TOTPHeader), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [SudoHeader](../README.md#SudoHeader), [BasicAuth](../README.md#BasicAuth), [AccessToken](../README.md#AccessToken), [SudoParam](../README.md#SudoParam), [Token](../README.md#Token) - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: application/json - -[[Back to top]](#) [[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_comment_attachment - -> models::Attachment issue_get_issue_comment_attachment(owner, repo, id, attachment_id) -Get a comment 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 comment | [required] | -**attachment_id** | **i64** | id of the attachment to get | [required] | - -### Return type - -[**models::Attachment**](Attachment.md) - -### Authorization - -[TOTPHeader](../README.md#TOTPHeader), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [SudoHeader](../README.md#SudoHeader), [BasicAuth](../README.md#BasicAuth), [AccessToken](../README.md#AccessToken), [SudoParam](../README.md#SudoParam), [Token](../README.md#Token) - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: application/json - -[[Back to top]](#) [[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 - -[TOTPHeader](../README.md#TOTPHeader), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [SudoHeader](../README.md#SudoHeader), [BasicAuth](../README.md#BasicAuth), [AccessToken](../README.md#AccessToken), [SudoParam](../README.md#SudoParam), [Token](../README.md#Token) - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: application/json - -[[Back to top]](#) [[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 - -> 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 - -[**models::Label**](Label.md) - -### Authorization - -[TOTPHeader](../README.md#TOTPHeader), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [SudoHeader](../README.md#SudoHeader), [BasicAuth](../README.md#BasicAuth), [AccessToken](../README.md#AccessToken), [SudoParam](../README.md#SudoParam), [Token](../README.md#Token) - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: application/json - -[[Back to top]](#) [[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 - -[TOTPHeader](../README.md#TOTPHeader), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [SudoHeader](../README.md#SudoHeader), [BasicAuth](../README.md#BasicAuth), [AccessToken](../README.md#AccessToken), [SudoParam](../README.md#SudoParam), [Token](../README.md#Token) - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: application/json - -[[Back to top]](#) [[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 - -> 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** | **i64** | the milestone to get, identified by ID and if not available by name | [required] | - -### Return type - -[**models::Milestone**](Milestone.md) - -### Authorization - -[TOTPHeader](../README.md#TOTPHeader), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [SudoHeader](../README.md#SudoHeader), [BasicAuth](../README.md#BasicAuth), [AccessToken](../README.md#AccessToken), [SudoParam](../README.md#SudoParam), [Token](../README.md#Token) - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: application/json - -[[Back to top]](#) [[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 - -[TOTPHeader](../README.md#TOTPHeader), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [SudoHeader](../README.md#SudoHeader), [BasicAuth](../README.md#BasicAuth), [AccessToken](../README.md#AccessToken), [SudoParam](../README.md#SudoParam), [Token](../README.md#Token) - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: application/json - -[[Back to top]](#) [[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 - -[TOTPHeader](../README.md#TOTPHeader), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [SudoHeader](../README.md#SudoHeader), [BasicAuth](../README.md#BasicAuth), [AccessToken](../README.md#AccessToken), [SudoParam](../README.md#SudoParam), [Token](../README.md#Token) - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: application/json - -[[Back to top]](#) [[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_blocks - -> Vec issue_list_blocks(owner, repo, index, page, limit) -List issues that are blocked by this 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**](Issue.md) - -### Authorization - -[TOTPHeader](../README.md#TOTPHeader), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [SudoHeader](../README.md#SudoHeader), [BasicAuth](../README.md#BasicAuth), [AccessToken](../README.md#AccessToken), [SudoParam](../README.md#SudoParam), [Token](../README.md#Token) - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: application/json - -[[Back to top]](#) [[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_issue_attachments - -> Vec issue_list_issue_attachments(owner, repo, index) -List issue's attachments - -### 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**](Attachment.md) - -### Authorization - -[TOTPHeader](../README.md#TOTPHeader), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [SudoHeader](../README.md#SudoHeader), [BasicAuth](../README.md#BasicAuth), [AccessToken](../README.md#AccessToken), [SudoParam](../README.md#SudoParam), [Token](../README.md#Token) - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: application/json - -[[Back to top]](#) [[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_issue_comment_attachments - -> Vec issue_list_issue_comment_attachments(owner, repo, id) -List comment'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 comment | [required] | - -### Return type - -[**Vec**](Attachment.md) - -### Authorization - -[TOTPHeader](../README.md#TOTPHeader), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [SudoHeader](../README.md#SudoHeader), [BasicAuth](../README.md#BasicAuth), [AccessToken](../README.md#AccessToken), [SudoParam](../README.md#SudoParam), [Token](../README.md#Token) - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: application/json - -[[Back to top]](#) [[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_issue_dependencies - -> Vec issue_list_issue_dependencies(owner, repo, index, page, limit) -List an issue's dependencies, i.e all issues that block this 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**](Issue.md) - -### Authorization - -[TOTPHeader](../README.md#TOTPHeader), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [SudoHeader](../README.md#SudoHeader), [BasicAuth](../README.md#BasicAuth), [AccessToken](../README.md#AccessToken), [SudoParam](../README.md#SudoParam), [Token](../README.md#Token) - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: application/json - -[[Back to top]](#) [[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, sort) -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 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 | | -**sort** | Option<**String**> | Type of sort | |[default to latest] - -### Return type - -[**Vec**](Issue.md) - -### Authorization - -[TOTPHeader](../README.md#TOTPHeader), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [SudoHeader](../README.md#SudoHeader), [BasicAuth](../README.md#BasicAuth), [AccessToken](../README.md#AccessToken), [SudoParam](../README.md#SudoParam), [Token](../README.md#Token) - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: application/json - -[[Back to top]](#) [[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, sort, 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] | -**sort** | Option<**String**> | Specifies the sorting method: mostissues, leastissues, or reversealphabetically. | | -**page** | Option<**i32**> | page number of results to return (1-based) | | -**limit** | Option<**i32**> | page size of results | | - -### Return type - -[**Vec**](Label.md) - -### Authorization - -[TOTPHeader](../README.md#TOTPHeader), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [SudoHeader](../README.md#SudoHeader), [BasicAuth](../README.md#BasicAuth), [AccessToken](../README.md#AccessToken), [SudoParam](../README.md#SudoParam), [Token](../README.md#Token) - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: application/json - -[[Back to top]](#) [[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 - -> 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 - -[**models::Reaction**](Reaction.md) - -### Authorization - -[TOTPHeader](../README.md#TOTPHeader), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [SudoHeader](../README.md#SudoHeader), [BasicAuth](../README.md#BasicAuth), [AccessToken](../README.md#AccessToken), [SudoParam](../README.md#SudoParam), [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 - -> 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 - -[**models::Reaction**](Reaction.md) - -### Authorization - -[TOTPHeader](../README.md#TOTPHeader), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [SudoHeader](../README.md#SudoHeader), [BasicAuth](../README.md#BasicAuth), [AccessToken](../README.md#AccessToken), [SudoParam](../README.md#SudoParam), [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_issue_blocking - -> models::Issue issue_remove_issue_blocking(owner, repo, index, body) -Unblock the issue given in the body by the issue in path - -### 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<[**IssueMeta**](IssueMeta.md)> | | | - -### Return type - -[**models::Issue**](Issue.md) - -### Authorization - -[TOTPHeader](../README.md#TOTPHeader), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [SudoHeader](../README.md#SudoHeader), [BasicAuth](../README.md#BasicAuth), [AccessToken](../README.md#AccessToken), [SudoParam](../README.md#SudoParam), [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) - - -## issue_remove_issue_dependencies - -> models::Issue issue_remove_issue_dependencies(owner, repo, index, body) -Remove an issue dependency - -### 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<[**IssueMeta**](IssueMeta.md)> | | | - -### Return type - -[**models::Issue**](Issue.md) - -### Authorization - -[TOTPHeader](../README.md#TOTPHeader), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [SudoHeader](../README.md#SudoHeader), [BasicAuth](../README.md#BasicAuth), [AccessToken](../README.md#AccessToken), [SudoParam](../README.md#SudoParam), [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) - - -## issue_remove_label - -> issue_remove_label(owner, repo, index, identifier, body) -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] | -**identifier** | **String** | name or id of the label to remove | [required] | -**body** | Option<[**DeleteLabelsOption**](DeleteLabelsOption.md)> | | | - -### Return type - - (empty response body) - -### Authorization - -[TOTPHeader](../README.md#TOTPHeader), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [SudoHeader](../README.md#SudoHeader), [BasicAuth](../README.md#BasicAuth), [AccessToken](../README.md#AccessToken), [SudoParam](../README.md#SudoParam), [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) - - -## 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 - -[TOTPHeader](../README.md#TOTPHeader), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [SudoHeader](../README.md#SudoHeader), [BasicAuth](../README.md#BasicAuth), [AccessToken](../README.md#AccessToken), [SudoParam](../README.md#SudoParam), [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 - -[TOTPHeader](../README.md#TOTPHeader), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [SudoHeader](../README.md#SudoHeader), [BasicAuth](../README.md#BasicAuth), [AccessToken](../README.md#AccessToken), [SudoParam](../README.md#SudoParam), [Token](../README.md#Token) - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: application/json - -[[Back to top]](#) [[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, reviewed, owner, team, page, limit, sort) -Search for issues across the repositories that the user has access to - -### Parameters - - -Name | Type | Description | Required | Notes -------------- | ------------- | ------------- | ------------- | ------------- -**state** | Option<**String**> | State of the issue | |[default to open] -**labels** | Option<**String**> | Comma-separated list of label names. Fetch only issues that have any of these labels. Non existent labels are discarded. | | -**milestones** | Option<**String**> | Comma-separated list of milestone names. Fetch only issues that have any of these milestones. Non existent milestones are discarded. | | -**q** | Option<**String**> | Search string | | -**priority_repo_id** | Option<**i64**> | Repository ID to prioritize in the results | | -**r#type** | Option<**String**> | Filter by issue type | | -**since** | Option<**String**> | Only show issues updated after the given time (RFC 3339 format) | | -**before** | Option<**String**> | Only show issues updated before the given time (RFC 3339 format) | | -**assigned** | Option<**bool**> | Filter issues or pulls assigned to the authenticated user | |[default to false] -**created** | Option<**bool**> | Filter issues or pulls created by the authenticated user | |[default to false] -**mentioned** | Option<**bool**> | Filter issues or pulls mentioning the authenticated user | |[default to false] -**review_requested** | Option<**bool**> | Filter pull requests where the authenticated user's review was requested | |[default to false] -**reviewed** | Option<**bool**> | Filter pull requests reviewed by the authenticated user | |[default to false] -**owner** | Option<**String**> | Filter by repository owner | | -**team** | Option<**String**> | Filter by team (requires organization owner parameter) | | -**page** | Option<**i32**> | Page number of results to return (1-based) | |[default to 1] -**limit** | Option<**i32**> | Number of items per page | | -**sort** | Option<**String**> | Type of sort | |[default to latest] - -### Return type - -[**Vec**](Issue.md) - -### Authorization - -[TOTPHeader](../README.md#TOTPHeader), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [SudoHeader](../README.md#SudoHeader), [BasicAuth](../README.md#BasicAuth), [AccessToken](../README.md#AccessToken), [SudoParam](../README.md#SudoParam), [Token](../README.md#Token) - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: application/json - -[[Back to top]](#) [[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 - -[TOTPHeader](../README.md#TOTPHeader), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [SudoHeader](../README.md#SudoHeader), [BasicAuth](../README.md#BasicAuth), [AccessToken](../README.md#AccessToken), [SudoParam](../README.md#SudoParam), [Token](../README.md#Token) - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: application/json - -[[Back to top]](#) [[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 - -[TOTPHeader](../README.md#TOTPHeader), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [SudoHeader](../README.md#SudoHeader), [BasicAuth](../README.md#BasicAuth), [AccessToken](../README.md#AccessToken), [SudoParam](../README.md#SudoParam), [Token](../README.md#Token) - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: application/json - -[[Back to top]](#) [[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 - -[TOTPHeader](../README.md#TOTPHeader), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [SudoHeader](../README.md#SudoHeader), [BasicAuth](../README.md#BasicAuth), [AccessToken](../README.md#AccessToken), [SudoParam](../README.md#SudoParam), [Token](../README.md#Token) - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: application/json - -[[Back to top]](#) [[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 - -[TOTPHeader](../README.md#TOTPHeader), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [SudoHeader](../README.md#SudoHeader), [BasicAuth](../README.md#BasicAuth), [AccessToken](../README.md#AccessToken), [SudoParam](../README.md#SudoParam), [Token](../README.md#Token) - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - - -## move_issue_pin - -> move_issue_pin(owner, repo, index, position) -Moves the Pin to the given Position - -### 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 | [required] | -**position** | **i64** | the new position | [required] | - -### Return type - - (empty response body) - -### Authorization - -[TOTPHeader](../README.md#TOTPHeader), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [SudoHeader](../README.md#SudoHeader), [BasicAuth](../README.md#BasicAuth), [AccessToken](../README.md#AccessToken), [SudoParam](../README.md#SudoParam), [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) - - -## pin_issue - -> pin_issue(owner, repo, index) -Pin 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 pin | [required] | - -### Return type - - (empty response body) - -### Authorization - -[TOTPHeader](../README.md#TOTPHeader), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [SudoHeader](../README.md#SudoHeader), [BasicAuth](../README.md#BasicAuth), [AccessToken](../README.md#AccessToken), [SudoParam](../README.md#SudoParam), [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) - - -## unpin_issue - -> unpin_issue(owner, repo, index) -Unpin 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 unpin | [required] | - -### Return type - - (empty response body) - -### Authorization - -[TOTPHeader](../README.md#TOTPHeader), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [SudoHeader](../README.md#SudoHeader), [BasicAuth](../README.md#BasicAuth), [AccessToken](../README.md#AccessToken), [SudoParam](../README.md#SudoParam), [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) - diff --git a/docs/IssueConfig.md b/docs/IssueConfig.md deleted file mode 100644 index 46d0409..0000000 --- a/docs/IssueConfig.md +++ /dev/null @@ -1,12 +0,0 @@ -# IssueConfig - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**blank_issues_enabled** | Option<**bool**> | | [optional] -**contact_links** | Option<[**Vec**](IssueConfigContactLink.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/docs/IssueConfigContactLink.md b/docs/IssueConfigContactLink.md deleted file mode 100644 index 358e60f..0000000 --- a/docs/IssueConfigContactLink.md +++ /dev/null @@ -1,13 +0,0 @@ -# IssueConfigContactLink - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**about** | Option<**String**> | | [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/docs/IssueConfigValidation.md b/docs/IssueConfigValidation.md deleted file mode 100644 index 7156d30..0000000 --- a/docs/IssueConfigValidation.md +++ /dev/null @@ -1,12 +0,0 @@ -# IssueConfigValidation - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**message** | Option<**String**> | | [optional] -**valid** | 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/docs/IssueDeadline.md b/docs/IssueDeadline.md deleted file mode 100644 index 94c4d91..0000000 --- a/docs/IssueDeadline.md +++ /dev/null @@ -1,11 +0,0 @@ -# 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/docs/IssueFormField.md b/docs/IssueFormField.md deleted file mode 100644 index 14da9ac..0000000 --- a/docs/IssueFormField.md +++ /dev/null @@ -1,15 +0,0 @@ -# IssueFormField - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**attributes** | Option<**std::collections::HashMap**> | | [optional] -**id** | Option<**String**> | | [optional] -**r#type** | Option<**String**> | | [optional] -**validations** | Option<**std::collections::HashMap**> | | [optional] -**visible** | 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/docs/IssueLabelsOption.md b/docs/IssueLabelsOption.md deleted file mode 100644 index 682fa54..0000000 --- a/docs/IssueLabelsOption.md +++ /dev/null @@ -1,12 +0,0 @@ -# IssueLabelsOption - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**labels** | Option<**Vec**> | Labels can be a list of integers representing label IDs or a list of strings representing label names | [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/docs/IssueMeta.md b/docs/IssueMeta.md deleted file mode 100644 index a5000bc..0000000 --- a/docs/IssueMeta.md +++ /dev/null @@ -1,13 +0,0 @@ -# IssueMeta - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**index** | Option<**i64**> | | [optional] -**owner** | Option<**String**> | | [optional] -**repo** | 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/docs/IssueTemplate.md b/docs/IssueTemplate.md deleted file mode 100644 index 34679d6..0000000 --- a/docs/IssueTemplate.md +++ /dev/null @@ -1,18 +0,0 @@ -# IssueTemplate - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**about** | Option<**String**> | | [optional] -**body** | Option<[**Vec**](IssueFormField.md)> | | [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/docs/Label.md b/docs/Label.md deleted file mode 100644 index a018dbb..0000000 --- a/docs/Label.md +++ /dev/null @@ -1,17 +0,0 @@ -# Label - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**color** | Option<**String**> | | [optional] -**description** | Option<**String**> | | [optional] -**exclusive** | Option<**bool**> | | [optional] -**id** | Option<**i64**> | | [optional] -**is_archived** | Option<**bool**> | | [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/docs/LabelTemplate.md b/docs/LabelTemplate.md deleted file mode 100644 index d0ded8d..0000000 --- a/docs/LabelTemplate.md +++ /dev/null @@ -1,14 +0,0 @@ -# LabelTemplate - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**color** | Option<**String**> | | [optional] -**description** | Option<**String**> | | [optional] -**exclusive** | 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/docs/LicenseTemplateInfo.md b/docs/LicenseTemplateInfo.md deleted file mode 100644 index 832dc8c..0000000 --- a/docs/LicenseTemplateInfo.md +++ /dev/null @@ -1,15 +0,0 @@ -# LicenseTemplateInfo - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**body** | Option<**String**> | | [optional] -**implementation** | Option<**String**> | | [optional] -**key** | Option<**String**> | | [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/docs/LicensesTemplateListEntry.md b/docs/LicensesTemplateListEntry.md deleted file mode 100644 index 0a1a61a..0000000 --- a/docs/LicensesTemplateListEntry.md +++ /dev/null @@ -1,13 +0,0 @@ -# LicensesTemplateListEntry - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**key** | Option<**String**> | | [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/docs/ListActionRunResponse.md b/docs/ListActionRunResponse.md deleted file mode 100644 index b2b2760..0000000 --- a/docs/ListActionRunResponse.md +++ /dev/null @@ -1,12 +0,0 @@ -# ListActionRunResponse - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**total_count** | Option<**i64**> | | [optional] -**workflow_runs** | Option<[**Vec**](ActionRun.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/docs/MarkdownOption.md b/docs/MarkdownOption.md deleted file mode 100644 index 33f0218..0000000 --- a/docs/MarkdownOption.md +++ /dev/null @@ -1,14 +0,0 @@ -# MarkdownOption - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**context** | Option<**String**> | Context to render in: body | [optional] -**mode** | Option<**String**> | Mode to render (comment, gfm, markdown) 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/docs/MarkupOption.md b/docs/MarkupOption.md deleted file mode 100644 index ac15ef0..0000000 --- a/docs/MarkupOption.md +++ /dev/null @@ -1,16 +0,0 @@ -# MarkupOption - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**branch_path** | Option<**String**> | The current branch path where the form gets posted in: body | [optional] -**context** | Option<**String**> | Context to render in: body | [optional] -**file_path** | Option<**String**> | File path for detecting extension in file mode in: body | [optional] -**mode** | Option<**String**> | Mode to render (comment, gfm, markdown, file) in: body | [optional] -**text** | Option<**String**> | Text markup 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/docs/MergePullRequestOption.md b/docs/MergePullRequestOption.md deleted file mode 100644 index 1755f6b..0000000 --- a/docs/MergePullRequestOption.md +++ /dev/null @@ -1,18 +0,0 @@ -# MergePullRequestOption - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**r#do** | **Do** | (enum: merge, rebase, rebase-merge, squash, fast-forward-only, manually-merged) | -**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/docs/MigrateRepoOptions.md b/docs/MigrateRepoOptions.md deleted file mode 100644 index a6e38fa..0000000 --- a/docs/MigrateRepoOptions.md +++ /dev/null @@ -1,30 +0,0 @@ -# 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<**Service**> | (enum: git, github, gitea, gitlab, gogs, onedev, gitbucket, codebase) | [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/docs/Milestone.md b/docs/Milestone.md deleted file mode 100644 index c92f404..0000000 --- a/docs/Milestone.md +++ /dev/null @@ -1,20 +0,0 @@ -# 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/docs/MiscellaneousApi.md b/docs/MiscellaneousApi.md deleted file mode 100644 index daf3d21..0000000 --- a/docs/MiscellaneousApi.md +++ /dev/null @@ -1,364 +0,0 @@ -# \MiscellaneousApi - -All URIs are relative to */api/v1* - -Method | HTTP request | Description -------------- | ------------- | ------------- -[**get_gitignore_template_info**](MiscellaneousApi.md#get_gitignore_template_info) | **GET** /gitignore/templates/{name} | Returns information about a gitignore template -[**get_label_template_info**](MiscellaneousApi.md#get_label_template_info) | **GET** /label/templates/{name} | Returns all labels in a template -[**get_license_template_info**](MiscellaneousApi.md#get_license_template_info) | **GET** /licenses/{name} | Returns information about a license template -[**get_node_info**](MiscellaneousApi.md#get_node_info) | **GET** /nodeinfo | Returns the nodeinfo of the Forgejo application -[**get_signing_key**](MiscellaneousApi.md#get_signing_key) | **GET** /signing-key.gpg | Get default signing-key.gpg -[**get_ssh_signing_key**](MiscellaneousApi.md#get_ssh_signing_key) | **GET** /signing-key.ssh | Get default signing-key.ssh -[**get_version**](MiscellaneousApi.md#get_version) | **GET** /version | Returns the version of the running application -[**list_gitignores_templates**](MiscellaneousApi.md#list_gitignores_templates) | **GET** /gitignore/templates | Returns a list of all gitignore templates -[**list_label_templates**](MiscellaneousApi.md#list_label_templates) | **GET** /label/templates | Returns a list of all label templates -[**list_license_templates**](MiscellaneousApi.md#list_license_templates) | **GET** /licenses | Returns a list of all license templates -[**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 -[**render_markup**](MiscellaneousApi.md#render_markup) | **POST** /markup | Render a markup document as HTML - - - -## get_gitignore_template_info - -> models::GitignoreTemplateInfo get_gitignore_template_info(name) -Returns information about a gitignore template - -### Parameters - - -Name | Type | Description | Required | Notes -------------- | ------------- | ------------- | ------------- | ------------- -**name** | **String** | name of the template | [required] | - -### Return type - -[**models::GitignoreTemplateInfo**](GitignoreTemplateInfo.md) - -### Authorization - -[TOTPHeader](../README.md#TOTPHeader), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [SudoHeader](../README.md#SudoHeader), [BasicAuth](../README.md#BasicAuth), [AccessToken](../README.md#AccessToken), [SudoParam](../README.md#SudoParam), [Token](../README.md#Token) - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: application/json - -[[Back to top]](#) [[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_label_template_info - -> Vec get_label_template_info(name) -Returns all labels in a template - -### Parameters - - -Name | Type | Description | Required | Notes -------------- | ------------- | ------------- | ------------- | ------------- -**name** | **String** | name of the template | [required] | - -### Return type - -[**Vec**](LabelTemplate.md) - -### Authorization - -[TOTPHeader](../README.md#TOTPHeader), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [SudoHeader](../README.md#SudoHeader), [BasicAuth](../README.md#BasicAuth), [AccessToken](../README.md#AccessToken), [SudoParam](../README.md#SudoParam), [Token](../README.md#Token) - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: application/json - -[[Back to top]](#) [[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_license_template_info - -> models::LicenseTemplateInfo get_license_template_info(name) -Returns information about a license template - -### Parameters - - -Name | Type | Description | Required | Notes -------------- | ------------- | ------------- | ------------- | ------------- -**name** | **String** | name of the license | [required] | - -### Return type - -[**models::LicenseTemplateInfo**](LicenseTemplateInfo.md) - -### Authorization - -[TOTPHeader](../README.md#TOTPHeader), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [SudoHeader](../README.md#SudoHeader), [BasicAuth](../README.md#BasicAuth), [AccessToken](../README.md#AccessToken), [SudoParam](../README.md#SudoParam), [Token](../README.md#Token) - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: application/json - -[[Back to top]](#) [[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_node_info - -> models::NodeInfo get_node_info() -Returns the nodeinfo of the Forgejo application - -### Parameters - -This endpoint does not need any parameter. - -### Return type - -[**models::NodeInfo**](NodeInfo.md) - -### Authorization - -[TOTPHeader](../README.md#TOTPHeader), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [SudoHeader](../README.md#SudoHeader), [BasicAuth](../README.md#BasicAuth), [AccessToken](../README.md#AccessToken), [SudoParam](../README.md#SudoParam), [Token](../README.md#Token) - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: application/json - -[[Back to top]](#) [[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 - -[TOTPHeader](../README.md#TOTPHeader), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [SudoHeader](../README.md#SudoHeader), [BasicAuth](../README.md#BasicAuth), [AccessToken](../README.md#AccessToken), [SudoParam](../README.md#SudoParam), [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_ssh_signing_key - -> String get_ssh_signing_key() -Get default signing-key.ssh - -### Parameters - -This endpoint does not need any parameter. - -### Return type - -**String** - -### Authorization - -[TOTPHeader](../README.md#TOTPHeader), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [SudoHeader](../README.md#SudoHeader), [BasicAuth](../README.md#BasicAuth), [AccessToken](../README.md#AccessToken), [SudoParam](../README.md#SudoParam), [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 - -> models::ServerVersion get_version() -Returns the version of the running application - -### Parameters - -This endpoint does not need any parameter. - -### Return type - -[**models::ServerVersion**](ServerVersion.md) - -### Authorization - -[TOTPHeader](../README.md#TOTPHeader), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [SudoHeader](../README.md#SudoHeader), [BasicAuth](../README.md#BasicAuth), [AccessToken](../README.md#AccessToken), [SudoParam](../README.md#SudoParam), [Token](../README.md#Token) - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: application/json - -[[Back to top]](#) [[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_gitignores_templates - -> Vec list_gitignores_templates() -Returns a list of all gitignore templates - -### Parameters - -This endpoint does not need any parameter. - -### Return type - -**Vec** - -### Authorization - -[TOTPHeader](../README.md#TOTPHeader), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [SudoHeader](../README.md#SudoHeader), [BasicAuth](../README.md#BasicAuth), [AccessToken](../README.md#AccessToken), [SudoParam](../README.md#SudoParam), [Token](../README.md#Token) - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: application/json - -[[Back to top]](#) [[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_label_templates - -> Vec list_label_templates() -Returns a list of all label templates - -### Parameters - -This endpoint does not need any parameter. - -### Return type - -**Vec** - -### Authorization - -[TOTPHeader](../README.md#TOTPHeader), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [SudoHeader](../README.md#SudoHeader), [BasicAuth](../README.md#BasicAuth), [AccessToken](../README.md#AccessToken), [SudoParam](../README.md#SudoParam), [Token](../README.md#Token) - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: application/json - -[[Back to top]](#) [[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_license_templates - -> Vec list_license_templates() -Returns a list of all license templates - -### Parameters - -This endpoint does not need any parameter. - -### Return type - -[**Vec**](LicensesTemplateListEntry.md) - -### Authorization - -[TOTPHeader](../README.md#TOTPHeader), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [SudoHeader](../README.md#SudoHeader), [BasicAuth](../README.md#BasicAuth), [AccessToken](../README.md#AccessToken), [SudoParam](../README.md#SudoParam), [Token](../README.md#Token) - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: application/json - -[[Back to top]](#) [[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 - -[TOTPHeader](../README.md#TOTPHeader), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [SudoHeader](../README.md#SudoHeader), [BasicAuth](../README.md#BasicAuth), [AccessToken](../README.md#AccessToken), [SudoParam](../README.md#SudoParam), [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 - -[TOTPHeader](../README.md#TOTPHeader), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [SudoHeader](../README.md#SudoHeader), [BasicAuth](../README.md#BasicAuth), [AccessToken](../README.md#AccessToken), [SudoParam](../README.md#SudoParam), [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) - - -## render_markup - -> String render_markup(body) -Render a markup document as HTML - -### Parameters - - -Name | Type | Description | Required | Notes -------------- | ------------- | ------------- | ------------- | ------------- -**body** | Option<[**MarkupOption**](MarkupOption.md)> | | | - -### Return type - -**String** - -### Authorization - -[TOTPHeader](../README.md#TOTPHeader), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [SudoHeader](../README.md#SudoHeader), [BasicAuth](../README.md#BasicAuth), [AccessToken](../README.md#AccessToken), [SudoParam](../README.md#SudoParam), [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) - diff --git a/docs/NewIssuePinsAllowed.md b/docs/NewIssuePinsAllowed.md deleted file mode 100644 index 5145e76..0000000 --- a/docs/NewIssuePinsAllowed.md +++ /dev/null @@ -1,12 +0,0 @@ -# NewIssuePinsAllowed - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**issues** | Option<**bool**> | | [optional] -**pull_requests** | 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/docs/NodeInfo.md b/docs/NodeInfo.md deleted file mode 100644 index b86967f..0000000 --- a/docs/NodeInfo.md +++ /dev/null @@ -1,17 +0,0 @@ -# NodeInfo - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**metadata** | Option<**serde_json::Value**> | | [optional] -**open_registrations** | Option<**bool**> | | [optional] -**protocols** | Option<**Vec**> | | [optional] -**services** | Option<[**models::NodeInfoServices**](NodeInfoServices.md)> | | [optional] -**software** | Option<[**models::NodeInfoSoftware**](NodeInfoSoftware.md)> | | [optional] -**usage** | Option<[**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/docs/NodeInfoServices.md b/docs/NodeInfoServices.md deleted file mode 100644 index 1cde335..0000000 --- a/docs/NodeInfoServices.md +++ /dev/null @@ -1,12 +0,0 @@ -# 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/docs/NodeInfoSoftware.md b/docs/NodeInfoSoftware.md deleted file mode 100644 index 0660bf8..0000000 --- a/docs/NodeInfoSoftware.md +++ /dev/null @@ -1,14 +0,0 @@ -# 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/docs/NodeInfoUsage.md b/docs/NodeInfoUsage.md deleted file mode 100644 index a4246f7..0000000 --- a/docs/NodeInfoUsage.md +++ /dev/null @@ -1,13 +0,0 @@ -# NodeInfoUsage - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**local_comments** | Option<**i64**> | | [optional] -**local_posts** | Option<**i64**> | | [optional] -**users** | Option<[**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/docs/NodeInfoUsageUsers.md b/docs/NodeInfoUsageUsers.md deleted file mode 100644 index ee1808b..0000000 --- a/docs/NodeInfoUsageUsers.md +++ /dev/null @@ -1,13 +0,0 @@ -# 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/docs/Note.md b/docs/Note.md deleted file mode 100644 index f32f313..0000000 --- a/docs/Note.md +++ /dev/null @@ -1,12 +0,0 @@ -# Note - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**commit** | Option<[**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/docs/NoteOptions.md b/docs/NoteOptions.md deleted file mode 100644 index 65bfc39..0000000 --- a/docs/NoteOptions.md +++ /dev/null @@ -1,11 +0,0 @@ -# NoteOptions - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**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/docs/NotificationApi.md b/docs/NotificationApi.md deleted file mode 100644 index 3dd9c3e..0000000 --- a/docs/NotificationApi.md +++ /dev/null @@ -1,231 +0,0 @@ -# \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 - -[TOTPHeader](../README.md#TOTPHeader), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [SudoHeader](../README.md#SudoHeader), [BasicAuth](../README.md#BasicAuth), [AccessToken](../README.md#AccessToken), [SudoParam](../README.md#SudoParam), [Token](../README.md#Token) - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: application/json - -[[Back to top]](#) [[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 - -[TOTPHeader](../README.md#TOTPHeader), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [SudoHeader](../README.md#SudoHeader), [BasicAuth](../README.md#BasicAuth), [AccessToken](../README.md#AccessToken), [SudoParam](../README.md#SudoParam), [Token](../README.md#Token) - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: application/json - -[[Back to top]](#) [[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 - -> models::NotificationThread notify_get_thread(id) -Get notification thread by ID - -### Parameters - - -Name | Type | Description | Required | Notes -------------- | ------------- | ------------- | ------------- | ------------- -**id** | **i64** | id of notification thread | [required] | - -### Return type - -[**models::NotificationThread**](NotificationThread.md) - -### Authorization - -[TOTPHeader](../README.md#TOTPHeader), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [SudoHeader](../README.md#SudoHeader), [BasicAuth](../README.md#BasicAuth), [AccessToken](../README.md#AccessToken), [SudoParam](../README.md#SudoParam), [Token](../README.md#Token) - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: application/json - -[[Back to top]](#) [[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 - -> models::NotificationCount notify_new_available() -Check if unread notifications exist - -### Parameters - -This endpoint does not need any parameter. - -### Return type - -[**models::NotificationCount**](NotificationCount.md) - -### Authorization - -[TOTPHeader](../README.md#TOTPHeader), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [SudoHeader](../README.md#SudoHeader), [BasicAuth](../README.md#BasicAuth), [AccessToken](../README.md#AccessToken), [SudoParam](../README.md#SudoParam), [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<**bool**> | 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 - -[TOTPHeader](../README.md#TOTPHeader), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [SudoHeader](../README.md#SudoHeader), [BasicAuth](../README.md#BasicAuth), [AccessToken](../README.md#AccessToken), [SudoParam](../README.md#SudoParam), [Token](../README.md#Token) - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: application/json - -[[Back to top]](#) [[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<**bool**> | 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 - -[TOTPHeader](../README.md#TOTPHeader), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [SudoHeader](../README.md#SudoHeader), [BasicAuth](../README.md#BasicAuth), [AccessToken](../README.md#AccessToken), [SudoParam](../README.md#SudoParam), [Token](../README.md#Token) - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: application/json - -[[Back to top]](#) [[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 - -> models::NotificationThread notify_read_thread(id, to_status) -Mark notification thread as read by ID - -### Parameters - - -Name | Type | Description | Required | Notes -------------- | ------------- | ------------- | ------------- | ------------- -**id** | **i64** | id of notification thread | [required] | -**to_status** | Option<**String**> | Status to mark notifications as | |[default to read] - -### Return type - -[**models::NotificationThread**](NotificationThread.md) - -### Authorization - -[TOTPHeader](../README.md#TOTPHeader), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [SudoHeader](../README.md#SudoHeader), [BasicAuth](../README.md#BasicAuth), [AccessToken](../README.md#AccessToken), [SudoParam](../README.md#SudoParam), [Token](../README.md#Token) - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: application/json - -[[Back to top]](#) [[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/docs/NotificationCount.md b/docs/NotificationCount.md deleted file mode 100644 index 0c76de0..0000000 --- a/docs/NotificationCount.md +++ /dev/null @@ -1,11 +0,0 @@ -# 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/docs/NotificationSubject.md b/docs/NotificationSubject.md deleted file mode 100644 index 8a28c83..0000000 --- a/docs/NotificationSubject.md +++ /dev/null @@ -1,17 +0,0 @@ -# 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/docs/NotificationThread.md b/docs/NotificationThread.md deleted file mode 100644 index a67580f..0000000 --- a/docs/NotificationThread.md +++ /dev/null @@ -1,17 +0,0 @@ -# NotificationThread - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**id** | Option<**i64**> | | [optional] -**pinned** | Option<**bool**> | | [optional] -**repository** | Option<[**models::Repository**](Repository.md)> | | [optional] -**subject** | Option<[**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/docs/OAuth2Application.md b/docs/OAuth2Application.md deleted file mode 100644 index 19e3cbb..0000000 --- a/docs/OAuth2Application.md +++ /dev/null @@ -1,17 +0,0 @@ -# OAuth2Application - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**client_id** | Option<**String**> | | [optional] -**client_secret** | Option<**String**> | | [optional] -**confidential_client** | Option<**bool**> | | [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/docs/Organization.md b/docs/Organization.md deleted file mode 100644 index 5ca228b..0000000 --- a/docs/Organization.md +++ /dev/null @@ -1,21 +0,0 @@ -# Organization - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**avatar_url** | Option<**String**> | | [optional] -**description** | Option<**String**> | | [optional] -**email** | Option<**String**> | | [optional] -**full_name** | Option<**String**> | | [optional] -**id** | Option<**i64**> | | [optional] -**location** | Option<**String**> | | [optional] -**name** | Option<**String**> | | [optional] -**repo_admin_change_team_access** | Option<**bool**> | | [optional] -**username** | Option<**String**> | deprecated | [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/docs/OrganizationApi.md b/docs/OrganizationApi.md deleted file mode 100644 index 0de0344..0000000 --- a/docs/OrganizationApi.md +++ /dev/null @@ -1,1983 +0,0 @@ -# \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 -[**create_org_variable**](OrganizationApi.md#create_org_variable) | **POST** /orgs/{org}/actions/variables/{variablename} | Create a new variable in organization -[**delete_org_secret**](OrganizationApi.md#delete_org_secret) | **DELETE** /orgs/{org}/actions/secrets/{secretname} | Delete a secret in an organization -[**delete_org_variable**](OrganizationApi.md#delete_org_variable) | **DELETE** /orgs/{org}/actions/variables/{variablename} | Delete organization's variable by name -[**get_org_variable**](OrganizationApi.md#get_org_variable) | **GET** /orgs/{org}/actions/variables/{variablename} | Get organization's variable by name -[**get_org_variables_list**](OrganizationApi.md#get_org_variables_list) | **GET** /orgs/{org}/actions/variables | List variables of 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_block_user**](OrganizationApi.md#org_block_user) | **PUT** /orgs/{org}/block/{username} | Blocks a user from the organization -[**org_check_quota**](OrganizationApi.md#org_check_quota) | **GET** /orgs/{org}/quota/check | Check if the organization is over quota for a given subject -[**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_avatar**](OrganizationApi.md#org_delete_avatar) | **DELETE** /orgs/{org}/avatar | Delete an organization's avatar. It will be replaced by a default one -[**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 | List all 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_quota**](OrganizationApi.md#org_get_quota) | **GET** /orgs/{org}/quota | Get quota information for an organization -[**org_get_runner_registration_token**](OrganizationApi.md#org_get_runner_registration_token) | **GET** /orgs/{org}/actions/runners/registration-token | Get an organization's actions runner registration token -[**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_actions_secrets**](OrganizationApi.md#org_list_actions_secrets) | **GET** /orgs/{org}/actions/secrets | List actions secrets of an organization -[**org_list_activity_feeds**](OrganizationApi.md#org_list_activity_feeds) | **GET** /orgs/{org}/activities/feeds | List an organization's activity feeds -[**org_list_blocked_users**](OrganizationApi.md#org_list_blocked_users) | **GET** /orgs/{org}/list_blocked | List the organization's blocked users -[**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_quota_artifacts**](OrganizationApi.md#org_list_quota_artifacts) | **GET** /orgs/{org}/quota/artifacts | List the artifacts affecting the organization's quota -[**org_list_quota_attachments**](OrganizationApi.md#org_list_quota_attachments) | **GET** /orgs/{org}/quota/attachments | List the attachments affecting the organization's quota -[**org_list_quota_packages**](OrganizationApi.md#org_list_quota_packages) | **GET** /orgs/{org}/quota/packages | List the packages affecting the organization's quota -[**org_list_repos**](OrganizationApi.md#org_list_repos) | **GET** /orgs/{org}/repos | List an organization's repos -[**org_list_team_activity_feeds**](OrganizationApi.md#org_list_team_activity_feeds) | **GET** /teams/{id}/activities/feeds | List a team's activity feeds -[**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 -[**org_search_run_jobs**](OrganizationApi.md#org_search_run_jobs) | **GET** /orgs/{org}/actions/runners/jobs | Search for organization's action jobs according filter conditions -[**org_unblock_user**](OrganizationApi.md#org_unblock_user) | **PUT** /orgs/{org}/unblock/{username} | Unblock a user from the organization -[**org_update_avatar**](OrganizationApi.md#org_update_avatar) | **POST** /orgs/{org}/avatar | Update an organization's avatar -[**rename_org**](OrganizationApi.md#rename_org) | **POST** /orgs/{org}/rename | Rename an organization -[**team_search**](OrganizationApi.md#team_search) | **GET** /orgs/{org}/teams/search | Search for teams within an organization -[**update_org_secret**](OrganizationApi.md#update_org_secret) | **PUT** /orgs/{org}/actions/secrets/{secretname} | Create or Update a secret value in an organization -[**update_org_variable**](OrganizationApi.md#update_org_variable) | **PUT** /orgs/{org}/actions/variables/{variablename} | Update variable in organization - - - -## create_org_repo - -> 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 - -[**models::Repository**](Repository.md) - -### Authorization - -[TOTPHeader](../README.md#TOTPHeader), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [SudoHeader](../README.md#SudoHeader), [BasicAuth](../README.md#BasicAuth), [AccessToken](../README.md#AccessToken), [SudoParam](../README.md#SudoParam), [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 - -> 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 - -[**models::Repository**](Repository.md) - -### Authorization - -[TOTPHeader](../README.md#TOTPHeader), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [SudoHeader](../README.md#SudoHeader), [BasicAuth](../README.md#BasicAuth), [AccessToken](../README.md#AccessToken), [SudoParam](../README.md#SudoParam), [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_variable - -> create_org_variable(org, variablename, body) -Create a new variable in organization - -### Parameters - - -Name | Type | Description | Required | Notes -------------- | ------------- | ------------- | ------------- | ------------- -**org** | **String** | name of the organization | [required] | -**variablename** | **String** | name of the variable | [required] | -**body** | Option<[**CreateVariableOption**](CreateVariableOption.md)> | | | - -### Return type - - (empty response body) - -### Authorization - -[TOTPHeader](../README.md#TOTPHeader), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [SudoHeader](../README.md#SudoHeader), [BasicAuth](../README.md#BasicAuth), [AccessToken](../README.md#AccessToken), [SudoParam](../README.md#SudoParam), [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) - - -## delete_org_secret - -> delete_org_secret(org, secretname) -Delete a secret in an organization - -### Parameters - - -Name | Type | Description | Required | Notes -------------- | ------------- | ------------- | ------------- | ------------- -**org** | **String** | name of organization | [required] | -**secretname** | **String** | name of the secret | [required] | - -### Return type - - (empty response body) - -### Authorization - -[TOTPHeader](../README.md#TOTPHeader), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [SudoHeader](../README.md#SudoHeader), [BasicAuth](../README.md#BasicAuth), [AccessToken](../README.md#AccessToken), [SudoParam](../README.md#SudoParam), [Token](../README.md#Token) - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - - -## delete_org_variable - -> delete_org_variable(org, variablename) -Delete organization's variable by name - -### Parameters - - -Name | Type | Description | Required | Notes -------------- | ------------- | ------------- | ------------- | ------------- -**org** | **String** | name of the organization | [required] | -**variablename** | **String** | name of the variable | [required] | - -### Return type - - (empty response body) - -### Authorization - -[TOTPHeader](../README.md#TOTPHeader), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [SudoHeader](../README.md#SudoHeader), [BasicAuth](../README.md#BasicAuth), [AccessToken](../README.md#AccessToken), [SudoParam](../README.md#SudoParam), [Token](../README.md#Token) - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: application/json - -[[Back to top]](#) [[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_org_variable - -> models::ActionVariable get_org_variable(org, variablename) -Get organization's variable by name - -### Parameters - - -Name | Type | Description | Required | Notes -------------- | ------------- | ------------- | ------------- | ------------- -**org** | **String** | name of the organization | [required] | -**variablename** | **String** | name of the variable | [required] | - -### Return type - -[**models::ActionVariable**](ActionVariable.md) - -### Authorization - -[TOTPHeader](../README.md#TOTPHeader), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [SudoHeader](../README.md#SudoHeader), [BasicAuth](../README.md#BasicAuth), [AccessToken](../README.md#AccessToken), [SudoParam](../README.md#SudoParam), [Token](../README.md#Token) - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: application/json - -[[Back to top]](#) [[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_org_variables_list - -> Vec get_org_variables_list(org, page, limit) -List variables of an organization - -### 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**](ActionVariable.md) - -### Authorization - -[TOTPHeader](../README.md#TOTPHeader), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [SudoHeader](../README.md#SudoHeader), [BasicAuth](../README.md#BasicAuth), [AccessToken](../README.md#AccessToken), [SudoParam](../README.md#SudoParam), [Token](../README.md#Token) - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: application/json - -[[Back to top]](#) [[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 - -[TOTPHeader](../README.md#TOTPHeader), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [SudoHeader](../README.md#SudoHeader), [BasicAuth](../README.md#BasicAuth), [AccessToken](../README.md#AccessToken), [SudoParam](../README.md#SudoParam), [Token](../README.md#Token) - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: application/json - -[[Back to top]](#) [[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 - -[TOTPHeader](../README.md#TOTPHeader), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [SudoHeader](../README.md#SudoHeader), [BasicAuth](../README.md#BasicAuth), [AccessToken](../README.md#AccessToken), [SudoParam](../README.md#SudoParam), [Token](../README.md#Token) - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: application/json - -[[Back to top]](#) [[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_block_user - -> org_block_user(org, username) -Blocks a user from the organization - -### Parameters - - -Name | Type | Description | Required | Notes -------------- | ------------- | ------------- | ------------- | ------------- -**org** | **String** | name of the org | [required] | -**username** | **String** | username of the user | [required] | - -### Return type - - (empty response body) - -### Authorization - -[TOTPHeader](../README.md#TOTPHeader), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [SudoHeader](../README.md#SudoHeader), [BasicAuth](../README.md#BasicAuth), [AccessToken](../README.md#AccessToken), [SudoParam](../README.md#SudoParam), [Token](../README.md#Token) - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: application/json - -[[Back to top]](#) [[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_check_quota - -> bool org_check_quota(org, subject) -Check if the organization is over quota for a given subject - -### Parameters - - -Name | Type | Description | Required | Notes -------------- | ------------- | ------------- | ------------- | ------------- -**org** | **String** | name of the organization | [required] | -**subject** | **String** | subject of the quota | [required] | - -### Return type - -**bool** - -### Authorization - -[TOTPHeader](../README.md#TOTPHeader), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [SudoHeader](../README.md#SudoHeader), [BasicAuth](../README.md#BasicAuth), [AccessToken](../README.md#AccessToken), [SudoParam](../README.md#SudoParam), [Token](../README.md#Token) - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: application/json - -[[Back to top]](#) [[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 - -[TOTPHeader](../README.md#TOTPHeader), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [SudoHeader](../README.md#SudoHeader), [BasicAuth](../README.md#BasicAuth), [AccessToken](../README.md#AccessToken), [SudoParam](../README.md#SudoParam), [Token](../README.md#Token) - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: application/json - -[[Back to top]](#) [[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 - -> models::Organization org_create(organization) -Create an organization - -### Parameters - - -Name | Type | Description | Required | Notes -------------- | ------------- | ------------- | ------------- | ------------- -**organization** | [**CreateOrgOption**](CreateOrgOption.md) | | [required] | - -### Return type - -[**models::Organization**](Organization.md) - -### Authorization - -[TOTPHeader](../README.md#TOTPHeader), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [SudoHeader](../README.md#SudoHeader), [BasicAuth](../README.md#BasicAuth), [AccessToken](../README.md#AccessToken), [SudoParam](../README.md#SudoParam), [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 - -> 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 - -[**models::Hook**](Hook.md) - -### Authorization - -[TOTPHeader](../README.md#TOTPHeader), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [SudoHeader](../README.md#SudoHeader), [BasicAuth](../README.md#BasicAuth), [AccessToken](../README.md#AccessToken), [SudoParam](../README.md#SudoParam), [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 - -> 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 - -[**models::Label**](Label.md) - -### Authorization - -[TOTPHeader](../README.md#TOTPHeader), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [SudoHeader](../README.md#SudoHeader), [BasicAuth](../README.md#BasicAuth), [AccessToken](../README.md#AccessToken), [SudoParam](../README.md#SudoParam), [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 - -> 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 - -[**models::Team**](Team.md) - -### Authorization - -[TOTPHeader](../README.md#TOTPHeader), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [SudoHeader](../README.md#SudoHeader), [BasicAuth](../README.md#BasicAuth), [AccessToken](../README.md#AccessToken), [SudoParam](../README.md#SudoParam), [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 - -[TOTPHeader](../README.md#TOTPHeader), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [SudoHeader](../README.md#SudoHeader), [BasicAuth](../README.md#BasicAuth), [AccessToken](../README.md#AccessToken), [SudoParam](../README.md#SudoParam), [Token](../README.md#Token) - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: application/json - -[[Back to top]](#) [[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_avatar - -> org_delete_avatar(org) -Delete an organization's avatar. It will be replaced by a default one - -### Parameters - - -Name | Type | Description | Required | Notes -------------- | ------------- | ------------- | ------------- | ------------- -**org** | **String** | name of the organization | [required] | - -### Return type - - (empty response body) - -### Authorization - -[TOTPHeader](../README.md#TOTPHeader), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [SudoHeader](../README.md#SudoHeader), [BasicAuth](../README.md#BasicAuth), [AccessToken](../README.md#AccessToken), [SudoParam](../README.md#SudoParam), [Token](../README.md#Token) - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: application/json - -[[Back to top]](#) [[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 - -[TOTPHeader](../README.md#TOTPHeader), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [SudoHeader](../README.md#SudoHeader), [BasicAuth](../README.md#BasicAuth), [AccessToken](../README.md#AccessToken), [SudoParam](../README.md#SudoParam), [Token](../README.md#Token) - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: application/json - -[[Back to top]](#) [[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 - -[TOTPHeader](../README.md#TOTPHeader), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [SudoHeader](../README.md#SudoHeader), [BasicAuth](../README.md#BasicAuth), [AccessToken](../README.md#AccessToken), [SudoParam](../README.md#SudoParam), [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) - - -## 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 - -[TOTPHeader](../README.md#TOTPHeader), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [SudoHeader](../README.md#SudoHeader), [BasicAuth](../README.md#BasicAuth), [AccessToken](../README.md#AccessToken), [SudoParam](../README.md#SudoParam), [Token](../README.md#Token) - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: application/json - -[[Back to top]](#) [[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 - -[TOTPHeader](../README.md#TOTPHeader), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [SudoHeader](../README.md#SudoHeader), [BasicAuth](../README.md#BasicAuth), [AccessToken](../README.md#AccessToken), [SudoParam](../README.md#SudoParam), [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) - - -## org_edit - -> 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 - -[**models::Organization**](Organization.md) - -### Authorization - -[TOTPHeader](../README.md#TOTPHeader), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [SudoHeader](../README.md#SudoHeader), [BasicAuth](../README.md#BasicAuth), [AccessToken](../README.md#AccessToken), [SudoParam](../README.md#SudoParam), [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 - -> 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 - -[**models::Hook**](Hook.md) - -### Authorization - -[TOTPHeader](../README.md#TOTPHeader), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [SudoHeader](../README.md#SudoHeader), [BasicAuth](../README.md#BasicAuth), [AccessToken](../README.md#AccessToken), [SudoParam](../README.md#SudoParam), [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 - -> 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 - -[**models::Label**](Label.md) - -### Authorization - -[TOTPHeader](../README.md#TOTPHeader), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [SudoHeader](../README.md#SudoHeader), [BasicAuth](../README.md#BasicAuth), [AccessToken](../README.md#AccessToken), [SudoParam](../README.md#SudoParam), [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 - -> models::Team org_edit_team(id, body) -Edit a team - -### Parameters - - -Name | Type | Description | Required | Notes -------------- | ------------- | ------------- | ------------- | ------------- -**id** | **i64** | id of the team to edit | [required] | -**body** | Option<[**EditTeamOption**](EditTeamOption.md)> | | | - -### Return type - -[**models::Team**](Team.md) - -### Authorization - -[TOTPHeader](../README.md#TOTPHeader), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [SudoHeader](../README.md#SudoHeader), [BasicAuth](../README.md#BasicAuth), [AccessToken](../README.md#AccessToken), [SudoParam](../README.md#SudoParam), [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 - -> 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 - -[**models::Organization**](Organization.md) - -### Authorization - -[TOTPHeader](../README.md#TOTPHeader), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [SudoHeader](../README.md#SudoHeader), [BasicAuth](../README.md#BasicAuth), [AccessToken](../README.md#AccessToken), [SudoParam](../README.md#SudoParam), [Token](../README.md#Token) - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: application/json - -[[Back to top]](#) [[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) -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 - -[TOTPHeader](../README.md#TOTPHeader), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [SudoHeader](../README.md#SudoHeader), [BasicAuth](../README.md#BasicAuth), [AccessToken](../README.md#AccessToken), [SudoParam](../README.md#SudoParam), [Token](../README.md#Token) - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: application/json - -[[Back to top]](#) [[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 - -> 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 - -[**models::Hook**](Hook.md) - -### Authorization - -[TOTPHeader](../README.md#TOTPHeader), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [SudoHeader](../README.md#SudoHeader), [BasicAuth](../README.md#BasicAuth), [AccessToken](../README.md#AccessToken), [SudoParam](../README.md#SudoParam), [Token](../README.md#Token) - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: application/json - -[[Back to top]](#) [[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 - -> 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 - -[**models::Label**](Label.md) - -### Authorization - -[TOTPHeader](../README.md#TOTPHeader), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [SudoHeader](../README.md#SudoHeader), [BasicAuth](../README.md#BasicAuth), [AccessToken](../README.md#AccessToken), [SudoParam](../README.md#SudoParam), [Token](../README.md#Token) - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: application/json - -[[Back to top]](#) [[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_quota - -> models::QuotaInfo org_get_quota(org) -Get quota information for an organization - -### Parameters - - -Name | Type | Description | Required | Notes -------------- | ------------- | ------------- | ------------- | ------------- -**org** | **String** | name of the organization | [required] | - -### Return type - -[**models::QuotaInfo**](QuotaInfo.md) - -### Authorization - -[TOTPHeader](../README.md#TOTPHeader), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [SudoHeader](../README.md#SudoHeader), [BasicAuth](../README.md#BasicAuth), [AccessToken](../README.md#AccessToken), [SudoParam](../README.md#SudoParam), [Token](../README.md#Token) - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: application/json - -[[Back to top]](#) [[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_runner_registration_token - -> models::RegistrationToken org_get_runner_registration_token(org) -Get an organization's actions runner registration token - -### Parameters - - -Name | Type | Description | Required | Notes -------------- | ------------- | ------------- | ------------- | ------------- -**org** | **String** | name of the organization | [required] | - -### Return type - -[**models::RegistrationToken**](RegistrationToken.md) - -### Authorization - -[TOTPHeader](../README.md#TOTPHeader), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [SudoHeader](../README.md#SudoHeader), [BasicAuth](../README.md#BasicAuth), [AccessToken](../README.md#AccessToken), [SudoParam](../README.md#SudoParam), [Token](../README.md#Token) - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: application/json - -[[Back to top]](#) [[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 - -> 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 - -[**models::Team**](Team.md) - -### Authorization - -[TOTPHeader](../README.md#TOTPHeader), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [SudoHeader](../README.md#SudoHeader), [BasicAuth](../README.md#BasicAuth), [AccessToken](../README.md#AccessToken), [SudoParam](../README.md#SudoParam), [Token](../README.md#Token) - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: application/json - -[[Back to top]](#) [[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 - -> 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 - -[**models::OrganizationPermissions**](OrganizationPermissions.md) - -### Authorization - -[TOTPHeader](../README.md#TOTPHeader), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [SudoHeader](../README.md#SudoHeader), [BasicAuth](../README.md#BasicAuth), [AccessToken](../README.md#AccessToken), [SudoParam](../README.md#SudoParam), [Token](../README.md#Token) - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: application/json - -[[Back to top]](#) [[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 - -[TOTPHeader](../README.md#TOTPHeader), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [SudoHeader](../README.md#SudoHeader), [BasicAuth](../README.md#BasicAuth), [AccessToken](../README.md#AccessToken), [SudoParam](../README.md#SudoParam), [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 - -[TOTPHeader](../README.md#TOTPHeader), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [SudoHeader](../README.md#SudoHeader), [BasicAuth](../README.md#BasicAuth), [AccessToken](../README.md#AccessToken), [SudoParam](../README.md#SudoParam), [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_actions_secrets - -> Vec org_list_actions_secrets(org, page, limit) -List actions secrets of an organization - -### 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**](Secret.md) - -### Authorization - -[TOTPHeader](../README.md#TOTPHeader), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [SudoHeader](../README.md#SudoHeader), [BasicAuth](../README.md#BasicAuth), [AccessToken](../README.md#AccessToken), [SudoParam](../README.md#SudoParam), [Token](../README.md#Token) - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: application/json - -[[Back to top]](#) [[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_activity_feeds - -> Vec org_list_activity_feeds(org, date, page, limit) -List an organization's activity feeds - -### Parameters - - -Name | Type | Description | Required | Notes -------------- | ------------- | ------------- | ------------- | ------------- -**org** | **String** | name of the org | [required] | -**date** | Option<**String**> | the date of the activities to be found | | -**page** | Option<**i32**> | page number of results to return (1-based) | | -**limit** | Option<**i32**> | page size of results | | - -### Return type - -[**Vec**](Activity.md) - -### Authorization - -[TOTPHeader](../README.md#TOTPHeader), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [SudoHeader](../README.md#SudoHeader), [BasicAuth](../README.md#BasicAuth), [AccessToken](../README.md#AccessToken), [SudoParam](../README.md#SudoParam), [Token](../README.md#Token) - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: application/json - -[[Back to top]](#) [[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_blocked_users - -> Vec org_list_blocked_users(org, page, limit) -List the organization's blocked users - -### Parameters - - -Name | Type | Description | Required | Notes -------------- | ------------- | ------------- | ------------- | ------------- -**org** | **String** | name of the org | [required] | -**page** | Option<**i32**> | page number of results to return (1-based) | | -**limit** | Option<**i32**> | page size of results | | - -### Return type - -[**Vec**](BlockedUser.md) - -### Authorization - -[TOTPHeader](../README.md#TOTPHeader), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [SudoHeader](../README.md#SudoHeader), [BasicAuth](../README.md#BasicAuth), [AccessToken](../README.md#AccessToken), [SudoParam](../README.md#SudoParam), [Token](../README.md#Token) - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: application/json - -[[Back to top]](#) [[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 - -[TOTPHeader](../README.md#TOTPHeader), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [SudoHeader](../README.md#SudoHeader), [BasicAuth](../README.md#BasicAuth), [AccessToken](../README.md#AccessToken), [SudoParam](../README.md#SudoParam), [Token](../README.md#Token) - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: application/json - -[[Back to top]](#) [[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 - -[TOTPHeader](../README.md#TOTPHeader), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [SudoHeader](../README.md#SudoHeader), [BasicAuth](../README.md#BasicAuth), [AccessToken](../README.md#AccessToken), [SudoParam](../README.md#SudoParam), [Token](../README.md#Token) - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: application/json - -[[Back to top]](#) [[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, sort, page, limit) -List an organization's labels - -### Parameters - - -Name | Type | Description | Required | Notes -------------- | ------------- | ------------- | ------------- | ------------- -**org** | **String** | name of the organization | [required] | -**sort** | Option<**String**> | Specifies the sorting method: mostissues, leastissues, or reversealphabetically. | | -**page** | Option<**i32**> | page number of results to return (1-based) | | -**limit** | Option<**i32**> | page size of results | | - -### Return type - -[**Vec**](Label.md) - -### Authorization - -[TOTPHeader](../README.md#TOTPHeader), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [SudoHeader](../README.md#SudoHeader), [BasicAuth](../README.md#BasicAuth), [AccessToken](../README.md#AccessToken), [SudoParam](../README.md#SudoParam), [Token](../README.md#Token) - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: application/json - -[[Back to top]](#) [[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 - -[TOTPHeader](../README.md#TOTPHeader), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [SudoHeader](../README.md#SudoHeader), [BasicAuth](../README.md#BasicAuth), [AccessToken](../README.md#AccessToken), [SudoParam](../README.md#SudoParam), [Token](../README.md#Token) - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: application/json - -[[Back to top]](#) [[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 - -[TOTPHeader](../README.md#TOTPHeader), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [SudoHeader](../README.md#SudoHeader), [BasicAuth](../README.md#BasicAuth), [AccessToken](../README.md#AccessToken), [SudoParam](../README.md#SudoParam), [Token](../README.md#Token) - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: application/json - -[[Back to top]](#) [[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_quota_artifacts - -> Vec org_list_quota_artifacts(org, page, limit) -List the artifacts affecting the organization's quota - -### 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**](QuotaUsedArtifact.md) - -### Authorization - -[TOTPHeader](../README.md#TOTPHeader), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [SudoHeader](../README.md#SudoHeader), [BasicAuth](../README.md#BasicAuth), [AccessToken](../README.md#AccessToken), [SudoParam](../README.md#SudoParam), [Token](../README.md#Token) - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: application/json - -[[Back to top]](#) [[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_quota_attachments - -> Vec org_list_quota_attachments(org, page, limit) -List the attachments affecting the organization's quota - -### 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**](QuotaUsedAttachment.md) - -### Authorization - -[TOTPHeader](../README.md#TOTPHeader), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [SudoHeader](../README.md#SudoHeader), [BasicAuth](../README.md#BasicAuth), [AccessToken](../README.md#AccessToken), [SudoParam](../README.md#SudoParam), [Token](../README.md#Token) - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: application/json - -[[Back to top]](#) [[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_quota_packages - -> Vec org_list_quota_packages(org, page, limit) -List the packages affecting the organization's quota - -### 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**](QuotaUsedPackage.md) - -### Authorization - -[TOTPHeader](../README.md#TOTPHeader), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [SudoHeader](../README.md#SudoHeader), [BasicAuth](../README.md#BasicAuth), [AccessToken](../README.md#AccessToken), [SudoParam](../README.md#SudoParam), [Token](../README.md#Token) - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: application/json - -[[Back to top]](#) [[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 - -[TOTPHeader](../README.md#TOTPHeader), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [SudoHeader](../README.md#SudoHeader), [BasicAuth](../README.md#BasicAuth), [AccessToken](../README.md#AccessToken), [SudoParam](../README.md#SudoParam), [Token](../README.md#Token) - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: application/json - -[[Back to top]](#) [[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_activity_feeds - -> Vec org_list_team_activity_feeds(id, date, page, limit) -List a team's activity feeds - -### Parameters - - -Name | Type | Description | Required | Notes -------------- | ------------- | ------------- | ------------- | ------------- -**id** | **i64** | id of the team | [required] | -**date** | Option<**String**> | the date of the activities to be found | | -**page** | Option<**i32**> | page number of results to return (1-based) | | -**limit** | Option<**i32**> | page size of results | | - -### Return type - -[**Vec**](Activity.md) - -### Authorization - -[TOTPHeader](../README.md#TOTPHeader), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [SudoHeader](../README.md#SudoHeader), [BasicAuth](../README.md#BasicAuth), [AccessToken](../README.md#AccessToken), [SudoParam](../README.md#SudoParam), [Token](../README.md#Token) - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: application/json - -[[Back to top]](#) [[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 - -> 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 - -[**models::User**](User.md) - -### Authorization - -[TOTPHeader](../README.md#TOTPHeader), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [SudoHeader](../README.md#SudoHeader), [BasicAuth](../README.md#BasicAuth), [AccessToken](../README.md#AccessToken), [SudoParam](../README.md#SudoParam), [Token](../README.md#Token) - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: application/json - -[[Back to top]](#) [[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 - -[TOTPHeader](../README.md#TOTPHeader), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [SudoHeader](../README.md#SudoHeader), [BasicAuth](../README.md#BasicAuth), [AccessToken](../README.md#AccessToken), [SudoParam](../README.md#SudoParam), [Token](../README.md#Token) - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: application/json - -[[Back to top]](#) [[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 - -> 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 - -[**models::Repository**](Repository.md) - -### Authorization - -[TOTPHeader](../README.md#TOTPHeader), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [SudoHeader](../README.md#SudoHeader), [BasicAuth](../README.md#BasicAuth), [AccessToken](../README.md#AccessToken), [SudoParam](../README.md#SudoParam), [Token](../README.md#Token) - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: application/json - -[[Back to top]](#) [[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 - -[TOTPHeader](../README.md#TOTPHeader), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [SudoHeader](../README.md#SudoHeader), [BasicAuth](../README.md#BasicAuth), [AccessToken](../README.md#AccessToken), [SudoParam](../README.md#SudoParam), [Token](../README.md#Token) - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: application/json - -[[Back to top]](#) [[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 - -[TOTPHeader](../README.md#TOTPHeader), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [SudoHeader](../README.md#SudoHeader), [BasicAuth](../README.md#BasicAuth), [AccessToken](../README.md#AccessToken), [SudoParam](../README.md#SudoParam), [Token](../README.md#Token) - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: application/json - -[[Back to top]](#) [[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 - -[TOTPHeader](../README.md#TOTPHeader), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [SudoHeader](../README.md#SudoHeader), [BasicAuth](../README.md#BasicAuth), [AccessToken](../README.md#AccessToken), [SudoParam](../README.md#SudoParam), [Token](../README.md#Token) - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: application/json - -[[Back to top]](#) [[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 - -[TOTPHeader](../README.md#TOTPHeader), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [SudoHeader](../README.md#SudoHeader), [BasicAuth](../README.md#BasicAuth), [AccessToken](../README.md#AccessToken), [SudoParam](../README.md#SudoParam), [Token](../README.md#Token) - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: application/json - -[[Back to top]](#) [[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 - -[TOTPHeader](../README.md#TOTPHeader), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [SudoHeader](../README.md#SudoHeader), [BasicAuth](../README.md#BasicAuth), [AccessToken](../README.md#AccessToken), [SudoParam](../README.md#SudoParam), [Token](../README.md#Token) - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: application/json - -[[Back to top]](#) [[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 - -[TOTPHeader](../README.md#TOTPHeader), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [SudoHeader](../README.md#SudoHeader), [BasicAuth](../README.md#BasicAuth), [AccessToken](../README.md#AccessToken), [SudoParam](../README.md#SudoParam), [Token](../README.md#Token) - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: application/json - -[[Back to top]](#) [[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_search_run_jobs - -> Vec org_search_run_jobs(org, labels) -Search for organization's action jobs according filter conditions - -### Parameters - - -Name | Type | Description | Required | Notes -------------- | ------------- | ------------- | ------------- | ------------- -**org** | **String** | name of the organization | [required] | -**labels** | Option<**String**> | a comma separated list of run job labels to search for | | - -### Return type - -[**Vec**](ActionRunJob.md) - -### Authorization - -[TOTPHeader](../README.md#TOTPHeader), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [SudoHeader](../README.md#SudoHeader), [BasicAuth](../README.md#BasicAuth), [AccessToken](../README.md#AccessToken), [SudoParam](../README.md#SudoParam), [Token](../README.md#Token) - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: application/json - -[[Back to top]](#) [[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_unblock_user - -> org_unblock_user(org, username) -Unblock a user from the organization - -### Parameters - - -Name | Type | Description | Required | Notes -------------- | ------------- | ------------- | ------------- | ------------- -**org** | **String** | name of the org | [required] | -**username** | **String** | username of the user | [required] | - -### Return type - - (empty response body) - -### Authorization - -[TOTPHeader](../README.md#TOTPHeader), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [SudoHeader](../README.md#SudoHeader), [BasicAuth](../README.md#BasicAuth), [AccessToken](../README.md#AccessToken), [SudoParam](../README.md#SudoParam), [Token](../README.md#Token) - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: application/json - -[[Back to top]](#) [[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_update_avatar - -> org_update_avatar(org, body) -Update an organization's avatar - -### Parameters - - -Name | Type | Description | Required | Notes -------------- | ------------- | ------------- | ------------- | ------------- -**org** | **String** | name of the organization | [required] | -**body** | Option<[**UpdateUserAvatarOption**](UpdateUserAvatarOption.md)> | | | - -### Return type - - (empty response body) - -### Authorization - -[TOTPHeader](../README.md#TOTPHeader), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [SudoHeader](../README.md#SudoHeader), [BasicAuth](../README.md#BasicAuth), [AccessToken](../README.md#AccessToken), [SudoParam](../README.md#SudoParam), [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) - - -## rename_org - -> rename_org(org, body) -Rename an organization - -### Parameters - - -Name | Type | Description | Required | Notes -------------- | ------------- | ------------- | ------------- | ------------- -**org** | **String** | existing org name | [required] | -**body** | [**RenameOrgOption**](RenameOrgOption.md) | | [required] | - -### Return type - - (empty response body) - -### Authorization - -[TOTPHeader](../README.md#TOTPHeader), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [SudoHeader](../README.md#SudoHeader), [BasicAuth](../README.md#BasicAuth), [AccessToken](../README.md#AccessToken), [SudoParam](../README.md#SudoParam), [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) - - -## team_search - -> models::TeamSearchResults 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 - -[**models::TeamSearchResults**](TeamSearchResults.md) - -### Authorization - -[TOTPHeader](../README.md#TOTPHeader), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [SudoHeader](../README.md#SudoHeader), [BasicAuth](../README.md#BasicAuth), [AccessToken](../README.md#AccessToken), [SudoParam](../README.md#SudoParam), [Token](../README.md#Token) - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: application/json - -[[Back to top]](#) [[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_org_secret - -> update_org_secret(org, secretname, body) -Create or Update a secret value in an organization - -### Parameters - - -Name | Type | Description | Required | Notes -------------- | ------------- | ------------- | ------------- | ------------- -**org** | **String** | name of organization | [required] | -**secretname** | **String** | name of the secret | [required] | -**body** | Option<[**CreateOrUpdateSecretOption**](CreateOrUpdateSecretOption.md)> | | | - -### Return type - - (empty response body) - -### Authorization - -[TOTPHeader](../README.md#TOTPHeader), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [SudoHeader](../README.md#SudoHeader), [BasicAuth](../README.md#BasicAuth), [AccessToken](../README.md#AccessToken), [SudoParam](../README.md#SudoParam), [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) - - -## update_org_variable - -> update_org_variable(org, variablename, body) -Update variable in organization - -### Parameters - - -Name | Type | Description | Required | Notes -------------- | ------------- | ------------- | ------------- | ------------- -**org** | **String** | name of the organization | [required] | -**variablename** | **String** | name of the variable | [required] | -**body** | Option<[**UpdateVariableOption**](UpdateVariableOption.md)> | | | - -### Return type - - (empty response body) - -### Authorization - -[TOTPHeader](../README.md#TOTPHeader), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [SudoHeader](../README.md#SudoHeader), [BasicAuth](../README.md#BasicAuth), [AccessToken](../README.md#AccessToken), [SudoParam](../README.md#SudoParam), [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) - diff --git a/docs/OrganizationPermissions.md b/docs/OrganizationPermissions.md deleted file mode 100644 index 7a964fa..0000000 --- a/docs/OrganizationPermissions.md +++ /dev/null @@ -1,15 +0,0 @@ -# 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/docs/Package.md b/docs/Package.md deleted file mode 100644 index 29ef457..0000000 --- a/docs/Package.md +++ /dev/null @@ -1,19 +0,0 @@ -# Package - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**created_at** | Option<**String**> | | [optional] -**creator** | Option<[**models::User**](User.md)> | | [optional] -**html_url** | Option<**String**> | | [optional] -**id** | Option<**i64**> | | [optional] -**name** | Option<**String**> | | [optional] -**owner** | Option<[**models::User**](User.md)> | | [optional] -**repository** | Option<[**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/docs/PackageApi.md b/docs/PackageApi.md deleted file mode 100644 index 39540b5..0000000 --- a/docs/PackageApi.md +++ /dev/null @@ -1,200 +0,0 @@ -# \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 -[**link_package**](PackageApi.md#link_package) | **POST** /packages/{owner}/{type}/{name}/-/link/{repo_name} | Link a package to a repository -[**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 -[**unlink_package**](PackageApi.md#unlink_package) | **POST** /packages/{owner}/{type}/{name}/-/unlink | Unlink a package from a repository - - - -## 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 - -[TOTPHeader](../README.md#TOTPHeader), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [SudoHeader](../README.md#SudoHeader), [BasicAuth](../README.md#BasicAuth), [AccessToken](../README.md#AccessToken), [SudoParam](../README.md#SudoParam), [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) - - -## get_package - -> 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 - -[**models::Package**](Package.md) - -### Authorization - -[TOTPHeader](../README.md#TOTPHeader), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [SudoHeader](../README.md#SudoHeader), [BasicAuth](../README.md#BasicAuth), [AccessToken](../README.md#AccessToken), [SudoParam](../README.md#SudoParam), [Token](../README.md#Token) - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - - -## link_package - -> link_package(owner, r#type, name, repo_name) -Link a package to a repository - -### 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] | -**repo_name** | **String** | name of the repository to link. | [required] | - -### Return type - - (empty response body) - -### Authorization - -[TOTPHeader](../README.md#TOTPHeader), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [SudoHeader](../README.md#SudoHeader), [BasicAuth](../README.md#BasicAuth), [AccessToken](../README.md#AccessToken), [SudoParam](../README.md#SudoParam), [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) - - -## 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 - -[TOTPHeader](../README.md#TOTPHeader), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [SudoHeader](../README.md#SudoHeader), [BasicAuth](../README.md#BasicAuth), [AccessToken](../README.md#AccessToken), [SudoParam](../README.md#SudoParam), [Token](../README.md#Token) - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: application/json - -[[Back to top]](#) [[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 - -[TOTPHeader](../README.md#TOTPHeader), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [SudoHeader](../README.md#SudoHeader), [BasicAuth](../README.md#BasicAuth), [AccessToken](../README.md#AccessToken), [SudoParam](../README.md#SudoParam), [Token](../README.md#Token) - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - - -## unlink_package - -> unlink_package(owner, r#type, name) -Unlink a package from a repository - -### 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] | - -### Return type - - (empty response body) - -### Authorization - -[TOTPHeader](../README.md#TOTPHeader), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [SudoHeader](../README.md#SudoHeader), [BasicAuth](../README.md#BasicAuth), [AccessToken](../README.md#AccessToken), [SudoParam](../README.md#SudoParam), [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) - diff --git a/docs/PackageFile.md b/docs/PackageFile.md deleted file mode 100644 index 772bfb0..0000000 --- a/docs/PackageFile.md +++ /dev/null @@ -1,17 +0,0 @@ -# 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/docs/PayloadCommit.md b/docs/PayloadCommit.md deleted file mode 100644 index cf9126f..0000000 --- a/docs/PayloadCommit.md +++ /dev/null @@ -1,20 +0,0 @@ -# PayloadCommit - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**added** | Option<**Vec**> | | [optional] -**author** | Option<[**models::PayloadUser**](PayloadUser.md)> | | [optional] -**committer** | Option<[**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<[**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/docs/PayloadCommitVerification.md b/docs/PayloadCommitVerification.md deleted file mode 100644 index d6e7c6c..0000000 --- a/docs/PayloadCommitVerification.md +++ /dev/null @@ -1,15 +0,0 @@ -# PayloadCommitVerification - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**payload** | Option<**String**> | | [optional] -**reason** | Option<**String**> | | [optional] -**signature** | Option<**String**> | | [optional] -**signer** | Option<[**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/docs/PayloadUser.md b/docs/PayloadUser.md deleted file mode 100644 index 2a1065b..0000000 --- a/docs/PayloadUser.md +++ /dev/null @@ -1,13 +0,0 @@ -# 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/docs/Permission.md b/docs/Permission.md deleted file mode 100644 index 88c2032..0000000 --- a/docs/Permission.md +++ /dev/null @@ -1,13 +0,0 @@ -# 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/docs/PrBranchInfo.md b/docs/PrBranchInfo.md deleted file mode 100644 index 1cfd8a0..0000000 --- a/docs/PrBranchInfo.md +++ /dev/null @@ -1,15 +0,0 @@ -# PrBranchInfo - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**label** | Option<**String**> | | [optional] -**r#ref** | Option<**String**> | | [optional] -**repo** | Option<[**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/docs/PublicKey.md b/docs/PublicKey.md deleted file mode 100644 index 39ee65a..0000000 --- a/docs/PublicKey.md +++ /dev/null @@ -1,19 +0,0 @@ -# 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<[**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/docs/PullRequest.md b/docs/PullRequest.md deleted file mode 100644 index 568ba58..0000000 --- a/docs/PullRequest.md +++ /dev/null @@ -1,48 +0,0 @@ -# PullRequest - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**additions** | Option<**i64**> | | [optional] -**allow_maintainer_edit** | Option<**bool**> | | [optional] -**assignee** | Option<[**models::User**](User.md)> | | [optional] -**assignees** | Option<[**Vec**](User.md)> | | [optional] -**base** | Option<[**models::PrBranchInfo**](PRBranchInfo.md)> | | [optional] -**body** | Option<**String**> | | [optional] -**changed_files** | Option<**i64**> | | [optional] -**closed_at** | Option<**String**> | | [optional] -**comments** | Option<**i64**> | | [optional] -**created_at** | Option<**String**> | | [optional] -**deletions** | Option<**i64**> | | [optional] -**diff_url** | Option<**String**> | | [optional] -**draft** | Option<**bool**> | | [optional] -**due_date** | Option<**String**> | | [optional] -**flow** | Option<**i64**> | | [optional] -**head** | Option<[**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<[**models::User**](User.md)> | | [optional] -**milestone** | Option<[**models::Milestone**](Milestone.md)> | | [optional] -**number** | Option<**i64**> | | [optional] -**patch_url** | Option<**String**> | | [optional] -**pin_order** | Option<**i64**> | | [optional] -**requested_reviewers** | Option<[**Vec**](User.md)> | | [optional] -**requested_reviewers_teams** | Option<[**Vec**](Team.md)> | | [optional] -**review_comments** | Option<**i64**> | number of review comments made on the diff of a PR review (not including comments on commits or issues in a PR) | [optional] -**state** | Option<**String**> | StateType issue state type | [optional] -**title** | Option<**String**> | | [optional] -**updated_at** | Option<**String**> | | [optional] -**url** | Option<**String**> | | [optional] -**user** | Option<[**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/docs/PullRequestMeta.md b/docs/PullRequestMeta.md deleted file mode 100644 index 9b089db..0000000 --- a/docs/PullRequestMeta.md +++ /dev/null @@ -1,14 +0,0 @@ -# PullRequestMeta - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**draft** | Option<**bool**> | | [optional] -**html_url** | Option<**String**> | | [optional] -**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/docs/PullReview.md b/docs/PullReview.md deleted file mode 100644 index 006b465..0000000 --- a/docs/PullReview.md +++ /dev/null @@ -1,24 +0,0 @@ -# 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<[**models::Team**](Team.md)> | | [optional] -**updated_at** | Option<**String**> | | [optional] -**user** | Option<[**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/docs/PullReviewComment.md b/docs/PullReviewComment.md deleted file mode 100644 index 5aa0e29..0000000 --- a/docs/PullReviewComment.md +++ /dev/null @@ -1,25 +0,0 @@ -# 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<[**models::User**](User.md)> | | [optional] -**updated_at** | Option<**String**> | | [optional] -**user** | Option<[**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/docs/PullReviewRequestOptions.md b/docs/PullReviewRequestOptions.md deleted file mode 100644 index 8dfc1da..0000000 --- a/docs/PullReviewRequestOptions.md +++ /dev/null @@ -1,12 +0,0 @@ -# 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/docs/PushMirror.md b/docs/PushMirror.md deleted file mode 100644 index d824d71..0000000 --- a/docs/PushMirror.md +++ /dev/null @@ -1,20 +0,0 @@ -# PushMirror - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**branch_filter** | Option<**String**> | | [optional] -**created** | Option<**String**> | | [optional] -**interval** | Option<**String**> | | [optional] -**last_error** | Option<**String**> | | [optional] -**last_update** | Option<**String**> | | [optional] -**public_key** | Option<**String**> | | [optional] -**remote_address** | Option<**String**> | | [optional] -**remote_name** | Option<**String**> | | [optional] -**repo_name** | Option<**String**> | | [optional] -**sync_on_commit** | 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/docs/QuotaGroup.md b/docs/QuotaGroup.md deleted file mode 100644 index c89aad6..0000000 --- a/docs/QuotaGroup.md +++ /dev/null @@ -1,12 +0,0 @@ -# QuotaGroup - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**name** | Option<**String**> | Name of the group | [optional] -**rules** | Option<[**Vec**](QuotaRuleInfo.md)> | Rules associated with the group | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/docs/QuotaInfo.md b/docs/QuotaInfo.md deleted file mode 100644 index 6ad6bc8..0000000 --- a/docs/QuotaInfo.md +++ /dev/null @@ -1,12 +0,0 @@ -# QuotaInfo - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**groups** | Option<[**Vec**](QuotaGroup.md)> | QuotaGroupList represents a list of quota groups | [optional] -**used** | Option<[**models::QuotaUsed**](QuotaUsed.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/docs/QuotaRuleInfo.md b/docs/QuotaRuleInfo.md deleted file mode 100644 index 24a9842..0000000 --- a/docs/QuotaRuleInfo.md +++ /dev/null @@ -1,13 +0,0 @@ -# QuotaRuleInfo - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**limit** | Option<**i64**> | The limit set by the rule | [optional] -**name** | Option<**String**> | Name of the rule (only shown to admins) | [optional] -**subjects** | Option<**Vec**> | Subjects the rule affects | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/docs/QuotaUsed.md b/docs/QuotaUsed.md deleted file mode 100644 index b52b9d0..0000000 --- a/docs/QuotaUsed.md +++ /dev/null @@ -1,11 +0,0 @@ -# QuotaUsed - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**size** | Option<[**models::QuotaUsedSize**](QuotaUsedSize.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/docs/QuotaUsedArtifact.md b/docs/QuotaUsedArtifact.md deleted file mode 100644 index 63f9be4..0000000 --- a/docs/QuotaUsedArtifact.md +++ /dev/null @@ -1,13 +0,0 @@ -# QuotaUsedArtifact - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**html_url** | Option<**String**> | HTML URL to the action run containing the artifact | [optional] -**name** | Option<**String**> | Name of the artifact | [optional] -**size** | Option<**i64**> | Size of the artifact (compressed) | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/docs/QuotaUsedAttachment.md b/docs/QuotaUsedAttachment.md deleted file mode 100644 index 1ebd2ec..0000000 --- a/docs/QuotaUsedAttachment.md +++ /dev/null @@ -1,14 +0,0 @@ -# QuotaUsedAttachment - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**api_url** | Option<**String**> | API URL for the attachment | [optional] -**contained_in** | Option<[**models::QuotaUsedAttachmentContainedIn**](QuotaUsedAttachmentContainedIn.md)> | | [optional] -**name** | Option<**String**> | Filename of the attachment | [optional] -**size** | Option<**i64**> | Size of the attachment (in bytes) | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/docs/QuotaUsedAttachmentContainedIn.md b/docs/QuotaUsedAttachmentContainedIn.md deleted file mode 100644 index 52b973c..0000000 --- a/docs/QuotaUsedAttachmentContainedIn.md +++ /dev/null @@ -1,12 +0,0 @@ -# QuotaUsedAttachmentContainedIn - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**api_url** | Option<**String**> | API URL for the object that contains this attachment | [optional] -**html_url** | Option<**String**> | HTML URL for the object that contains this attachment | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/docs/QuotaUsedPackage.md b/docs/QuotaUsedPackage.md deleted file mode 100644 index a9c830e..0000000 --- a/docs/QuotaUsedPackage.md +++ /dev/null @@ -1,15 +0,0 @@ -# QuotaUsedPackage - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**html_url** | Option<**String**> | HTML URL to the package version | [optional] -**name** | Option<**String**> | Name of the package | [optional] -**size** | Option<**i64**> | Size of the package version | [optional] -**r#type** | Option<**String**> | Type of the package | [optional] -**version** | Option<**String**> | Version of the package | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/docs/QuotaUsedSize.md b/docs/QuotaUsedSize.md deleted file mode 100644 index f270b02..0000000 --- a/docs/QuotaUsedSize.md +++ /dev/null @@ -1,13 +0,0 @@ -# QuotaUsedSize - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**assets** | Option<[**models::QuotaUsedSizeAssets**](QuotaUsedSizeAssets.md)> | | [optional] -**git** | Option<[**models::QuotaUsedSizeGit**](QuotaUsedSizeGit.md)> | | [optional] -**repos** | Option<[**models::QuotaUsedSizeRepos**](QuotaUsedSizeRepos.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/docs/QuotaUsedSizeAssets.md b/docs/QuotaUsedSizeAssets.md deleted file mode 100644 index 775755e..0000000 --- a/docs/QuotaUsedSizeAssets.md +++ /dev/null @@ -1,13 +0,0 @@ -# QuotaUsedSizeAssets - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**artifacts** | Option<**i64**> | Storage size used for the user's artifacts | [optional] -**attachments** | Option<[**models::QuotaUsedSizeAssetsAttachments**](QuotaUsedSizeAssetsAttachments.md)> | | [optional] -**packages** | Option<[**models::QuotaUsedSizeAssetsPackages**](QuotaUsedSizeAssetsPackages.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/docs/QuotaUsedSizeAssetsAttachments.md b/docs/QuotaUsedSizeAssetsAttachments.md deleted file mode 100644 index d6f4650..0000000 --- a/docs/QuotaUsedSizeAssetsAttachments.md +++ /dev/null @@ -1,12 +0,0 @@ -# QuotaUsedSizeAssetsAttachments - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**issues** | Option<**i64**> | Storage size used for the user's issue & comment attachments | [optional] -**releases** | Option<**i64**> | Storage size used for the user's release attachments | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/docs/QuotaUsedSizeAssetsPackages.md b/docs/QuotaUsedSizeAssetsPackages.md deleted file mode 100644 index d9c7fe4..0000000 --- a/docs/QuotaUsedSizeAssetsPackages.md +++ /dev/null @@ -1,11 +0,0 @@ -# QuotaUsedSizeAssetsPackages - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**all** | Option<**i64**> | Storage suze used for the user's packages | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/docs/QuotaUsedSizeGit.md b/docs/QuotaUsedSizeGit.md deleted file mode 100644 index fa5cae6..0000000 --- a/docs/QuotaUsedSizeGit.md +++ /dev/null @@ -1,11 +0,0 @@ -# QuotaUsedSizeGit - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**lfs** | Option<**i64**> | Storage size of the user's Git LFS objects | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/docs/QuotaUsedSizeRepos.md b/docs/QuotaUsedSizeRepos.md deleted file mode 100644 index 66df570..0000000 --- a/docs/QuotaUsedSizeRepos.md +++ /dev/null @@ -1,12 +0,0 @@ -# QuotaUsedSizeRepos - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**private** | Option<**i64**> | Storage size of the user's private repositories | [optional] -**public** | Option<**i64**> | Storage size of the user's public 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/docs/Reaction.md b/docs/Reaction.md deleted file mode 100644 index df4f20a..0000000 --- a/docs/Reaction.md +++ /dev/null @@ -1,13 +0,0 @@ -# Reaction - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**content** | Option<**String**> | | [optional] -**created_at** | Option<**String**> | | [optional] -**user** | Option<[**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/docs/Reference.md b/docs/Reference.md deleted file mode 100644 index 7698c9b..0000000 --- a/docs/Reference.md +++ /dev/null @@ -1,13 +0,0 @@ -# Reference - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**object** | Option<[**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/docs/RegistrationToken.md b/docs/RegistrationToken.md deleted file mode 100644 index b70b020..0000000 --- a/docs/RegistrationToken.md +++ /dev/null @@ -1,11 +0,0 @@ -# RegistrationToken - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**token** | 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/docs/Release.md b/docs/Release.md deleted file mode 100644 index 8a34107..0000000 --- a/docs/Release.md +++ /dev/null @@ -1,28 +0,0 @@ -# Release - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**archive_download_count** | Option<[**models::TagArchiveDownloadCount**](TagArchiveDownloadCount.md)> | | [optional] -**assets** | Option<[**Vec**](Attachment.md)> | | [optional] -**author** | Option<[**models::User**](User.md)> | | [optional] -**body** | Option<**String**> | | [optional] -**created_at** | Option<**String**> | | [optional] -**draft** | Option<**bool**> | | [optional] -**hide_archive_links** | 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] -**upload_url** | 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/docs/RenameOrgOption.md b/docs/RenameOrgOption.md deleted file mode 100644 index 90eadf9..0000000 --- a/docs/RenameOrgOption.md +++ /dev/null @@ -1,11 +0,0 @@ -# RenameOrgOption - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**new_name** | **String** | New username for this org. This name cannot be in use yet by any other user. | - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/docs/RenameUserOption.md b/docs/RenameUserOption.md deleted file mode 100644 index c5df112..0000000 --- a/docs/RenameUserOption.md +++ /dev/null @@ -1,11 +0,0 @@ -# RenameUserOption - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**new_username** | **String** | New username for this user. This name cannot be in use yet by any other user. | - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/docs/ReplaceFlagsOption.md b/docs/ReplaceFlagsOption.md deleted file mode 100644 index 6f5f83f..0000000 --- a/docs/ReplaceFlagsOption.md +++ /dev/null @@ -1,11 +0,0 @@ -# ReplaceFlagsOption - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**flags** | 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/docs/RepoCollaboratorPermission.md b/docs/RepoCollaboratorPermission.md deleted file mode 100644 index d748229..0000000 --- a/docs/RepoCollaboratorPermission.md +++ /dev/null @@ -1,13 +0,0 @@ -# RepoCollaboratorPermission - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**permission** | Option<**String**> | | [optional] -**role_name** | Option<**String**> | | [optional] -**user** | Option<[**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/docs/RepoCommit.md b/docs/RepoCommit.md deleted file mode 100644 index e40fe3d..0000000 --- a/docs/RepoCommit.md +++ /dev/null @@ -1,16 +0,0 @@ -# RepoCommit - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**author** | Option<[**models::CommitUser**](CommitUser.md)> | | [optional] -**committer** | Option<[**models::CommitUser**](CommitUser.md)> | | [optional] -**message** | Option<**String**> | | [optional] -**tree** | Option<[**models::CommitMeta**](CommitMeta.md)> | | [optional] -**url** | Option<**String**> | | [optional] -**verification** | Option<[**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/docs/RepoCreateReleaseAttachmentRequest.md b/docs/RepoCreateReleaseAttachmentRequest.md deleted file mode 100644 index 5c331f3..0000000 --- a/docs/RepoCreateReleaseAttachmentRequest.md +++ /dev/null @@ -1,12 +0,0 @@ -# RepoCreateReleaseAttachmentRequest - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**attachment** | Option<**std::path::PathBuf**> | attachment to upload (this parameter is incompatible with `external_url`) | [optional] -**external_url** | Option<**String**> | url to external asset (this parameter is incompatible with `attachment`) | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/docs/RepoTopicOptions.md b/docs/RepoTopicOptions.md deleted file mode 100644 index 3811737..0000000 --- a/docs/RepoTopicOptions.md +++ /dev/null @@ -1,11 +0,0 @@ -# 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/docs/RepoTransfer.md b/docs/RepoTransfer.md deleted file mode 100644 index bc5e8e0..0000000 --- a/docs/RepoTransfer.md +++ /dev/null @@ -1,13 +0,0 @@ -# RepoTransfer - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**doer** | Option<[**models::User**](User.md)> | | [optional] -**recipient** | Option<[**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/docs/Repository.md b/docs/Repository.md deleted file mode 100644 index b9f6014..0000000 --- a/docs/Repository.md +++ /dev/null @@ -1,73 +0,0 @@ -# Repository - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**allow_fast_forward_only_merge** | Option<**bool**> | | [optional] -**allow_merge_commits** | Option<**bool**> | | [optional] -**allow_rebase** | Option<**bool**> | | [optional] -**allow_rebase_explicit** | Option<**bool**> | | [optional] -**allow_rebase_update** | Option<**bool**> | | [optional] -**allow_squash_merge** | Option<**bool**> | | [optional] -**archived** | Option<**bool**> | | [optional] -**archived_at** | Option<**String**> | | [optional] -**avatar_url** | Option<**String**> | | [optional] -**clone_url** | Option<**String**> | | [optional] -**created_at** | Option<**String**> | | [optional] -**default_allow_maintainer_edit** | Option<**bool**> | | [optional] -**default_branch** | Option<**String**> | | [optional] -**default_delete_branch_after_merge** | Option<**bool**> | | [optional] -**default_merge_style** | Option<**String**> | | [optional] -**default_update_style** | Option<**String**> | | [optional] -**description** | Option<**String**> | | [optional] -**empty** | Option<**bool**> | | [optional] -**external_tracker** | Option<[**models::ExternalTracker**](ExternalTracker.md)> | | [optional] -**external_wiki** | Option<[**models::ExternalWiki**](ExternalWiki.md)> | | [optional] -**fork** | Option<**bool**> | | [optional] -**forks_count** | Option<**i64**> | | [optional] -**full_name** | Option<**String**> | | [optional] -**globally_editable_wiki** | Option<**bool**> | | [optional] -**has_actions** | Option<**bool**> | | [optional] -**has_issues** | Option<**bool**> | | [optional] -**has_packages** | Option<**bool**> | | [optional] -**has_projects** | Option<**bool**> | | [optional] -**has_pull_requests** | Option<**bool**> | | [optional] -**has_releases** | 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<[**models::InternalTracker**](InternalTracker.md)> | | [optional] -**language** | Option<**String**> | | [optional] -**languages_url** | Option<**String**> | | [optional] -**link** | Option<**String**> | | [optional] -**mirror** | Option<**bool**> | | [optional] -**mirror_interval** | Option<**String**> | | [optional] -**mirror_updated** | Option<**String**> | | [optional] -**name** | Option<**String**> | | [optional] -**object_format_name** | Option<**ObjectFormatName**> | ObjectFormatName of the underlying git repository (enum: sha1, sha256) | [optional] -**open_issues_count** | Option<**i64**> | | [optional] -**open_pr_counter** | Option<**i64**> | | [optional] -**original_url** | Option<**String**> | | [optional] -**owner** | Option<[**models::User**](User.md)> | | [optional] -**parent** | Option<[**models::Repository**](Repository.md)> | | [optional] -**permissions** | Option<[**models::Permission**](Permission.md)> | | [optional] -**private** | Option<**bool**> | | [optional] -**release_counter** | Option<**i64**> | | [optional] -**repo_transfer** | Option<[**models::RepoTransfer**](RepoTransfer.md)> | | [optional] -**size** | Option<**i64**> | | [optional] -**ssh_url** | Option<**String**> | | [optional] -**stars_count** | Option<**i64**> | | [optional] -**template** | Option<**bool**> | | [optional] -**topics** | Option<**Vec**> | | [optional] -**updated_at** | Option<**String**> | | [optional] -**url** | Option<**String**> | | [optional] -**watchers_count** | Option<**i64**> | | [optional] -**website** | Option<**String**> | | [optional] -**wiki_branch** | 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/docs/RepositoryApi.md b/docs/RepositoryApi.md deleted file mode 100644 index 1d96824..0000000 --- a/docs/RepositoryApi.md +++ /dev/null @@ -1,5816 +0,0 @@ -# \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 -[**action_run**](RepositoryApi.md#action_run) | **GET** /repos/{owner}/{repo}/actions/runs/{run_id} | Get an action run -[**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 -[**create_repo_variable**](RepositoryApi.md#create_repo_variable) | **POST** /repos/{owner}/{repo}/actions/variables/{variablename} | Create a repo-level variable -[**delete_repo_secret**](RepositoryApi.md#delete_repo_secret) | **DELETE** /repos/{owner}/{repo}/actions/secrets/{secretname} | Delete a secret in a repository -[**delete_repo_variable**](RepositoryApi.md#delete_repo_variable) | **DELETE** /repos/{owner}/{repo}/actions/variables/{variablename} | Delete a repo-level variable -[**dispatch_workflow**](RepositoryApi.md#dispatch_workflow) | **POST** /repos/{owner}/{repo}/actions/workflows/{workflowfilename}/dispatches | Dispatches a workflow -[**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_blobs**](RepositoryApi.md#get_blobs) | **GET** /repos/{owner}/{repo}/git/blobs | Gets multiple blobs of a repository. -[**get_repo_variable**](RepositoryApi.md#get_repo_variable) | **GET** /repos/{owner}/{repo}/actions/variables/{variablename} | Get a repo-level variable -[**get_repo_variables_list**](RepositoryApi.md#get_repo_variables_list) | **GET** /repos/{owner}/{repo}/actions/variables | Get repo-level variables list -[**get_tree**](RepositoryApi.md#get_tree) | **GET** /repos/{owner}/{repo}/git/trees/{sha} | Gets the tree of a repository. -[**list_action_runs**](RepositoryApi.md#list_action_runs) | **GET** /repos/{owner}/{repo}/actions/runs | List a repository's action runs -[**list_action_tasks**](RepositoryApi.md#list_action_tasks) | **GET** /repos/{owner}/{repo}/actions/tasks | List a repository's action tasks -[**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_flag**](RepositoryApi.md#repo_add_flag) | **PUT** /repos/{owner}/{repo}/flags/{flag} | Add a flag to a repository -[**repo_add_push_mirror**](RepositoryApi.md#repo_add_push_mirror) | **POST** /repos/{owner}/{repo}/push_mirrors | Set up a new push mirror in 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_change_files**](RepositoryApi.md#repo_change_files) | **POST** /repos/{owner}/{repo}/contents | Modify multiple files in a repository -[**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_flag**](RepositoryApi.md#repo_check_flag) | **GET** /repos/{owner}/{repo}/flags/{flag} | Check if a repository has a given flag -[**repo_check_team**](RepositoryApi.md#repo_check_team) | **GET** /repos/{owner}/{repo}/teams/{team} | Check if a team is assigned to a repository -[**repo_compare_diff**](RepositoryApi.md#repo_compare_diff) | **GET** /repos/{owner}/{repo}/compare/{basehead} | Get commit comparison information -[**repo_convert**](RepositoryApi.md#repo_convert) | **POST** /repos/{owner}/{repo}/convert | Convert a mirror repo to a normal repo. -[**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_comment**](RepositoryApi.md#repo_create_pull_review_comment) | **POST** /repos/{owner}/{repo}/pulls/{index}/reviews/{id}/comments | Add a new comment to a pull request review -[**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_tag_protection**](RepositoryApi.md#repo_create_tag_protection) | **POST** /repos/{owner}/{repo}/tag_protections | Create a tag protections for 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_all_flags**](RepositoryApi.md#repo_delete_all_flags) | **DELETE** /repos/{owner}/{repo}/flags | Remove all flags from a repository -[**repo_delete_avatar**](RepositoryApi.md#repo_delete_avatar) | **DELETE** /repos/{owner}/{repo}/avatar | Delete a repository's avatar -[**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_flag**](RepositoryApi.md#repo_delete_flag) | **DELETE** /repos/{owner}/{repo}/flags/{flag} | Remove a flag from 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_comment**](RepositoryApi.md#repo_delete_pull_review_comment) | **DELETE** /repos/{owner}/{repo}/pulls/{index}/reviews/{id}/comments/{comment} | Delete a pull review comment -[**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_push_mirror**](RepositoryApi.md#repo_delete_push_mirror) | **DELETE** /repos/{owner}/{repo}/push_mirrors/{name} | Remove a push mirror from a repository by remoteName -[**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_tag_protection**](RepositoryApi.md#repo_delete_tag_protection) | **DELETE** /repos/{owner}/{repo}/tag_protections/{id} | Delete a specific tag protection for the repository -[**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_tag_protection**](RepositoryApi.md#repo_edit_tag_protection) | **PATCH** /repos/{owner}/{repo}/tag_protections/{id} | Edit a tag protections for a repository. Only fields that are set will be changed -[**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_commit_pull_request**](RepositoryApi.md#repo_get_commit_pull_request) | **GET** /repos/{owner}/{repo}/commits/{sha}/pull | Get the pull request of the commit -[**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_config**](RepositoryApi.md#repo_get_issue_config) | **GET** /repos/{owner}/{repo}/issue_config | Returns the issue config for a repo -[**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_latest_release**](RepositoryApi.md#repo_get_latest_release) | **GET** /repos/{owner}/{repo}/releases/latest | Gets the most recent non-prerelease, non-draft release of a repository, sorted by created_at -[**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_by_base_head**](RepositoryApi.md#repo_get_pull_request_by_base_head) | **GET** /repos/{owner}/{repo}/pulls/{base}/{head} | Get a pull request by base and head -[**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_request_files**](RepositoryApi.md#repo_get_pull_request_files) | **GET** /repos/{owner}/{repo}/pulls/{index}/files | Get changed files 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_comment**](RepositoryApi.md#repo_get_pull_review_comment) | **GET** /repos/{owner}/{repo}/pulls/{index}/reviews/{id}/comments/{comment} | Get a pull review comment -[**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_push_mirror_by_remote_name**](RepositoryApi.md#repo_get_push_mirror_by_remote_name) | **GET** /repos/{owner}/{repo}/push_mirrors/{name} | Get push mirror of the repository by remoteName -[**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_runner_registration_token**](RepositoryApi.md#repo_get_runner_registration_token) | **GET** /repos/{owner}/{repo}/actions/runners/registration-token | Get a repository's actions runner registration token -[**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_tag_protection**](RepositoryApi.md#repo_get_tag_protection) | **GET** /repos/{owner}/{repo}/tag_protections/{id} | Get a specific tag protection for the repository -[**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_actions_secrets**](RepositoryApi.md#repo_list_actions_secrets) | **GET** /repos/{owner}/{repo}/actions/secrets | List an repo's actions secrets -[**repo_list_activity_feeds**](RepositoryApi.md#repo_list_activity_feeds) | **GET** /repos/{owner}/{repo}/activities/feeds | List a repository's activity feeds -[**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_flags**](RepositoryApi.md#repo_list_flags) | **GET** /repos/{owner}/{repo}/flags | List a repository's flags -[**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_pinned_issues**](RepositoryApi.md#repo_list_pinned_issues) | **GET** /repos/{owner}/{repo}/issues/pinned | List a repo's pinned issues -[**repo_list_pinned_pull_requests**](RepositoryApi.md#repo_list_pinned_pull_requests) | **GET** /repos/{owner}/{repo}/pulls/pinned | List a repo's pinned pull requests -[**repo_list_pull_requests**](RepositoryApi.md#repo_list_pull_requests) | **GET** /repos/{owner}/{repo}/pulls | List a repo's pull requests. If a pull request is selected but fails to be retrieved for any reason, it will be a null value in the list of results. -[**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_push_mirrors**](RepositoryApi.md#repo_list_push_mirrors) | **GET** /repos/{owner}/{repo}/push_mirrors | Get all push mirrors of the repository -[**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_tag_protection**](RepositoryApi.md#repo_list_tag_protection) | **GET** /repos/{owner}/{repo}/tag_protections | List tag protections for a repository -[**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_new_pin_allowed**](RepositoryApi.md#repo_new_pin_allowed) | **GET** /repos/{owner}/{repo}/new_pin_allowed | Returns if new Issue Pins are allowed -[**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_push_mirror_sync**](RepositoryApi.md#repo_push_mirror_sync) | **POST** /repos/{owner}/{repo}/push_mirrors-sync | Sync all push mirrored repository -[**repo_remove_note**](RepositoryApi.md#repo_remove_note) | **DELETE** /repos/{owner}/{repo}/git/notes/{sha} | Removes a note corresponding to a single commit from a repository -[**repo_replace_all_flags**](RepositoryApi.md#repo_replace_all_flags) | **PUT** /repos/{owner}/{repo}/flags | Replace all flags of a repository -[**repo_search**](RepositoryApi.md#repo_search) | **GET** /repos/search | Search for repositories -[**repo_search_run_jobs**](RepositoryApi.md#repo_search_run_jobs) | **GET** /repos/{owner}/{repo}/actions/runners/jobs | Search for repository's action jobs according filter conditions -[**repo_set_note**](RepositoryApi.md#repo_set_note) | **POST** /repos/{owner}/{repo}/git/notes/{sha} | Set a note corresponding to a single commit from a repository -[**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_sync_fork_branch**](RepositoryApi.md#repo_sync_fork_branch) | **POST** /repos/{owner}/{repo}/sync_fork/{branch} | Syncs a fork branch with the base branch -[**repo_sync_fork_branch_info**](RepositoryApi.md#repo_sync_fork_branch_info) | **GET** /repos/{owner}/{repo}/sync_fork/{branch} | Gets information about syncing a fork branch with the base branch -[**repo_sync_fork_default**](RepositoryApi.md#repo_sync_fork_default) | **POST** /repos/{owner}/{repo}/sync_fork | Syncs the default branch of a fork with the base branch -[**repo_sync_fork_default_info**](RepositoryApi.md#repo_sync_fork_default_info) | **GET** /repos/{owner}/{repo}/sync_fork | Gets information about syncing the fork default branch with the base branch -[**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_avatar**](RepositoryApi.md#repo_update_avatar) | **POST** /repos/{owner}/{repo}/avatar | Update a repository's avatar -[**repo_update_branch**](RepositoryApi.md#repo_update_branch) | **PATCH** /repos/{owner}/{repo}/branches/{branch} | Update a branch -[**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 -[**repo_validate_issue_config**](RepositoryApi.md#repo_validate_issue_config) | **GET** /repos/{owner}/{repo}/issue_config/validate | Returns the validation information for a issue config -[**topic_search**](RepositoryApi.md#topic_search) | **GET** /topics/search | Search for topics by keyword -[**update_repo_secret**](RepositoryApi.md#update_repo_secret) | **PUT** /repos/{owner}/{repo}/actions/secrets/{secretname} | Create or Update a secret value in a repository -[**update_repo_variable**](RepositoryApi.md#update_repo_variable) | **PUT** /repos/{owner}/{repo}/actions/variables/{variablename} | Update a repo-level variable -[**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 - -> 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 - -[**models::Repository**](Repository.md) - -### Authorization - -[TOTPHeader](../README.md#TOTPHeader), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [SudoHeader](../README.md#SudoHeader), [BasicAuth](../README.md#BasicAuth), [AccessToken](../README.md#AccessToken), [SudoParam](../README.md#SudoParam), [Token](../README.md#Token) - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - - -## action_run - -> models::ActionRun action_run(owner, repo, run_id) -Get an action run - -### Parameters - - -Name | Type | Description | Required | Notes -------------- | ------------- | ------------- | ------------- | ------------- -**owner** | **String** | owner of the repo | [required] | -**repo** | **String** | name of the repo | [required] | -**run_id** | **i64** | id of the action run | [required] | - -### Return type - -[**models::ActionRun**](ActionRun.md) - -### Authorization - -[TOTPHeader](../README.md#TOTPHeader), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [SudoHeader](../README.md#SudoHeader), [BasicAuth](../README.md#BasicAuth), [AccessToken](../README.md#AccessToken), [SudoParam](../README.md#SudoParam), [Token](../README.md#Token) - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: application/json - -[[Back to top]](#) [[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 - -> models::Repository create_current_user_repo(body) -Create a repository - -### Parameters - - -Name | Type | Description | Required | Notes -------------- | ------------- | ------------- | ------------- | ------------- -**body** | Option<[**CreateRepoOption**](CreateRepoOption.md)> | | | - -### Return type - -[**models::Repository**](Repository.md) - -### Authorization - -[TOTPHeader](../README.md#TOTPHeader), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [SudoHeader](../README.md#SudoHeader), [BasicAuth](../README.md#BasicAuth), [AccessToken](../README.md#AccessToken), [SudoParam](../README.md#SudoParam), [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 - -> 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 - -[**models::Repository**](Repository.md) - -### Authorization - -[TOTPHeader](../README.md#TOTPHeader), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [SudoHeader](../README.md#SudoHeader), [BasicAuth](../README.md#BasicAuth), [AccessToken](../README.md#AccessToken), [SudoParam](../README.md#SudoParam), [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) - - -## create_repo_variable - -> create_repo_variable(owner, repo, variablename, body) -Create a repo-level variable - -### Parameters - - -Name | Type | Description | Required | Notes -------------- | ------------- | ------------- | ------------- | ------------- -**owner** | **String** | name of the owner | [required] | -**repo** | **String** | name of the repository | [required] | -**variablename** | **String** | name of the variable | [required] | -**body** | Option<[**CreateVariableOption**](CreateVariableOption.md)> | | | - -### Return type - - (empty response body) - -### Authorization - -[TOTPHeader](../README.md#TOTPHeader), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [SudoHeader](../README.md#SudoHeader), [BasicAuth](../README.md#BasicAuth), [AccessToken](../README.md#AccessToken), [SudoParam](../README.md#SudoParam), [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) - - -## delete_repo_secret - -> delete_repo_secret(owner, repo, secretname) -Delete a secret in a repository - -### Parameters - - -Name | Type | Description | Required | Notes -------------- | ------------- | ------------- | ------------- | ------------- -**owner** | **String** | owner of the repository | [required] | -**repo** | **String** | name of the repository | [required] | -**secretname** | **String** | name of the secret | [required] | - -### Return type - - (empty response body) - -### Authorization - -[TOTPHeader](../README.md#TOTPHeader), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [SudoHeader](../README.md#SudoHeader), [BasicAuth](../README.md#BasicAuth), [AccessToken](../README.md#AccessToken), [SudoParam](../README.md#SudoParam), [Token](../README.md#Token) - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - - -## delete_repo_variable - -> delete_repo_variable(owner, repo, variablename) -Delete a repo-level variable - -### Parameters - - -Name | Type | Description | Required | Notes -------------- | ------------- | ------------- | ------------- | ------------- -**owner** | **String** | name of the owner | [required] | -**repo** | **String** | name of the repository | [required] | -**variablename** | **String** | name of the variable | [required] | - -### Return type - - (empty response body) - -### Authorization - -[TOTPHeader](../README.md#TOTPHeader), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [SudoHeader](../README.md#SudoHeader), [BasicAuth](../README.md#BasicAuth), [AccessToken](../README.md#AccessToken), [SudoParam](../README.md#SudoParam), [Token](../README.md#Token) - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - - -## dispatch_workflow - -> models::DispatchWorkflowRun dispatch_workflow(owner, repo, workflowfilename, body) -Dispatches a workflow - -### Parameters - - -Name | Type | Description | Required | Notes -------------- | ------------- | ------------- | ------------- | ------------- -**owner** | **String** | owner of the repo | [required] | -**repo** | **String** | name of the repo | [required] | -**workflowfilename** | **String** | name of the workflow | [required] | -**body** | Option<[**DispatchWorkflowOption**](DispatchWorkflowOption.md)> | | | - -### Return type - -[**models::DispatchWorkflowRun**](DispatchWorkflowRun.md) - -### Authorization - -[TOTPHeader](../README.md#TOTPHeader), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [SudoHeader](../README.md#SudoHeader), [BasicAuth](../README.md#BasicAuth), [AccessToken](../README.md#AccessToken), [SudoParam](../README.md#SudoParam), [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) - - -## generate_repo - -> 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 - -[**models::Repository**](Repository.md) - -### Authorization - -[TOTPHeader](../README.md#TOTPHeader), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [SudoHeader](../README.md#SudoHeader), [BasicAuth](../README.md#BasicAuth), [AccessToken](../README.md#AccessToken), [SudoParam](../README.md#SudoParam), [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 - -> 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 - -[**models::AnnotatedTag**](AnnotatedTag.md) - -### Authorization - -[TOTPHeader](../README.md#TOTPHeader), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [SudoHeader](../README.md#SudoHeader), [BasicAuth](../README.md#BasicAuth), [AccessToken](../README.md#AccessToken), [SudoParam](../README.md#SudoParam), [Token](../README.md#Token) - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: application/json - -[[Back to top]](#) [[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 - -> models::GitBlob 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 blob to retrieve | [required] | - -### Return type - -[**models::GitBlob**](GitBlob.md) - -### Authorization - -[TOTPHeader](../README.md#TOTPHeader), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [SudoHeader](../README.md#SudoHeader), [BasicAuth](../README.md#BasicAuth), [AccessToken](../README.md#AccessToken), [SudoParam](../README.md#SudoParam), [Token](../README.md#Token) - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: application/json - -[[Back to top]](#) [[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_blobs - -> Vec get_blobs(owner, repo, shas) -Gets multiple blobs of a repository. - -### Parameters - - -Name | Type | Description | Required | Notes -------------- | ------------- | ------------- | ------------- | ------------- -**owner** | **String** | owner of the repo | [required] | -**repo** | **String** | name of the repo | [required] | -**shas** | **String** | a comma separated list of blob-sha (mind the overall URL-length limit of ~2,083 chars) | [required] | - -### Return type - -[**Vec**](GitBlob.md) - -### Authorization - -[TOTPHeader](../README.md#TOTPHeader), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [SudoHeader](../README.md#SudoHeader), [BasicAuth](../README.md#BasicAuth), [AccessToken](../README.md#AccessToken), [SudoParam](../README.md#SudoParam), [Token](../README.md#Token) - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: application/json - -[[Back to top]](#) [[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_repo_variable - -> models::ActionVariable get_repo_variable(owner, repo, variablename) -Get a repo-level variable - -### Parameters - - -Name | Type | Description | Required | Notes -------------- | ------------- | ------------- | ------------- | ------------- -**owner** | **String** | name of the owner | [required] | -**repo** | **String** | name of the repository | [required] | -**variablename** | **String** | name of the variable | [required] | - -### Return type - -[**models::ActionVariable**](ActionVariable.md) - -### Authorization - -[TOTPHeader](../README.md#TOTPHeader), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [SudoHeader](../README.md#SudoHeader), [BasicAuth](../README.md#BasicAuth), [AccessToken](../README.md#AccessToken), [SudoParam](../README.md#SudoParam), [Token](../README.md#Token) - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: application/json - -[[Back to top]](#) [[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_repo_variables_list - -> Vec get_repo_variables_list(owner, repo, page, limit) -Get repo-level variables list - -### Parameters - - -Name | Type | Description | Required | Notes -------------- | ------------- | ------------- | ------------- | ------------- -**owner** | **String** | name of the owner | [required] | -**repo** | **String** | name of the repository | [required] | -**page** | Option<**i32**> | page number of results to return (1-based) | | -**limit** | Option<**i32**> | page size of results | | - -### Return type - -[**Vec**](ActionVariable.md) - -### Authorization - -[TOTPHeader](../README.md#TOTPHeader), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [SudoHeader](../README.md#SudoHeader), [BasicAuth](../README.md#BasicAuth), [AccessToken](../README.md#AccessToken), [SudoParam](../README.md#SudoParam), [Token](../README.md#Token) - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: application/json - -[[Back to top]](#) [[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 - -> 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 - -[**models::GitTreeResponse**](GitTreeResponse.md) - -### Authorization - -[TOTPHeader](../README.md#TOTPHeader), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [SudoHeader](../README.md#SudoHeader), [BasicAuth](../README.md#BasicAuth), [AccessToken](../README.md#AccessToken), [SudoParam](../README.md#SudoParam), [Token](../README.md#Token) - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: application/json - -[[Back to top]](#) [[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_action_runs - -> models::ListActionRunResponse list_action_runs(owner, repo, page, limit, event, status, run_number, head_sha) -List a repository's action runs - -### 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 | | -**event** | Option<[**Vec**](String.md)> | Returns workflow run triggered by the specified events. For example, `push`, `pull_request` or `workflow_dispatch`. | | -**status** | Option<[**Vec**](String.md)> | Returns workflow runs with the check run status or conclusion that is specified. For example, a conclusion can be success or a status can be in_progress. Only Forgejo Actions can set a status of waiting, pending, or requested. | | -**run_number** | Option<**i64**> | Returns the workflow run associated with the run number. | | -**head_sha** | Option<**String**> | Only returns workflow runs that are associated with the specified head_sha. | | - -### Return type - -[**models::ListActionRunResponse**](ListActionRunResponse.md) - -### Authorization - -[TOTPHeader](../README.md#TOTPHeader), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [SudoHeader](../README.md#SudoHeader), [BasicAuth](../README.md#BasicAuth), [AccessToken](../README.md#AccessToken), [SudoParam](../README.md#SudoParam), [Token](../README.md#Token) - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: application/json - -[[Back to top]](#) [[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_action_tasks - -> models::ActionTaskResponse list_action_tasks(owner, repo, page, limit) -List a repository's action tasks - -### 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 - -[**models::ActionTaskResponse**](ActionTaskResponse.md) - -### Authorization - -[TOTPHeader](../README.md#TOTPHeader), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [SudoHeader](../README.md#SudoHeader), [BasicAuth](../README.md#BasicAuth), [AccessToken](../README.md#AccessToken), [SudoParam](../README.md#SudoParam), [Token](../README.md#Token) - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: application/json - -[[Back to top]](#) [[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 - -[TOTPHeader](../README.md#TOTPHeader), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [SudoHeader](../README.md#SudoHeader), [BasicAuth](../README.md#BasicAuth), [AccessToken](../README.md#AccessToken), [SudoParam](../README.md#SudoParam), [Token](../README.md#Token) - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: application/json - -[[Back to top]](#) [[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 - -> 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 - -[**models::Repository**](Repository.md) - -### Authorization - -[TOTPHeader](../README.md#TOTPHeader), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [SudoHeader](../README.md#SudoHeader), [BasicAuth](../README.md#BasicAuth), [AccessToken](../README.md#AccessToken), [SudoParam](../README.md#SudoParam), [Token](../README.md#Token) - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: application/json - -[[Back to top]](#) [[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 - -[TOTPHeader](../README.md#TOTPHeader), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [SudoHeader](../README.md#SudoHeader), [BasicAuth](../README.md#BasicAuth), [AccessToken](../README.md#AccessToken), [SudoParam](../README.md#SudoParam), [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_add_flag - -> repo_add_flag(owner, repo, flag) -Add a flag to a repository - -### Parameters - - -Name | Type | Description | Required | Notes -------------- | ------------- | ------------- | ------------- | ------------- -**owner** | **String** | owner of the repo | [required] | -**repo** | **String** | name of the repo | [required] | -**flag** | **String** | name of the flag | [required] | - -### Return type - - (empty response body) - -### Authorization - -[TOTPHeader](../README.md#TOTPHeader), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [SudoHeader](../README.md#SudoHeader), [BasicAuth](../README.md#BasicAuth), [AccessToken](../README.md#AccessToken), [SudoParam](../README.md#SudoParam), [Token](../README.md#Token) - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: application/json - -[[Back to top]](#) [[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_push_mirror - -> models::PushMirror repo_add_push_mirror(owner, repo, body) -Set up a new push mirror 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<[**CreatePushMirrorOption**](CreatePushMirrorOption.md)> | | | - -### Return type - -[**models::PushMirror**](PushMirror.md) - -### Authorization - -[TOTPHeader](../README.md#TOTPHeader), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [SudoHeader](../README.md#SudoHeader), [BasicAuth](../README.md#BasicAuth), [AccessToken](../README.md#AccessToken), [SudoParam](../README.md#SudoParam), [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_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 - -[TOTPHeader](../README.md#TOTPHeader), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [SudoHeader](../README.md#SudoHeader), [BasicAuth](../README.md#BasicAuth), [AccessToken](../README.md#AccessToken), [SudoParam](../README.md#SudoParam), [Token](../README.md#Token) - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: application/json - -[[Back to top]](#) [[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 - -[TOTPHeader](../README.md#TOTPHeader), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [SudoHeader](../README.md#SudoHeader), [BasicAuth](../README.md#BasicAuth), [AccessToken](../README.md#AccessToken), [SudoParam](../README.md#SudoParam), [Token](../README.md#Token) - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: application/json - -[[Back to top]](#) [[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 - -> 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 - -[**models::FileResponse**](FileResponse.md) - -### Authorization - -[TOTPHeader](../README.md#TOTPHeader), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [SudoHeader](../README.md#SudoHeader), [BasicAuth](../README.md#BasicAuth), [AccessToken](../README.md#AccessToken), [SudoParam](../README.md#SudoParam), [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 - -[TOTPHeader](../README.md#TOTPHeader), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [SudoHeader](../README.md#SudoHeader), [BasicAuth](../README.md#BasicAuth), [AccessToken](../README.md#AccessToken), [SudoParam](../README.md#SudoParam), [Token](../README.md#Token) - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: application/json - -[[Back to top]](#) [[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_change_files - -> models::FilesResponse repo_change_files(owner, repo, body) -Modify multiple files in a repository - -### Parameters - - -Name | Type | Description | Required | Notes -------------- | ------------- | ------------- | ------------- | ------------- -**owner** | **String** | owner of the repo | [required] | -**repo** | **String** | name of the repo | [required] | -**body** | [**ChangeFilesOptions**](ChangeFilesOptions.md) | | [required] | - -### Return type - -[**models::FilesResponse**](FilesResponse.md) - -### Authorization - -[TOTPHeader](../README.md#TOTPHeader), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [SudoHeader](../README.md#SudoHeader), [BasicAuth](../README.md#BasicAuth), [AccessToken](../README.md#AccessToken), [SudoParam](../README.md#SudoParam), [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_check_collaborator - -> repo_check_collaborator(owner, repo, collaborator) -Check if a user is a collaborator of a repository - -If the user is a collaborator, return 204. If the user is not a collaborator, return 404. - -### 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 - -[TOTPHeader](../README.md#TOTPHeader), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [SudoHeader](../README.md#SudoHeader), [BasicAuth](../README.md#BasicAuth), [AccessToken](../README.md#AccessToken), [SudoParam](../README.md#SudoParam), [Token](../README.md#Token) - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: application/json - -[[Back to top]](#) [[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_flag - -> repo_check_flag(owner, repo, flag) -Check if a repository has a given flag - -### Parameters - - -Name | Type | Description | Required | Notes -------------- | ------------- | ------------- | ------------- | ------------- -**owner** | **String** | owner of the repo | [required] | -**repo** | **String** | name of the repo | [required] | -**flag** | **String** | name of the flag | [required] | - -### Return type - - (empty response body) - -### Authorization - -[TOTPHeader](../README.md#TOTPHeader), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [SudoHeader](../README.md#SudoHeader), [BasicAuth](../README.md#BasicAuth), [AccessToken](../README.md#AccessToken), [SudoParam](../README.md#SudoParam), [Token](../README.md#Token) - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: application/json - -[[Back to top]](#) [[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 - -> 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 - -[**models::Team**](Team.md) - -### Authorization - -[TOTPHeader](../README.md#TOTPHeader), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [SudoHeader](../README.md#SudoHeader), [BasicAuth](../README.md#BasicAuth), [AccessToken](../README.md#AccessToken), [SudoParam](../README.md#SudoParam), [Token](../README.md#Token) - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: application/json - -[[Back to top]](#) [[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_compare_diff - -> models::Compare repo_compare_diff(owner, repo, basehead) -Get commit comparison information - -### Parameters - - -Name | Type | Description | Required | Notes -------------- | ------------- | ------------- | ------------- | ------------- -**owner** | **String** | owner of the repo | [required] | -**repo** | **String** | name of the repo | [required] | -**basehead** | **String** | compare two branches or commits | [required] | - -### Return type - -[**models::Compare**](Compare.md) - -### Authorization - -[TOTPHeader](../README.md#TOTPHeader), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [SudoHeader](../README.md#SudoHeader), [BasicAuth](../README.md#BasicAuth), [AccessToken](../README.md#AccessToken), [SudoParam](../README.md#SudoParam), [Token](../README.md#Token) - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: application/json - -[[Back to top]](#) [[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_convert - -> models::Repository repo_convert(owner, repo) -Convert a mirror repo to a normal repo. - -### Parameters - - -Name | Type | Description | Required | Notes -------------- | ------------- | ------------- | ------------- | ------------- -**owner** | **String** | owner of the repo to convert | [required] | -**repo** | **String** | name of the repo to convert | [required] | - -### Return type - -[**models::Repository**](Repository.md) - -### Authorization - -[TOTPHeader](../README.md#TOTPHeader), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [SudoHeader](../README.md#SudoHeader), [BasicAuth](../README.md#BasicAuth), [AccessToken](../README.md#AccessToken), [SudoParam](../README.md#SudoParam), [Token](../README.md#Token) - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: application/json - -[[Back to top]](#) [[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 - -> 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 - -[**models::Branch**](Branch.md) - -### Authorization - -[TOTPHeader](../README.md#TOTPHeader), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [SudoHeader](../README.md#SudoHeader), [BasicAuth](../README.md#BasicAuth), [AccessToken](../README.md#AccessToken), [SudoParam](../README.md#SudoParam), [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 - -> 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 - -[**models::BranchProtection**](BranchProtection.md) - -### Authorization - -[TOTPHeader](../README.md#TOTPHeader), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [SudoHeader](../README.md#SudoHeader), [BasicAuth](../README.md#BasicAuth), [AccessToken](../README.md#AccessToken), [SudoParam](../README.md#SudoParam), [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 - -> 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 - -[**models::FileResponse**](FileResponse.md) - -### Authorization - -[TOTPHeader](../README.md#TOTPHeader), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [SudoHeader](../README.md#SudoHeader), [BasicAuth](../README.md#BasicAuth), [AccessToken](../README.md#AccessToken), [SudoParam](../README.md#SudoParam), [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 - -> 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 - -[**models::Hook**](Hook.md) - -### Authorization - -[TOTPHeader](../README.md#TOTPHeader), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [SudoHeader](../README.md#SudoHeader), [BasicAuth](../README.md#BasicAuth), [AccessToken](../README.md#AccessToken), [SudoParam](../README.md#SudoParam), [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 - -> 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 - -[**models::DeployKey**](DeployKey.md) - -### Authorization - -[TOTPHeader](../README.md#TOTPHeader), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [SudoHeader](../README.md#SudoHeader), [BasicAuth](../README.md#BasicAuth), [AccessToken](../README.md#AccessToken), [SudoParam](../README.md#SudoParam), [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 - -> 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 - -[**models::PullRequest**](PullRequest.md) - -### Authorization - -[TOTPHeader](../README.md#TOTPHeader), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [SudoHeader](../README.md#SudoHeader), [BasicAuth](../README.md#BasicAuth), [AccessToken](../README.md#AccessToken), [SudoParam](../README.md#SudoParam), [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 - -> 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 - -[**models::PullReview**](PullReview.md) - -### Authorization - -[TOTPHeader](../README.md#TOTPHeader), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [SudoHeader](../README.md#SudoHeader), [BasicAuth](../README.md#BasicAuth), [AccessToken](../README.md#AccessToken), [SudoParam](../README.md#SudoParam), [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_comment - -> models::PullReviewComment repo_create_pull_review_comment(owner, repo, index, id, body) -Add a new comment to a pull request review - -### 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** | **models::CreatePullReviewComment** | | [required] | - -### Return type - -[**models::PullReviewComment**](PullReviewComment.md) - -### Authorization - -[TOTPHeader](../README.md#TOTPHeader), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [SudoHeader](../README.md#SudoHeader), [BasicAuth](../README.md#BasicAuth), [AccessToken](../README.md#AccessToken), [SudoParam](../README.md#SudoParam), [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 - -[TOTPHeader](../README.md#TOTPHeader), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [SudoHeader](../README.md#SudoHeader), [BasicAuth](../README.md#BasicAuth), [AccessToken](../README.md#AccessToken), [SudoParam](../README.md#SudoParam), [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 - -> 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 - -[**models::Release**](Release.md) - -### Authorization - -[TOTPHeader](../README.md#TOTPHeader), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [SudoHeader](../README.md#SudoHeader), [BasicAuth](../README.md#BasicAuth), [AccessToken](../README.md#AccessToken), [SudoParam](../README.md#SudoParam), [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 - -> models::Attachment repo_create_release_attachment(owner, repo, id, name, attachment, external_url) -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] | -**name** | Option<**String**> | name of the attachment | | -**attachment** | Option<**std::path::PathBuf**> | attachment to upload (this parameter is incompatible with `external_url`) | | -**external_url** | Option<**String**> | url to external asset (this parameter is incompatible with `attachment`) | | - -### Return type - -[**models::Attachment**](Attachment.md) - -### Authorization - -[TOTPHeader](../README.md#TOTPHeader), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [SudoHeader](../README.md#SudoHeader), [BasicAuth](../README.md#BasicAuth), [AccessToken](../README.md#AccessToken), [SudoParam](../README.md#SudoParam), [Token](../README.md#Token) - -### HTTP request headers - -- **Content-Type**: multipart/form-data, application/octet-stream -- **Accept**: application/json - -[[Back to top]](#) [[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 - -> 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 - -[**models::CommitStatus**](CommitStatus.md) - -### Authorization - -[TOTPHeader](../README.md#TOTPHeader), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [SudoHeader](../README.md#SudoHeader), [BasicAuth](../README.md#BasicAuth), [AccessToken](../README.md#AccessToken), [SudoParam](../README.md#SudoParam), [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 - -> 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 - -[**models::Tag**](Tag.md) - -### Authorization - -[TOTPHeader](../README.md#TOTPHeader), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [SudoHeader](../README.md#SudoHeader), [BasicAuth](../README.md#BasicAuth), [AccessToken](../README.md#AccessToken), [SudoParam](../README.md#SudoParam), [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_protection - -> models::TagProtection repo_create_tag_protection(owner, repo, body) -Create a tag 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<[**CreateTagProtectionOption**](CreateTagProtectionOption.md)> | | | - -### Return type - -[**models::TagProtection**](TagProtection.md) - -### Authorization - -[TOTPHeader](../README.md#TOTPHeader), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [SudoHeader](../README.md#SudoHeader), [BasicAuth](../README.md#BasicAuth), [AccessToken](../README.md#AccessToken), [SudoParam](../README.md#SudoParam), [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_wiki_page - -> 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 - -[**models::WikiPage**](WikiPage.md) - -### Authorization - -[TOTPHeader](../README.md#TOTPHeader), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [SudoHeader](../README.md#SudoHeader), [BasicAuth](../README.md#BasicAuth), [AccessToken](../README.md#AccessToken), [SudoParam](../README.md#SudoParam), [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 - -[TOTPHeader](../README.md#TOTPHeader), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [SudoHeader](../README.md#SudoHeader), [BasicAuth](../README.md#BasicAuth), [AccessToken](../README.md#AccessToken), [SudoParam](../README.md#SudoParam), [Token](../README.md#Token) - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: application/json - -[[Back to top]](#) [[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_all_flags - -> repo_delete_all_flags(owner, repo) -Remove all flags from 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 - -[TOTPHeader](../README.md#TOTPHeader), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [SudoHeader](../README.md#SudoHeader), [BasicAuth](../README.md#BasicAuth), [AccessToken](../README.md#AccessToken), [SudoParam](../README.md#SudoParam), [Token](../README.md#Token) - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: application/json - -[[Back to top]](#) [[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_avatar - -> repo_delete_avatar(owner, repo) -Delete a repository's avatar - -### 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 - -[TOTPHeader](../README.md#TOTPHeader), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [SudoHeader](../README.md#SudoHeader), [BasicAuth](../README.md#BasicAuth), [AccessToken](../README.md#AccessToken), [SudoParam](../README.md#SudoParam), [Token](../README.md#Token) - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: application/json - -[[Back to top]](#) [[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 - -[TOTPHeader](../README.md#TOTPHeader), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [SudoHeader](../README.md#SudoHeader), [BasicAuth](../README.md#BasicAuth), [AccessToken](../README.md#AccessToken), [SudoParam](../README.md#SudoParam), [Token](../README.md#Token) - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: application/json - -[[Back to top]](#) [[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 - -[TOTPHeader](../README.md#TOTPHeader), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [SudoHeader](../README.md#SudoHeader), [BasicAuth](../README.md#BasicAuth), [AccessToken](../README.md#AccessToken), [SudoParam](../README.md#SudoParam), [Token](../README.md#Token) - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: application/json - -[[Back to top]](#) [[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 - -[TOTPHeader](../README.md#TOTPHeader), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [SudoHeader](../README.md#SudoHeader), [BasicAuth](../README.md#BasicAuth), [AccessToken](../README.md#AccessToken), [SudoParam](../README.md#SudoParam), [Token](../README.md#Token) - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: application/json - -[[Back to top]](#) [[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 - -> 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 - -[**models::FileDeleteResponse**](FileDeleteResponse.md) - -### Authorization - -[TOTPHeader](../README.md#TOTPHeader), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [SudoHeader](../README.md#SudoHeader), [BasicAuth](../README.md#BasicAuth), [AccessToken](../README.md#AccessToken), [SudoParam](../README.md#SudoParam), [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_flag - -> repo_delete_flag(owner, repo, flag) -Remove a flag from a repository - -### Parameters - - -Name | Type | Description | Required | Notes -------------- | ------------- | ------------- | ------------- | ------------- -**owner** | **String** | owner of the repo | [required] | -**repo** | **String** | name of the repo | [required] | -**flag** | **String** | name of the flag | [required] | - -### Return type - - (empty response body) - -### Authorization - -[TOTPHeader](../README.md#TOTPHeader), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [SudoHeader](../README.md#SudoHeader), [BasicAuth](../README.md#BasicAuth), [AccessToken](../README.md#AccessToken), [SudoParam](../README.md#SudoParam), [Token](../README.md#Token) - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: application/json - -[[Back to top]](#) [[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 - -[TOTPHeader](../README.md#TOTPHeader), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [SudoHeader](../README.md#SudoHeader), [BasicAuth](../README.md#BasicAuth), [AccessToken](../README.md#AccessToken), [SudoParam](../README.md#SudoParam), [Token](../README.md#Token) - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: application/json - -[[Back to top]](#) [[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 - -[TOTPHeader](../README.md#TOTPHeader), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [SudoHeader](../README.md#SudoHeader), [BasicAuth](../README.md#BasicAuth), [AccessToken](../README.md#AccessToken), [SudoParam](../README.md#SudoParam), [Token](../README.md#Token) - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: application/json - -[[Back to top]](#) [[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 - -[TOTPHeader](../README.md#TOTPHeader), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [SudoHeader](../README.md#SudoHeader), [BasicAuth](../README.md#BasicAuth), [AccessToken](../README.md#AccessToken), [SudoParam](../README.md#SudoParam), [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) - - -## 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 - -[TOTPHeader](../README.md#TOTPHeader), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [SudoHeader](../README.md#SudoHeader), [BasicAuth](../README.md#BasicAuth), [AccessToken](../README.md#AccessToken), [SudoParam](../README.md#SudoParam), [Token](../README.md#Token) - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: application/json - -[[Back to top]](#) [[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_comment - -> repo_delete_pull_review_comment(owner, repo, index, id, comment) -Delete a pull review comment - -### 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] | -**comment** | **i64** | id of the comment | [required] | - -### Return type - - (empty response body) - -### Authorization - -[TOTPHeader](../README.md#TOTPHeader), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [SudoHeader](../README.md#SudoHeader), [BasicAuth](../README.md#BasicAuth), [AccessToken](../README.md#AccessToken), [SudoParam](../README.md#SudoParam), [Token](../README.md#Token) - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: application/json - -[[Back to top]](#) [[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 - -[TOTPHeader](../README.md#TOTPHeader), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [SudoHeader](../README.md#SudoHeader), [BasicAuth](../README.md#BasicAuth), [AccessToken](../README.md#AccessToken), [SudoParam](../README.md#SudoParam), [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_delete_push_mirror - -> repo_delete_push_mirror(owner, repo, name) -Remove a push mirror from a repository by remoteName - -### Parameters - - -Name | Type | Description | Required | Notes -------------- | ------------- | ------------- | ------------- | ------------- -**owner** | **String** | owner of the repo | [required] | -**repo** | **String** | name of the repo | [required] | -**name** | **String** | remote name of the pushMirror | [required] | - -### Return type - - (empty response body) - -### Authorization - -[TOTPHeader](../README.md#TOTPHeader), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [SudoHeader](../README.md#SudoHeader), [BasicAuth](../README.md#BasicAuth), [AccessToken](../README.md#AccessToken), [SudoParam](../README.md#SudoParam), [Token](../README.md#Token) - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: application/json - -[[Back to top]](#) [[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 - -[TOTPHeader](../README.md#TOTPHeader), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [SudoHeader](../README.md#SudoHeader), [BasicAuth](../README.md#BasicAuth), [AccessToken](../README.md#AccessToken), [SudoParam](../README.md#SudoParam), [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) - - -## 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 - -[TOTPHeader](../README.md#TOTPHeader), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [SudoHeader](../README.md#SudoHeader), [BasicAuth](../README.md#BasicAuth), [AccessToken](../README.md#AccessToken), [SudoParam](../README.md#SudoParam), [Token](../README.md#Token) - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: application/json - -[[Back to top]](#) [[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 - -[TOTPHeader](../README.md#TOTPHeader), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [SudoHeader](../README.md#SudoHeader), [BasicAuth](../README.md#BasicAuth), [AccessToken](../README.md#AccessToken), [SudoParam](../README.md#SudoParam), [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) - - -## 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 - -[TOTPHeader](../README.md#TOTPHeader), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [SudoHeader](../README.md#SudoHeader), [BasicAuth](../README.md#BasicAuth), [AccessToken](../README.md#AccessToken), [SudoParam](../README.md#SudoParam), [Token](../README.md#Token) - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: application/json - -[[Back to top]](#) [[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_protection - -> repo_delete_tag_protection(owner, repo, id) -Delete a specific tag protection for the 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 protected tag | [required] | - -### Return type - - (empty response body) - -### Authorization - -[TOTPHeader](../README.md#TOTPHeader), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [SudoHeader](../README.md#SudoHeader), [BasicAuth](../README.md#BasicAuth), [AccessToken](../README.md#AccessToken), [SudoParam](../README.md#SudoParam), [Token](../README.md#Token) - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: application/json - -[[Back to top]](#) [[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 - -[TOTPHeader](../README.md#TOTPHeader), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [SudoHeader](../README.md#SudoHeader), [BasicAuth](../README.md#BasicAuth), [AccessToken](../README.md#AccessToken), [SudoParam](../README.md#SudoParam), [Token](../README.md#Token) - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: application/json - -[[Back to top]](#) [[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 - -[TOTPHeader](../README.md#TOTPHeader), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [SudoHeader](../README.md#SudoHeader), [BasicAuth](../README.md#BasicAuth), [AccessToken](../README.md#AccessToken), [SudoParam](../README.md#SudoParam), [Token](../README.md#Token) - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: application/json - -[[Back to top]](#) [[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 - -[TOTPHeader](../README.md#TOTPHeader), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [SudoHeader](../README.md#SudoHeader), [BasicAuth](../README.md#BasicAuth), [AccessToken](../README.md#AccessToken), [SudoParam](../README.md#SudoParam), [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) - - -## repo_dismiss_pull_review - -> 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 - -[**models::PullReview**](PullReview.md) - -### Authorization - -[TOTPHeader](../README.md#TOTPHeader), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [SudoHeader](../README.md#SudoHeader), [BasicAuth](../README.md#BasicAuth), [AccessToken](../README.md#AccessToken), [SudoParam](../README.md#SudoParam), [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 - -[TOTPHeader](../README.md#TOTPHeader), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [SudoHeader](../README.md#SudoHeader), [BasicAuth](../README.md#BasicAuth), [AccessToken](../README.md#AccessToken), [SudoParam](../README.md#SudoParam), [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 - -[TOTPHeader](../README.md#TOTPHeader), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [SudoHeader](../README.md#SudoHeader), [BasicAuth](../README.md#BasicAuth), [AccessToken](../README.md#AccessToken), [SudoParam](../README.md#SudoParam), [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 - -> 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 - -[**models::Repository**](Repository.md) - -### Authorization - -[TOTPHeader](../README.md#TOTPHeader), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [SudoHeader](../README.md#SudoHeader), [BasicAuth](../README.md#BasicAuth), [AccessToken](../README.md#AccessToken), [SudoParam](../README.md#SudoParam), [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 - -> 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 - -[**models::BranchProtection**](BranchProtection.md) - -### Authorization - -[TOTPHeader](../README.md#TOTPHeader), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [SudoHeader](../README.md#SudoHeader), [BasicAuth](../README.md#BasicAuth), [AccessToken](../README.md#AccessToken), [SudoParam](../README.md#SudoParam), [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 - -> 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 - -[**models::GitHook**](GitHook.md) - -### Authorization - -[TOTPHeader](../README.md#TOTPHeader), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [SudoHeader](../README.md#SudoHeader), [BasicAuth](../README.md#BasicAuth), [AccessToken](../README.md#AccessToken), [SudoParam](../README.md#SudoParam), [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 - -> 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 - -[**models::Hook**](Hook.md) - -### Authorization - -[TOTPHeader](../README.md#TOTPHeader), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [SudoHeader](../README.md#SudoHeader), [BasicAuth](../README.md#BasicAuth), [AccessToken](../README.md#AccessToken), [SudoParam](../README.md#SudoParam), [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 - -> 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 - -[**models::PullRequest**](PullRequest.md) - -### Authorization - -[TOTPHeader](../README.md#TOTPHeader), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [SudoHeader](../README.md#SudoHeader), [BasicAuth](../README.md#BasicAuth), [AccessToken](../README.md#AccessToken), [SudoParam](../README.md#SudoParam), [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 - -> 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 - -[**models::Release**](Release.md) - -### Authorization - -[TOTPHeader](../README.md#TOTPHeader), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [SudoHeader](../README.md#SudoHeader), [BasicAuth](../README.md#BasicAuth), [AccessToken](../README.md#AccessToken), [SudoParam](../README.md#SudoParam), [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 - -> 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 - -[**models::Attachment**](Attachment.md) - -### Authorization - -[TOTPHeader](../README.md#TOTPHeader), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [SudoHeader](../README.md#SudoHeader), [BasicAuth](../README.md#BasicAuth), [AccessToken](../README.md#AccessToken), [SudoParam](../README.md#SudoParam), [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_tag_protection - -> models::TagProtection repo_edit_tag_protection(owner, repo, id, body) -Edit a tag 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] | -**id** | **i64** | id of protected tag | [required] | -**body** | Option<[**EditTagProtectionOption**](EditTagProtectionOption.md)> | | | - -### Return type - -[**models::TagProtection**](TagProtection.md) - -### Authorization - -[TOTPHeader](../README.md#TOTPHeader), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [SudoHeader](../README.md#SudoHeader), [BasicAuth](../README.md#BasicAuth), [AccessToken](../README.md#AccessToken), [SudoParam](../README.md#SudoParam), [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 - -> 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 - -[**models::WikiPage**](WikiPage.md) - -### Authorization - -[TOTPHeader](../README.md#TOTPHeader), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [SudoHeader](../README.md#SudoHeader), [BasicAuth](../README.md#BasicAuth), [AccessToken](../README.md#AccessToken), [SudoParam](../README.md#SudoParam), [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 - -> 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 - -[**models::Repository**](Repository.md) - -### Authorization - -[TOTPHeader](../README.md#TOTPHeader), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [SudoHeader](../README.md#SudoHeader), [BasicAuth](../README.md#BasicAuth), [AccessToken](../README.md#AccessToken), [SudoParam](../README.md#SudoParam), [Token](../README.md#Token) - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: application/json - -[[Back to top]](#) [[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, stat, verification, files, page, limit, not) -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 | | -**stat** | Option<**bool**> | include diff stats for every commit (disable for speedup, default 'true') | | -**verification** | Option<**bool**> | include verification for every commit (disable for speedup, default 'true') | | -**files** | Option<**bool**> | include a list of affected files for every commit (disable for speedup, default 'true') | | -**page** | Option<**i32**> | page number of results to return (1-based) | | -**limit** | Option<**i32**> | page size of results (ignored if used with 'path') | | -**not** | Option<**String**> | commits that match the given specifier will not be listed. | | - -### Return type - -[**Vec**](Commit.md) - -### Authorization - -[TOTPHeader](../README.md#TOTPHeader), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [SudoHeader](../README.md#SudoHeader), [BasicAuth](../README.md#BasicAuth), [AccessToken](../README.md#AccessToken), [SudoParam](../README.md#SudoParam), [Token](../README.md#Token) - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: application/json - -[[Back to top]](#) [[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 - -[TOTPHeader](../README.md#TOTPHeader), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [SudoHeader](../README.md#SudoHeader), [BasicAuth](../README.md#BasicAuth), [AccessToken](../README.md#AccessToken), [SudoParam](../README.md#SudoParam), [Token](../README.md#Token) - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: application/octet-stream, application/zip, application/gzip - -[[Back to top]](#) [[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 - -[TOTPHeader](../README.md#TOTPHeader), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [SudoHeader](../README.md#SudoHeader), [BasicAuth](../README.md#BasicAuth), [AccessToken](../README.md#AccessToken), [SudoParam](../README.md#SudoParam), [Token](../README.md#Token) - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: application/json - -[[Back to top]](#) [[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 - -> 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 - -[**models::Branch**](Branch.md) - -### Authorization - -[TOTPHeader](../README.md#TOTPHeader), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [SudoHeader](../README.md#SudoHeader), [BasicAuth](../README.md#BasicAuth), [AccessToken](../README.md#AccessToken), [SudoParam](../README.md#SudoParam), [Token](../README.md#Token) - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: application/json - -[[Back to top]](#) [[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 - -> 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 - -[**models::BranchProtection**](BranchProtection.md) - -### Authorization - -[TOTPHeader](../README.md#TOTPHeader), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [SudoHeader](../README.md#SudoHeader), [BasicAuth](../README.md#BasicAuth), [AccessToken](../README.md#AccessToken), [SudoParam](../README.md#SudoParam), [Token](../README.md#Token) - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: application/json - -[[Back to top]](#) [[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 - -> 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 - -[**models::Repository**](Repository.md) - -### Authorization - -[TOTPHeader](../README.md#TOTPHeader), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [SudoHeader](../README.md#SudoHeader), [BasicAuth](../README.md#BasicAuth), [AccessToken](../README.md#AccessToken), [SudoParam](../README.md#SudoParam), [Token](../README.md#Token) - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: application/json - -[[Back to top]](#) [[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 - -> 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 - -[**models::CombinedStatus**](CombinedStatus.md) - -### Authorization - -[TOTPHeader](../README.md#TOTPHeader), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [SudoHeader](../README.md#SudoHeader), [BasicAuth](../README.md#BasicAuth), [AccessToken](../README.md#AccessToken), [SudoParam](../README.md#SudoParam), [Token](../README.md#Token) - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: application/json - -[[Back to top]](#) [[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_commit_pull_request - -> models::PullRequest repo_get_commit_pull_request(owner, repo, sha) -Get the pull request of the commit - -### 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] | - -### Return type - -[**models::PullRequest**](PullRequest.md) - -### Authorization - -[TOTPHeader](../README.md#TOTPHeader), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [SudoHeader](../README.md#SudoHeader), [BasicAuth](../README.md#BasicAuth), [AccessToken](../README.md#AccessToken), [SudoParam](../README.md#SudoParam), [Token](../README.md#Token) - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: application/json - -[[Back to top]](#) [[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 - -> 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 - -[**models::ContentsResponse**](ContentsResponse.md) - -### Authorization - -[TOTPHeader](../README.md#TOTPHeader), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [SudoHeader](../README.md#SudoHeader), [BasicAuth](../README.md#BasicAuth), [AccessToken](../README.md#AccessToken), [SudoParam](../README.md#SudoParam), [Token](../README.md#Token) - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: application/json - -[[Back to top]](#) [[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 - -[TOTPHeader](../README.md#TOTPHeader), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [SudoHeader](../README.md#SudoHeader), [BasicAuth](../README.md#BasicAuth), [AccessToken](../README.md#AccessToken), [SudoParam](../README.md#SudoParam), [Token](../README.md#Token) - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: application/json - -[[Back to top]](#) [[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 - -> std::collections::HashMap 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 - -**std::collections::HashMap** - -### Authorization - -[TOTPHeader](../README.md#TOTPHeader), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [SudoHeader](../README.md#SudoHeader), [BasicAuth](../README.md#BasicAuth), [AccessToken](../README.md#AccessToken), [SudoParam](../README.md#SudoParam), [Token](../README.md#Token) - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: application/json - -[[Back to top]](#) [[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 - -> 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 - -[**models::GitHook**](GitHook.md) - -### Authorization - -[TOTPHeader](../README.md#TOTPHeader), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [SudoHeader](../README.md#SudoHeader), [BasicAuth](../README.md#BasicAuth), [AccessToken](../README.md#AccessToken), [SudoParam](../README.md#SudoParam), [Token](../README.md#Token) - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: application/json - -[[Back to top]](#) [[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 - -> 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 - -[**models::Hook**](Hook.md) - -### Authorization - -[TOTPHeader](../README.md#TOTPHeader), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [SudoHeader](../README.md#SudoHeader), [BasicAuth](../README.md#BasicAuth), [AccessToken](../README.md#AccessToken), [SudoParam](../README.md#SudoParam), [Token](../README.md#Token) - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: application/json - -[[Back to top]](#) [[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_config - -> models::IssueConfig repo_get_issue_config(owner, repo) -Returns the issue config for a repo - -### Parameters - - -Name | Type | Description | Required | Notes -------------- | ------------- | ------------- | ------------- | ------------- -**owner** | **String** | owner of the repo | [required] | -**repo** | **String** | name of the repo | [required] | - -### Return type - -[**models::IssueConfig**](IssueConfig.md) - -### Authorization - -[TOTPHeader](../README.md#TOTPHeader), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [SudoHeader](../README.md#SudoHeader), [BasicAuth](../README.md#BasicAuth), [AccessToken](../README.md#AccessToken), [SudoParam](../README.md#SudoParam), [Token](../README.md#Token) - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: application/json - -[[Back to top]](#) [[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 - -[TOTPHeader](../README.md#TOTPHeader), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [SudoHeader](../README.md#SudoHeader), [BasicAuth](../README.md#BasicAuth), [AccessToken](../README.md#AccessToken), [SudoParam](../README.md#SudoParam), [Token](../README.md#Token) - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: application/json - -[[Back to top]](#) [[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 - -> 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 - -[**models::DeployKey**](DeployKey.md) - -### Authorization - -[TOTPHeader](../README.md#TOTPHeader), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [SudoHeader](../README.md#SudoHeader), [BasicAuth](../README.md#BasicAuth), [AccessToken](../README.md#AccessToken), [SudoParam](../README.md#SudoParam), [Token](../README.md#Token) - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: application/json - -[[Back to top]](#) [[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 - -[TOTPHeader](../README.md#TOTPHeader), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [SudoHeader](../README.md#SudoHeader), [BasicAuth](../README.md#BasicAuth), [AccessToken](../README.md#AccessToken), [SudoParam](../README.md#SudoParam), [Token](../README.md#Token) - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: application/json - -[[Back to top]](#) [[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_latest_release - -> models::Release repo_get_latest_release(owner, repo) -Gets the most recent non-prerelease, non-draft release of a repository, sorted by created_at - -### Parameters - - -Name | Type | Description | Required | Notes -------------- | ------------- | ------------- | ------------- | ------------- -**owner** | **String** | owner of the repo | [required] | -**repo** | **String** | name of the repo | [required] | - -### Return type - -[**models::Release**](Release.md) - -### Authorization - -[TOTPHeader](../README.md#TOTPHeader), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [SudoHeader](../README.md#SudoHeader), [BasicAuth](../README.md#BasicAuth), [AccessToken](../README.md#AccessToken), [SudoParam](../README.md#SudoParam), [Token](../README.md#Token) - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: application/json - -[[Back to top]](#) [[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 - -> models::Note repo_get_note(owner, repo, sha, verification, files) -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] | -**verification** | Option<**bool**> | include verification for every commit (disable for speedup, default 'true') | | -**files** | Option<**bool**> | include a list of affected files for every commit (disable for speedup, default 'true') | | - -### Return type - -[**models::Note**](Note.md) - -### Authorization - -[TOTPHeader](../README.md#TOTPHeader), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [SudoHeader](../README.md#SudoHeader), [BasicAuth](../README.md#BasicAuth), [AccessToken](../README.md#AccessToken), [SudoParam](../README.md#SudoParam), [Token](../README.md#Token) - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: application/json - -[[Back to top]](#) [[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 - -> 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 - -[**models::PullRequest**](PullRequest.md) - -### Authorization - -[TOTPHeader](../README.md#TOTPHeader), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [SudoHeader](../README.md#SudoHeader), [BasicAuth](../README.md#BasicAuth), [AccessToken](../README.md#AccessToken), [SudoParam](../README.md#SudoParam), [Token](../README.md#Token) - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: application/json - -[[Back to top]](#) [[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_by_base_head - -> models::PullRequest repo_get_pull_request_by_base_head(owner, repo, base, head) -Get a pull request by base and head - -### Parameters - - -Name | Type | Description | Required | Notes -------------- | ------------- | ------------- | ------------- | ------------- -**owner** | **String** | owner of the repo | [required] | -**repo** | **String** | name of the repo | [required] | -**base** | **String** | base of the pull request to get | [required] | -**head** | **String** | head of the pull request to get | [required] | - -### Return type - -[**models::PullRequest**](PullRequest.md) - -### Authorization - -[TOTPHeader](../README.md#TOTPHeader), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [SudoHeader](../README.md#SudoHeader), [BasicAuth](../README.md#BasicAuth), [AccessToken](../README.md#AccessToken), [SudoParam](../README.md#SudoParam), [Token](../README.md#Token) - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: application/json - -[[Back to top]](#) [[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, verification, files) -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 | | -**verification** | Option<**bool**> | include verification for every commit (disable for speedup, default 'true') | | -**files** | Option<**bool**> | include a list of affected files for every commit (disable for speedup, default 'true') | | - -### Return type - -[**Vec**](Commit.md) - -### Authorization - -[TOTPHeader](../README.md#TOTPHeader), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [SudoHeader](../README.md#SudoHeader), [BasicAuth](../README.md#BasicAuth), [AccessToken](../README.md#AccessToken), [SudoParam](../README.md#SudoParam), [Token](../README.md#Token) - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: application/json - -[[Back to top]](#) [[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_files - -> Vec repo_get_pull_request_files(owner, repo, index, skip_to, whitespace, page, limit) -Get changed files 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] | -**skip_to** | Option<**String**> | skip to given file | | -**whitespace** | Option<**String**> | whitespace behavior | | -**page** | Option<**i32**> | page number of results to return (1-based) | | -**limit** | Option<**i32**> | page size of results | | - -### Return type - -[**Vec**](ChangedFile.md) - -### Authorization - -[TOTPHeader](../README.md#TOTPHeader), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [SudoHeader](../README.md#SudoHeader), [BasicAuth](../README.md#BasicAuth), [AccessToken](../README.md#AccessToken), [SudoParam](../README.md#SudoParam), [Token](../README.md#Token) - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: application/json - -[[Back to top]](#) [[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 - -> 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 - -[**models::PullReview**](PullReview.md) - -### Authorization - -[TOTPHeader](../README.md#TOTPHeader), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [SudoHeader](../README.md#SudoHeader), [BasicAuth](../README.md#BasicAuth), [AccessToken](../README.md#AccessToken), [SudoParam](../README.md#SudoParam), [Token](../README.md#Token) - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: application/json - -[[Back to top]](#) [[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_comment - -> models::PullReviewComment repo_get_pull_review_comment(owner, repo, index, id, comment) -Get a pull review comment - -### 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] | -**comment** | **i64** | id of the comment | [required] | - -### Return type - -[**models::PullReviewComment**](PullReviewComment.md) - -### Authorization - -[TOTPHeader](../README.md#TOTPHeader), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [SudoHeader](../README.md#SudoHeader), [BasicAuth](../README.md#BasicAuth), [AccessToken](../README.md#AccessToken), [SudoParam](../README.md#SudoParam), [Token](../README.md#Token) - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: application/json - -[[Back to top]](#) [[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 - -[TOTPHeader](../README.md#TOTPHeader), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [SudoHeader](../README.md#SudoHeader), [BasicAuth](../README.md#BasicAuth), [AccessToken](../README.md#AccessToken), [SudoParam](../README.md#SudoParam), [Token](../README.md#Token) - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: application/json - -[[Back to top]](#) [[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_push_mirror_by_remote_name - -> models::PushMirror repo_get_push_mirror_by_remote_name(owner, repo, name) -Get push mirror of the repository by remoteName - -### Parameters - - -Name | Type | Description | Required | Notes -------------- | ------------- | ------------- | ------------- | ------------- -**owner** | **String** | owner of the repo | [required] | -**repo** | **String** | name of the repo | [required] | -**name** | **String** | remote name of push mirror | [required] | - -### Return type - -[**models::PushMirror**](PushMirror.md) - -### Authorization - -[TOTPHeader](../README.md#TOTPHeader), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [SudoHeader](../README.md#SudoHeader), [BasicAuth](../README.md#BasicAuth), [AccessToken](../README.md#AccessToken), [SudoParam](../README.md#SudoParam), [Token](../README.md#Token) - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: application/json - -[[Back to top]](#) [[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 - -> std::path::PathBuf 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 - -[**std::path::PathBuf**](std::path::PathBuf.md) - -### Authorization - -[TOTPHeader](../README.md#TOTPHeader), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [SudoHeader](../README.md#SudoHeader), [BasicAuth](../README.md#BasicAuth), [AccessToken](../README.md#AccessToken), [SudoParam](../README.md#SudoParam), [Token](../README.md#Token) - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: application/octet-stream - -[[Back to top]](#) [[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 - -> std::path::PathBuf 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 - -[**std::path::PathBuf**](std::path::PathBuf.md) - -### Authorization - -[TOTPHeader](../README.md#TOTPHeader), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [SudoHeader](../README.md#SudoHeader), [BasicAuth](../README.md#BasicAuth), [AccessToken](../README.md#AccessToken), [SudoParam](../README.md#SudoParam), [Token](../README.md#Token) - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: application/octet-stream - -[[Back to top]](#) [[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 - -> 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 - -[**models::Release**](Release.md) - -### Authorization - -[TOTPHeader](../README.md#TOTPHeader), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [SudoHeader](../README.md#SudoHeader), [BasicAuth](../README.md#BasicAuth), [AccessToken](../README.md#AccessToken), [SudoParam](../README.md#SudoParam), [Token](../README.md#Token) - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: application/json - -[[Back to top]](#) [[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 - -> 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 - -[**models::Attachment**](Attachment.md) - -### Authorization - -[TOTPHeader](../README.md#TOTPHeader), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [SudoHeader](../README.md#SudoHeader), [BasicAuth](../README.md#BasicAuth), [AccessToken](../README.md#AccessToken), [SudoParam](../README.md#SudoParam), [Token](../README.md#Token) - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: application/json - -[[Back to top]](#) [[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 - -> 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 - -[**models::Release**](Release.md) - -### Authorization - -[TOTPHeader](../README.md#TOTPHeader), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [SudoHeader](../README.md#SudoHeader), [BasicAuth](../README.md#BasicAuth), [AccessToken](../README.md#AccessToken), [SudoParam](../README.md#SudoParam), [Token](../README.md#Token) - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: application/json - -[[Back to top]](#) [[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 - -> 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 - -[**models::RepoCollaboratorPermission**](RepoCollaboratorPermission.md) - -### Authorization - -[TOTPHeader](../README.md#TOTPHeader), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [SudoHeader](../README.md#SudoHeader), [BasicAuth](../README.md#BasicAuth), [AccessToken](../README.md#AccessToken), [SudoParam](../README.md#SudoParam), [Token](../README.md#Token) - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: application/json - -[[Back to top]](#) [[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 - -[TOTPHeader](../README.md#TOTPHeader), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [SudoHeader](../README.md#SudoHeader), [BasicAuth](../README.md#BasicAuth), [AccessToken](../README.md#AccessToken), [SudoParam](../README.md#SudoParam), [Token](../README.md#Token) - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: application/json - -[[Back to top]](#) [[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_runner_registration_token - -> models::RegistrationToken repo_get_runner_registration_token(owner, repo) -Get a repository's actions runner registration token - -### Parameters - - -Name | Type | Description | Required | Notes -------------- | ------------- | ------------- | ------------- | ------------- -**owner** | **String** | owner of the repo | [required] | -**repo** | **String** | name of the repo | [required] | - -### Return type - -[**models::RegistrationToken**](RegistrationToken.md) - -### Authorization - -[TOTPHeader](../README.md#TOTPHeader), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [SudoHeader](../README.md#SudoHeader), [BasicAuth](../README.md#BasicAuth), [AccessToken](../README.md#AccessToken), [SudoParam](../README.md#SudoParam), [Token](../README.md#Token) - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: application/json - -[[Back to top]](#) [[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 - -> models::Commit repo_get_single_commit(owner, repo, sha, stat, verification, files) -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] | -**stat** | Option<**bool**> | include diff stats for every commit (disable for speedup, default 'true') | | -**verification** | Option<**bool**> | include verification for every commit (disable for speedup, default 'true') | | -**files** | Option<**bool**> | include a list of affected files for every commit (disable for speedup, default 'true') | | - -### Return type - -[**models::Commit**](Commit.md) - -### Authorization - -[TOTPHeader](../README.md#TOTPHeader), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [SudoHeader](../README.md#SudoHeader), [BasicAuth](../README.md#BasicAuth), [AccessToken](../README.md#AccessToken), [SudoParam](../README.md#SudoParam), [Token](../README.md#Token) - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: application/json - -[[Back to top]](#) [[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 - -> 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 - -[**models::Tag**](Tag.md) - -### Authorization - -[TOTPHeader](../README.md#TOTPHeader), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [SudoHeader](../README.md#SudoHeader), [BasicAuth](../README.md#BasicAuth), [AccessToken](../README.md#AccessToken), [SudoParam](../README.md#SudoParam), [Token](../README.md#Token) - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: application/json - -[[Back to top]](#) [[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_protection - -> models::TagProtection repo_get_tag_protection(owner, repo, id) -Get a specific tag protection for the 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 tag protect to get | [required] | - -### Return type - -[**models::TagProtection**](TagProtection.md) - -### Authorization - -[TOTPHeader](../README.md#TOTPHeader), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [SudoHeader](../README.md#SudoHeader), [BasicAuth](../README.md#BasicAuth), [AccessToken](../README.md#AccessToken), [SudoParam](../README.md#SudoParam), [Token](../README.md#Token) - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: application/json - -[[Back to top]](#) [[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 - -> 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 - -[**models::WikiPage**](WikiPage.md) - -### Authorization - -[TOTPHeader](../README.md#TOTPHeader), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [SudoHeader](../README.md#SudoHeader), [BasicAuth](../README.md#BasicAuth), [AccessToken](../README.md#AccessToken), [SudoParam](../README.md#SudoParam), [Token](../README.md#Token) - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: application/json - -[[Back to top]](#) [[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 - -> 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 - -[**models::WikiCommitList**](WikiCommitList.md) - -### Authorization - -[TOTPHeader](../README.md#TOTPHeader), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [SudoHeader](../README.md#SudoHeader), [BasicAuth](../README.md#BasicAuth), [AccessToken](../README.md#AccessToken), [SudoParam](../README.md#SudoParam), [Token](../README.md#Token) - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: application/json - -[[Back to top]](#) [[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 - -[TOTPHeader](../README.md#TOTPHeader), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [SudoHeader](../README.md#SudoHeader), [BasicAuth](../README.md#BasicAuth), [AccessToken](../README.md#AccessToken), [SudoParam](../README.md#SudoParam), [Token](../README.md#Token) - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: application/json - -[[Back to top]](#) [[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_actions_secrets - -> Vec repo_list_actions_secrets(owner, repo, page, limit) -List an repo's actions secrets - -### Parameters - - -Name | Type | Description | Required | Notes -------------- | ------------- | ------------- | ------------- | ------------- -**owner** | **String** | owner of the repository | [required] | -**repo** | **String** | name of the repository | [required] | -**page** | Option<**i32**> | page number of results to return (1-based) | | -**limit** | Option<**i32**> | page size of results | | - -### Return type - -[**Vec**](Secret.md) - -### Authorization - -[TOTPHeader](../README.md#TOTPHeader), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [SudoHeader](../README.md#SudoHeader), [BasicAuth](../README.md#BasicAuth), [AccessToken](../README.md#AccessToken), [SudoParam](../README.md#SudoParam), [Token](../README.md#Token) - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: application/json - -[[Back to top]](#) [[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_activity_feeds - -> Vec repo_list_activity_feeds(owner, repo, date, page, limit) -List a repository's activity feeds - -### Parameters - - -Name | Type | Description | Required | Notes -------------- | ------------- | ------------- | ------------- | ------------- -**owner** | **String** | owner of the repo | [required] | -**repo** | **String** | name of the repo | [required] | -**date** | Option<**String**> | the date of the activities to be found | | -**page** | Option<**i32**> | page number of results to return (1-based) | | -**limit** | Option<**i32**> | page size of results | | - -### Return type - -[**Vec**](Activity.md) - -### Authorization - -[TOTPHeader](../README.md#TOTPHeader), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [SudoHeader](../README.md#SudoHeader), [BasicAuth](../README.md#BasicAuth), [AccessToken](../README.md#AccessToken), [SudoParam](../README.md#SudoParam), [Token](../README.md#Token) - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: application/json - -[[Back to top]](#) [[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 - -[TOTPHeader](../README.md#TOTPHeader), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [SudoHeader](../README.md#SudoHeader), [BasicAuth](../README.md#BasicAuth), [AccessToken](../README.md#AccessToken), [SudoParam](../README.md#SudoParam), [Token](../README.md#Token) - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: application/json - -[[Back to top]](#) [[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 - -[TOTPHeader](../README.md#TOTPHeader), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [SudoHeader](../README.md#SudoHeader), [BasicAuth](../README.md#BasicAuth), [AccessToken](../README.md#AccessToken), [SudoParam](../README.md#SudoParam), [Token](../README.md#Token) - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: application/json - -[[Back to top]](#) [[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 - -[TOTPHeader](../README.md#TOTPHeader), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [SudoHeader](../README.md#SudoHeader), [BasicAuth](../README.md#BasicAuth), [AccessToken](../README.md#AccessToken), [SudoParam](../README.md#SudoParam), [Token](../README.md#Token) - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: application/json - -[[Back to top]](#) [[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 - -[TOTPHeader](../README.md#TOTPHeader), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [SudoHeader](../README.md#SudoHeader), [BasicAuth](../README.md#BasicAuth), [AccessToken](../README.md#AccessToken), [SudoParam](../README.md#SudoParam), [Token](../README.md#Token) - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: application/json - -[[Back to top]](#) [[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_flags - -> Vec repo_list_flags(owner, repo) -List a repository's flags - -### Parameters - - -Name | Type | Description | Required | Notes -------------- | ------------- | ------------- | ------------- | ------------- -**owner** | **String** | owner of the repo | [required] | -**repo** | **String** | name of the repo | [required] | - -### Return type - -**Vec** - -### Authorization - -[TOTPHeader](../README.md#TOTPHeader), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [SudoHeader](../README.md#SudoHeader), [BasicAuth](../README.md#BasicAuth), [AccessToken](../README.md#AccessToken), [SudoParam](../README.md#SudoParam), [Token](../README.md#Token) - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: application/json - -[[Back to top]](#) [[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 - -[TOTPHeader](../README.md#TOTPHeader), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [SudoHeader](../README.md#SudoHeader), [BasicAuth](../README.md#BasicAuth), [AccessToken](../README.md#AccessToken), [SudoParam](../README.md#SudoParam), [Token](../README.md#Token) - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: application/json - -[[Back to top]](#) [[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 - -[TOTPHeader](../README.md#TOTPHeader), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [SudoHeader](../README.md#SudoHeader), [BasicAuth](../README.md#BasicAuth), [AccessToken](../README.md#AccessToken), [SudoParam](../README.md#SudoParam), [Token](../README.md#Token) - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: application/json - -[[Back to top]](#) [[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 - -[TOTPHeader](../README.md#TOTPHeader), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [SudoHeader](../README.md#SudoHeader), [BasicAuth](../README.md#BasicAuth), [AccessToken](../README.md#AccessToken), [SudoParam](../README.md#SudoParam), [Token](../README.md#Token) - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: application/json - -[[Back to top]](#) [[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 - -[TOTPHeader](../README.md#TOTPHeader), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [SudoHeader](../README.md#SudoHeader), [BasicAuth](../README.md#BasicAuth), [AccessToken](../README.md#AccessToken), [SudoParam](../README.md#SudoParam), [Token](../README.md#Token) - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: application/json - -[[Back to top]](#) [[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_pinned_issues - -> Vec repo_list_pinned_issues(owner, repo) -List a repo's pinned issues - -### Parameters - - -Name | Type | Description | Required | Notes -------------- | ------------- | ------------- | ------------- | ------------- -**owner** | **String** | owner of the repo | [required] | -**repo** | **String** | name of the repo | [required] | - -### Return type - -[**Vec**](Issue.md) - -### Authorization - -[TOTPHeader](../README.md#TOTPHeader), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [SudoHeader](../README.md#SudoHeader), [BasicAuth](../README.md#BasicAuth), [AccessToken](../README.md#AccessToken), [SudoParam](../README.md#SudoParam), [Token](../README.md#Token) - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: application/json - -[[Back to top]](#) [[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_pinned_pull_requests - -> Vec repo_list_pinned_pull_requests(owner, repo) -List a repo's pinned pull requests - -### Parameters - - -Name | Type | Description | Required | Notes -------------- | ------------- | ------------- | ------------- | ------------- -**owner** | **String** | owner of the repo | [required] | -**repo** | **String** | name of the repo | [required] | - -### Return type - -[**Vec**](PullRequest.md) - -### Authorization - -[TOTPHeader](../README.md#TOTPHeader), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [SudoHeader](../README.md#SudoHeader), [BasicAuth](../README.md#BasicAuth), [AccessToken](../README.md#AccessToken), [SudoParam](../README.md#SudoParam), [Token](../README.md#Token) - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: application/json - -[[Back to top]](#) [[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, poster, page, limit) -List a repo's pull requests. If a pull request is selected but fails to be retrieved for any reason, it will be a null value in the list of results. - -### 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 | |[default to open] -**sort** | Option<**String**> | Type of sort | | -**milestone** | Option<**i64**> | ID of the milestone | | -**labels** | Option<[**Vec**](I64.md)> | Label IDs | | -**poster** | Option<**String**> | Filter by pull request author | | -**page** | Option<**i32**> | Page number of results to return (1-based) | |[default to 1] -**limit** | Option<**i32**> | Page size of results | | - -### Return type - -[**Vec**](PullRequest.md) - -### Authorization - -[TOTPHeader](../README.md#TOTPHeader), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [SudoHeader](../README.md#SudoHeader), [BasicAuth](../README.md#BasicAuth), [AccessToken](../README.md#AccessToken), [SudoParam](../README.md#SudoParam), [Token](../README.md#Token) - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: application/json - -[[Back to top]](#) [[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 - -[TOTPHeader](../README.md#TOTPHeader), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [SudoHeader](../README.md#SudoHeader), [BasicAuth](../README.md#BasicAuth), [AccessToken](../README.md#AccessToken), [SudoParam](../README.md#SudoParam), [Token](../README.md#Token) - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: application/json - -[[Back to top]](#) [[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_push_mirrors - -> Vec repo_list_push_mirrors(owner, repo, page, limit) -Get all push mirrors of the 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**](PushMirror.md) - -### Authorization - -[TOTPHeader](../README.md#TOTPHeader), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [SudoHeader](../README.md#SudoHeader), [BasicAuth](../README.md#BasicAuth), [AccessToken](../README.md#AccessToken), [SudoParam](../README.md#SudoParam), [Token](../README.md#Token) - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: application/json - -[[Back to top]](#) [[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 - -[TOTPHeader](../README.md#TOTPHeader), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [SudoHeader](../README.md#SudoHeader), [BasicAuth](../README.md#BasicAuth), [AccessToken](../README.md#AccessToken), [SudoParam](../README.md#SudoParam), [Token](../README.md#Token) - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: application/json - -[[Back to top]](#) [[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, q, 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 | | -**q** | Option<**String**> | Search string | | -**page** | Option<**i32**> | page number of results to return (1-based) | | -**limit** | Option<**i32**> | page size of results | | - -### Return type - -[**Vec**](Release.md) - -### Authorization - -[TOTPHeader](../README.md#TOTPHeader), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [SudoHeader](../README.md#SudoHeader), [BasicAuth](../README.md#BasicAuth), [AccessToken](../README.md#AccessToken), [SudoParam](../README.md#SudoParam), [Token](../README.md#Token) - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: application/json - -[[Back to top]](#) [[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 - -[TOTPHeader](../README.md#TOTPHeader), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [SudoHeader](../README.md#SudoHeader), [BasicAuth](../README.md#BasicAuth), [AccessToken](../README.md#AccessToken), [SudoParam](../README.md#SudoParam), [Token](../README.md#Token) - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: application/json - -[[Back to top]](#) [[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 - -[TOTPHeader](../README.md#TOTPHeader), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [SudoHeader](../README.md#SudoHeader), [BasicAuth](../README.md#BasicAuth), [AccessToken](../README.md#AccessToken), [SudoParam](../README.md#SudoParam), [Token](../README.md#Token) - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: application/json - -[[Back to top]](#) [[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 - -[TOTPHeader](../README.md#TOTPHeader), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [SudoHeader](../README.md#SudoHeader), [BasicAuth](../README.md#BasicAuth), [AccessToken](../README.md#AccessToken), [SudoParam](../README.md#SudoParam), [Token](../README.md#Token) - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: application/json - -[[Back to top]](#) [[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 - -[TOTPHeader](../README.md#TOTPHeader), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [SudoHeader](../README.md#SudoHeader), [BasicAuth](../README.md#BasicAuth), [AccessToken](../README.md#AccessToken), [SudoParam](../README.md#SudoParam), [Token](../README.md#Token) - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: application/json - -[[Back to top]](#) [[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_tag_protection - -> Vec repo_list_tag_protection(owner, repo) -List tag 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**](TagProtection.md) - -### Authorization - -[TOTPHeader](../README.md#TOTPHeader), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [SudoHeader](../README.md#SudoHeader), [BasicAuth](../README.md#BasicAuth), [AccessToken](../README.md#AccessToken), [SudoParam](../README.md#SudoParam), [Token](../README.md#Token) - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: application/json - -[[Back to top]](#) [[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 - -[TOTPHeader](../README.md#TOTPHeader), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [SudoHeader](../README.md#SudoHeader), [BasicAuth](../README.md#BasicAuth), [AccessToken](../README.md#AccessToken), [SudoParam](../README.md#SudoParam), [Token](../README.md#Token) - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: application/json - -[[Back to top]](#) [[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 - -[TOTPHeader](../README.md#TOTPHeader), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [SudoHeader](../README.md#SudoHeader), [BasicAuth](../README.md#BasicAuth), [AccessToken](../README.md#AccessToken), [SudoParam](../README.md#SudoParam), [Token](../README.md#Token) - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: application/json - -[[Back to top]](#) [[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 - -> 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 - -[**models::TopicName**](TopicName.md) - -### Authorization - -[TOTPHeader](../README.md#TOTPHeader), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [SudoHeader](../README.md#SudoHeader), [BasicAuth](../README.md#BasicAuth), [AccessToken](../README.md#AccessToken), [SudoParam](../README.md#SudoParam), [Token](../README.md#Token) - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: application/json - -[[Back to top]](#) [[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 - -[TOTPHeader](../README.md#TOTPHeader), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [SudoHeader](../README.md#SudoHeader), [BasicAuth](../README.md#BasicAuth), [AccessToken](../README.md#AccessToken), [SudoParam](../README.md#SudoParam), [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_migrate - -> models::Repository repo_migrate(body) -Migrate a remote git repository - -### Parameters - - -Name | Type | Description | Required | Notes -------------- | ------------- | ------------- | ------------- | ------------- -**body** | Option<[**MigrateRepoOptions**](MigrateRepoOptions.md)> | | | - -### Return type - -[**models::Repository**](Repository.md) - -### Authorization - -[TOTPHeader](../README.md#TOTPHeader), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [SudoHeader](../README.md#SudoHeader), [BasicAuth](../README.md#BasicAuth), [AccessToken](../README.md#AccessToken), [SudoParam](../README.md#SudoParam), [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 - -[TOTPHeader](../README.md#TOTPHeader), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [SudoHeader](../README.md#SudoHeader), [BasicAuth](../README.md#BasicAuth), [AccessToken](../README.md#AccessToken), [SudoParam](../README.md#SudoParam), [Token](../README.md#Token) - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: application/json - -[[Back to top]](#) [[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_new_pin_allowed - -> models::NewIssuePinsAllowed repo_new_pin_allowed(owner, repo) -Returns if new Issue Pins are allowed - -### Parameters - - -Name | Type | Description | Required | Notes -------------- | ------------- | ------------- | ------------- | ------------- -**owner** | **String** | owner of the repo | [required] | -**repo** | **String** | name of the repo | [required] | - -### Return type - -[**models::NewIssuePinsAllowed**](NewIssuePinsAllowed.md) - -### Authorization - -[TOTPHeader](../README.md#TOTPHeader), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [SudoHeader](../README.md#SudoHeader), [BasicAuth](../README.md#BasicAuth), [AccessToken](../README.md#AccessToken), [SudoParam](../README.md#SudoParam), [Token](../README.md#Token) - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: application/json - -[[Back to top]](#) [[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 - -[TOTPHeader](../README.md#TOTPHeader), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [SudoHeader](../README.md#SudoHeader), [BasicAuth](../README.md#BasicAuth), [AccessToken](../README.md#AccessToken), [SudoParam](../README.md#SudoParam), [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_push_mirror_sync - -> repo_push_mirror_sync(owner, repo) -Sync all push 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 - -[TOTPHeader](../README.md#TOTPHeader), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [SudoHeader](../README.md#SudoHeader), [BasicAuth](../README.md#BasicAuth), [AccessToken](../README.md#AccessToken), [SudoParam](../README.md#SudoParam), [Token](../README.md#Token) - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: application/json - -[[Back to top]](#) [[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_remove_note - -> repo_remove_note(owner, repo, sha) -Removes 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 - - (empty response body) - -### Authorization - -[TOTPHeader](../README.md#TOTPHeader), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [SudoHeader](../README.md#SudoHeader), [BasicAuth](../README.md#BasicAuth), [AccessToken](../README.md#AccessToken), [SudoParam](../README.md#SudoParam), [Token](../README.md#Token) - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: application/json - -[[Back to top]](#) [[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_replace_all_flags - -> repo_replace_all_flags(owner, repo, body) -Replace all flags of a repository - -### Parameters - - -Name | Type | Description | Required | Notes -------------- | ------------- | ------------- | ------------- | ------------- -**owner** | **String** | owner of the repo | [required] | -**repo** | **String** | name of the repo | [required] | -**body** | Option<[**ReplaceFlagsOption**](ReplaceFlagsOption.md)> | | | - -### Return type - - (empty response body) - -### Authorization - -[TOTPHeader](../README.md#TOTPHeader), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [SudoHeader](../README.md#SudoHeader), [BasicAuth](../README.md#BasicAuth), [AccessToken](../README.md#AccessToken), [SudoParam](../README.md#SudoParam), [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_search - -> 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 public, 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\", \"git_size\", \"lfs_size\", \"stars\", \"forks\" 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 - -[**models::SearchResults**](SearchResults.md) - -### Authorization - -[TOTPHeader](../README.md#TOTPHeader), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [SudoHeader](../README.md#SudoHeader), [BasicAuth](../README.md#BasicAuth), [AccessToken](../README.md#AccessToken), [SudoParam](../README.md#SudoParam), [Token](../README.md#Token) - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: application/json - -[[Back to top]](#) [[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_run_jobs - -> Vec repo_search_run_jobs(owner, repo, labels) -Search for repository's action jobs according filter conditions - -### Parameters - - -Name | Type | Description | Required | Notes -------------- | ------------- | ------------- | ------------- | ------------- -**owner** | **String** | owner of the repo | [required] | -**repo** | **String** | name of the repo | [required] | -**labels** | Option<**String**> | a comma separated list of run job labels to search for | | - -### Return type - -[**Vec**](ActionRunJob.md) - -### Authorization - -[TOTPHeader](../README.md#TOTPHeader), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [SudoHeader](../README.md#SudoHeader), [BasicAuth](../README.md#BasicAuth), [AccessToken](../README.md#AccessToken), [SudoParam](../README.md#SudoParam), [Token](../README.md#Token) - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: application/json - -[[Back to top]](#) [[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_set_note - -> models::Note repo_set_note(owner, repo, sha, body) -Set 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] | -**body** | Option<[**NoteOptions**](NoteOptions.md)> | | | - -### Return type - -[**models::Note**](Note.md) - -### Authorization - -[TOTPHeader](../README.md#TOTPHeader), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [SudoHeader](../README.md#SudoHeader), [BasicAuth](../README.md#BasicAuth), [AccessToken](../README.md#AccessToken), [SudoParam](../README.md#SudoParam), [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_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 - -[TOTPHeader](../README.md#TOTPHeader), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [SudoHeader](../README.md#SudoHeader), [BasicAuth](../README.md#BasicAuth), [AccessToken](../README.md#AccessToken), [SudoParam](../README.md#SudoParam), [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 - -> 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 - -[**models::PullReview**](PullReview.md) - -### Authorization - -[TOTPHeader](../README.md#TOTPHeader), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [SudoHeader](../README.md#SudoHeader), [BasicAuth](../README.md#BasicAuth), [AccessToken](../README.md#AccessToken), [SudoParam](../README.md#SudoParam), [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_sync_fork_branch - -> repo_sync_fork_branch(owner, repo, branch) -Syncs a fork branch with the base branch - -### Parameters - - -Name | Type | Description | Required | Notes -------------- | ------------- | ------------- | ------------- | ------------- -**owner** | **String** | owner of the repo | [required] | -**repo** | **String** | name of the repo | [required] | -**branch** | **String** | The branch | [required] | - -### Return type - - (empty response body) - -### Authorization - -[TOTPHeader](../README.md#TOTPHeader), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [SudoHeader](../README.md#SudoHeader), [BasicAuth](../README.md#BasicAuth), [AccessToken](../README.md#AccessToken), [SudoParam](../README.md#SudoParam), [Token](../README.md#Token) - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: application/json - -[[Back to top]](#) [[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_sync_fork_branch_info - -> models::SyncForkInfo repo_sync_fork_branch_info(owner, repo, branch) -Gets information about syncing a fork branch with the base branch - -### Parameters - - -Name | Type | Description | Required | Notes -------------- | ------------- | ------------- | ------------- | ------------- -**owner** | **String** | owner of the repo | [required] | -**repo** | **String** | name of the repo | [required] | -**branch** | **String** | The branch | [required] | - -### Return type - -[**models::SyncForkInfo**](SyncForkInfo.md) - -### Authorization - -[TOTPHeader](../README.md#TOTPHeader), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [SudoHeader](../README.md#SudoHeader), [BasicAuth](../README.md#BasicAuth), [AccessToken](../README.md#AccessToken), [SudoParam](../README.md#SudoParam), [Token](../README.md#Token) - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: application/json - -[[Back to top]](#) [[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_sync_fork_default - -> repo_sync_fork_default(owner, repo) -Syncs the default branch of a fork with the base branch - -### 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 - -[TOTPHeader](../README.md#TOTPHeader), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [SudoHeader](../README.md#SudoHeader), [BasicAuth](../README.md#BasicAuth), [AccessToken](../README.md#AccessToken), [SudoParam](../README.md#SudoParam), [Token](../README.md#Token) - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: application/json - -[[Back to top]](#) [[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_sync_fork_default_info - -> models::SyncForkInfo repo_sync_fork_default_info(owner, repo) -Gets information about syncing the fork default branch with the base branch - -### Parameters - - -Name | Type | Description | Required | Notes -------------- | ------------- | ------------- | ------------- | ------------- -**owner** | **String** | owner of the repo | [required] | -**repo** | **String** | name of the repo | [required] | - -### Return type - -[**models::SyncForkInfo**](SyncForkInfo.md) - -### Authorization - -[TOTPHeader](../README.md#TOTPHeader), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [SudoHeader](../README.md#SudoHeader), [BasicAuth](../README.md#BasicAuth), [AccessToken](../README.md#AccessToken), [SudoParam](../README.md#SudoParam), [Token](../README.md#Token) - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: application/json - -[[Back to top]](#) [[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 - -[TOTPHeader](../README.md#TOTPHeader), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [SudoHeader](../README.md#SudoHeader), [BasicAuth](../README.md#BasicAuth), [AccessToken](../README.md#AccessToken), [SudoParam](../README.md#SudoParam), [Token](../README.md#Token) - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: application/json - -[[Back to top]](#) [[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 - -[TOTPHeader](../README.md#TOTPHeader), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [SudoHeader](../README.md#SudoHeader), [BasicAuth](../README.md#BasicAuth), [AccessToken](../README.md#AccessToken), [SudoParam](../README.md#SudoParam), [Token](../README.md#Token) - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: application/json - -[[Back to top]](#) [[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 - -> 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 - -[**models::Repository**](Repository.md) - -### Authorization - -[TOTPHeader](../README.md#TOTPHeader), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [SudoHeader](../README.md#SudoHeader), [BasicAuth](../README.md#BasicAuth), [AccessToken](../README.md#AccessToken), [SudoParam](../README.md#SudoParam), [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 - -> 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 - -[**models::PullReview**](PullReview.md) - -### Authorization - -[TOTPHeader](../README.md#TOTPHeader), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [SudoHeader](../README.md#SudoHeader), [BasicAuth](../README.md#BasicAuth), [AccessToken](../README.md#AccessToken), [SudoParam](../README.md#SudoParam), [Token](../README.md#Token) - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: application/json - -[[Back to top]](#) [[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_avatar - -> repo_update_avatar(owner, repo, body) -Update a repository's avatar - -### Parameters - - -Name | Type | Description | Required | Notes -------------- | ------------- | ------------- | ------------- | ------------- -**owner** | **String** | owner of the repo | [required] | -**repo** | **String** | name of the repo | [required] | -**body** | Option<[**UpdateRepoAvatarOption**](UpdateRepoAvatarOption.md)> | | | - -### Return type - - (empty response body) - -### Authorization - -[TOTPHeader](../README.md#TOTPHeader), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [SudoHeader](../README.md#SudoHeader), [BasicAuth](../README.md#BasicAuth), [AccessToken](../README.md#AccessToken), [SudoParam](../README.md#SudoParam), [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_update_branch - -> repo_update_branch(owner, repo, branch, body) -Update a branch - -### Parameters - - -Name | Type | Description | Required | Notes -------------- | ------------- | ------------- | ------------- | ------------- -**owner** | **String** | owner of the repo | [required] | -**repo** | **String** | name of the repo | [required] | -**branch** | **String** | name of the branch | [required] | -**body** | Option<[**UpdateBranchRepoOption**](UpdateBranchRepoOption.md)> | | | - -### Return type - - (empty response body) - -### Authorization - -[TOTPHeader](../README.md#TOTPHeader), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [SudoHeader](../README.md#SudoHeader), [BasicAuth](../README.md#BasicAuth), [AccessToken](../README.md#AccessToken), [SudoParam](../README.md#SudoParam), [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_file - -> 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 - -[**models::FileResponse**](FileResponse.md) - -### Authorization - -[TOTPHeader](../README.md#TOTPHeader), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [SudoHeader](../README.md#SudoHeader), [BasicAuth](../README.md#BasicAuth), [AccessToken](../README.md#AccessToken), [SudoParam](../README.md#SudoParam), [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 - -[TOTPHeader](../README.md#TOTPHeader), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [SudoHeader](../README.md#SudoHeader), [BasicAuth](../README.md#BasicAuth), [AccessToken](../README.md#AccessToken), [SudoParam](../README.md#SudoParam), [Token](../README.md#Token) - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: application/json - -[[Back to top]](#) [[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 - -[TOTPHeader](../README.md#TOTPHeader), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [SudoHeader](../README.md#SudoHeader), [BasicAuth](../README.md#BasicAuth), [AccessToken](../README.md#AccessToken), [SudoParam](../README.md#SudoParam), [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_validate_issue_config - -> models::IssueConfigValidation repo_validate_issue_config(owner, repo) -Returns the validation information for a issue config - -### Parameters - - -Name | Type | Description | Required | Notes -------------- | ------------- | ------------- | ------------- | ------------- -**owner** | **String** | owner of the repo | [required] | -**repo** | **String** | name of the repo | [required] | - -### Return type - -[**models::IssueConfigValidation**](IssueConfigValidation.md) - -### Authorization - -[TOTPHeader](../README.md#TOTPHeader), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [SudoHeader](../README.md#SudoHeader), [BasicAuth](../README.md#BasicAuth), [AccessToken](../README.md#AccessToken), [SudoParam](../README.md#SudoParam), [Token](../README.md#Token) - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: application/json - -[[Back to top]](#) [[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 - -> models::TopicSearchResults topic_search(q, page, limit) -Search for topics by keyword - -### Parameters - - -Name | Type | Description | Required | Notes -------------- | ------------- | ------------- | ------------- | ------------- -**q** | **String** | keyword to search for | [required] | -**page** | Option<**i32**> | page number of results to return (1-based) | | -**limit** | Option<**i32**> | page size of results | | - -### Return type - -[**models::TopicSearchResults**](TopicSearchResults.md) - -### Authorization - -[TOTPHeader](../README.md#TOTPHeader), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [SudoHeader](../README.md#SudoHeader), [BasicAuth](../README.md#BasicAuth), [AccessToken](../README.md#AccessToken), [SudoParam](../README.md#SudoParam), [Token](../README.md#Token) - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: application/json - -[[Back to top]](#) [[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_repo_secret - -> update_repo_secret(owner, repo, secretname, body) -Create or Update a secret value in a repository - -### Parameters - - -Name | Type | Description | Required | Notes -------------- | ------------- | ------------- | ------------- | ------------- -**owner** | **String** | owner of the repository | [required] | -**repo** | **String** | name of the repository | [required] | -**secretname** | **String** | name of the secret | [required] | -**body** | Option<[**CreateOrUpdateSecretOption**](CreateOrUpdateSecretOption.md)> | | | - -### Return type - - (empty response body) - -### Authorization - -[TOTPHeader](../README.md#TOTPHeader), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [SudoHeader](../README.md#SudoHeader), [BasicAuth](../README.md#BasicAuth), [AccessToken](../README.md#AccessToken), [SudoParam](../README.md#SudoParam), [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) - - -## update_repo_variable - -> update_repo_variable(owner, repo, variablename, body) -Update a repo-level variable - -### Parameters - - -Name | Type | Description | Required | Notes -------------- | ------------- | ------------- | ------------- | ------------- -**owner** | **String** | name of the owner | [required] | -**repo** | **String** | name of the repository | [required] | -**variablename** | **String** | name of the variable | [required] | -**body** | Option<[**UpdateVariableOption**](UpdateVariableOption.md)> | | | - -### Return type - - (empty response body) - -### Authorization - -[TOTPHeader](../README.md#TOTPHeader), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [SudoHeader](../README.md#SudoHeader), [BasicAuth](../README.md#BasicAuth), [AccessToken](../README.md#AccessToken), [SudoParam](../README.md#SudoParam), [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_current_check_subscription - -> 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 - -[**models::WatchInfo**](WatchInfo.md) - -### Authorization - -[TOTPHeader](../README.md#TOTPHeader), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [SudoHeader](../README.md#SudoHeader), [BasicAuth](../README.md#BasicAuth), [AccessToken](../README.md#AccessToken), [SudoParam](../README.md#SudoParam), [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 - -[TOTPHeader](../README.md#TOTPHeader), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [SudoHeader](../README.md#SudoHeader), [BasicAuth](../README.md#BasicAuth), [AccessToken](../README.md#AccessToken), [SudoParam](../README.md#SudoParam), [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_put_subscription - -> 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 - -[**models::WatchInfo**](WatchInfo.md) - -### Authorization - -[TOTPHeader](../README.md#TOTPHeader), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [SudoHeader](../README.md#SudoHeader), [BasicAuth](../README.md#BasicAuth), [AccessToken](../README.md#AccessToken), [SudoParam](../README.md#SudoParam), [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 - -[TOTPHeader](../README.md#TOTPHeader), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [SudoHeader](../README.md#SudoHeader), [BasicAuth](../README.md#BasicAuth), [AccessToken](../README.md#AccessToken), [SudoParam](../README.md#SudoParam), [Token](../README.md#Token) - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: application/json - -[[Back to top]](#) [[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/docs/RepositoryMeta.md b/docs/RepositoryMeta.md deleted file mode 100644 index 58daa18..0000000 --- a/docs/RepositoryMeta.md +++ /dev/null @@ -1,14 +0,0 @@ -# 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/docs/SearchResults.md b/docs/SearchResults.md deleted file mode 100644 index 4642d2e..0000000 --- a/docs/SearchResults.md +++ /dev/null @@ -1,12 +0,0 @@ -# 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/docs/Secret.md b/docs/Secret.md deleted file mode 100644 index b5bcf73..0000000 --- a/docs/Secret.md +++ /dev/null @@ -1,12 +0,0 @@ -# Secret - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**created_at** | Option<**String**> | | [optional] -**name** | Option<**String**> | the secret's name | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/docs/ServerVersion.md b/docs/ServerVersion.md deleted file mode 100644 index 96ba26f..0000000 --- a/docs/ServerVersion.md +++ /dev/null @@ -1,11 +0,0 @@ -# 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/docs/SetUserQuotaGroupsOptions.md b/docs/SetUserQuotaGroupsOptions.md deleted file mode 100644 index c0d385c..0000000 --- a/docs/SetUserQuotaGroupsOptions.md +++ /dev/null @@ -1,11 +0,0 @@ -# SetUserQuotaGroupsOptions - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**groups** | **Vec** | Quota groups the user shall have | - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/docs/SettingsApi.md b/docs/SettingsApi.md deleted file mode 100644 index ae75b02..0000000 --- a/docs/SettingsApi.md +++ /dev/null @@ -1,112 +0,0 @@ -# \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 - -> models::GeneralApiSettings get_general_api_settings() -Get instance's global settings for api - -### Parameters - -This endpoint does not need any parameter. - -### Return type - -[**models::GeneralApiSettings**](GeneralAPISettings.md) - -### Authorization - -[TOTPHeader](../README.md#TOTPHeader), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [SudoHeader](../README.md#SudoHeader), [BasicAuth](../README.md#BasicAuth), [AccessToken](../README.md#AccessToken), [SudoParam](../README.md#SudoParam), [Token](../README.md#Token) - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: application/json - -[[Back to top]](#) [[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 - -> models::GeneralAttachmentSettings get_general_attachment_settings() -Get instance's global settings for Attachment - -### Parameters - -This endpoint does not need any parameter. - -### Return type - -[**models::GeneralAttachmentSettings**](GeneralAttachmentSettings.md) - -### Authorization - -[TOTPHeader](../README.md#TOTPHeader), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [SudoHeader](../README.md#SudoHeader), [BasicAuth](../README.md#BasicAuth), [AccessToken](../README.md#AccessToken), [SudoParam](../README.md#SudoParam), [Token](../README.md#Token) - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: application/json - -[[Back to top]](#) [[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 - -> models::GeneralRepoSettings get_general_repository_settings() -Get instance's global settings for repositories - -### Parameters - -This endpoint does not need any parameter. - -### Return type - -[**models::GeneralRepoSettings**](GeneralRepoSettings.md) - -### Authorization - -[TOTPHeader](../README.md#TOTPHeader), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [SudoHeader](../README.md#SudoHeader), [BasicAuth](../README.md#BasicAuth), [AccessToken](../README.md#AccessToken), [SudoParam](../README.md#SudoParam), [Token](../README.md#Token) - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: application/json - -[[Back to top]](#) [[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 - -> models::GeneralUiSettings get_general_ui_settings() -Get instance's global settings for ui - -### Parameters - -This endpoint does not need any parameter. - -### Return type - -[**models::GeneralUiSettings**](GeneralUISettings.md) - -### Authorization - -[TOTPHeader](../README.md#TOTPHeader), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [SudoHeader](../README.md#SudoHeader), [BasicAuth](../README.md#BasicAuth), [AccessToken](../README.md#AccessToken), [SudoParam](../README.md#SudoParam), [Token](../README.md#Token) - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: application/json - -[[Back to top]](#) [[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/docs/StopWatch.md b/docs/StopWatch.md deleted file mode 100644 index fb0b10b..0000000 --- a/docs/StopWatch.md +++ /dev/null @@ -1,17 +0,0 @@ -# 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/docs/SubmitPullReviewOptions.md b/docs/SubmitPullReviewOptions.md deleted file mode 100644 index 2be076a..0000000 --- a/docs/SubmitPullReviewOptions.md +++ /dev/null @@ -1,12 +0,0 @@ -# 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/docs/SyncForkInfo.md b/docs/SyncForkInfo.md deleted file mode 100644 index c98acd4..0000000 --- a/docs/SyncForkInfo.md +++ /dev/null @@ -1,14 +0,0 @@ -# SyncForkInfo - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**allowed** | Option<**bool**> | | [optional] -**base_commit** | Option<**String**> | | [optional] -**commits_behind** | Option<**i64**> | | [optional] -**fork_commit** | 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/docs/Tag.md b/docs/Tag.md deleted file mode 100644 index 2af8d24..0000000 --- a/docs/Tag.md +++ /dev/null @@ -1,17 +0,0 @@ -# Tag - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**archive_download_count** | Option<[**models::TagArchiveDownloadCount**](TagArchiveDownloadCount.md)> | | [optional] -**commit** | Option<[**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/docs/TagArchiveDownloadCount.md b/docs/TagArchiveDownloadCount.md deleted file mode 100644 index 747d81e..0000000 --- a/docs/TagArchiveDownloadCount.md +++ /dev/null @@ -1,12 +0,0 @@ -# TagArchiveDownloadCount - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**tar_gz** | Option<**i64**> | | [optional] -**zip** | 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/docs/TagProtection.md b/docs/TagProtection.md deleted file mode 100644 index 338bc8d..0000000 --- a/docs/TagProtection.md +++ /dev/null @@ -1,16 +0,0 @@ -# TagProtection - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**created_at** | Option<**String**> | | [optional] -**id** | Option<**i64**> | | [optional] -**name_pattern** | Option<**String**> | | [optional] -**updated_at** | Option<**String**> | | [optional] -**whitelist_teams** | Option<**Vec**> | | [optional] -**whitelist_usernames** | 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/docs/Team.md b/docs/Team.md deleted file mode 100644 index 2b58c74..0000000 --- a/docs/Team.md +++ /dev/null @@ -1,19 +0,0 @@ -# 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<[**models::Organization**](Organization.md)> | | [optional] -**permission** | Option<**Permission**> | (enum: none, read, write, admin, owner) | [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/docs/TeamSearchResults.md b/docs/TeamSearchResults.md deleted file mode 100644 index 13aa258..0000000 --- a/docs/TeamSearchResults.md +++ /dev/null @@ -1,12 +0,0 @@ -# TeamSearchResults - -## 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/docs/TimelineComment.md b/docs/TimelineComment.md deleted file mode 100644 index 908d4bc..0000000 --- a/docs/TimelineComment.md +++ /dev/null @@ -1,39 +0,0 @@ -# TimelineComment - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**assignee** | Option<[**models::User**](User.md)> | | [optional] -**assignee_team** | Option<[**models::Team**](Team.md)> | | [optional] -**body** | Option<**String**> | | [optional] -**created_at** | Option<**String**> | | [optional] -**dependent_issue** | Option<[**models::Issue**](Issue.md)> | | [optional] -**html_url** | Option<**String**> | | [optional] -**id** | Option<**i64**> | | [optional] -**issue_url** | Option<**String**> | | [optional] -**label** | Option<[**models::Label**](Label.md)> | | [optional] -**milestone** | Option<[**models::Milestone**](Milestone.md)> | | [optional] -**new_ref** | Option<**String**> | | [optional] -**new_title** | Option<**String**> | | [optional] -**old_milestone** | Option<[**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<[**models::Comment**](Comment.md)> | | [optional] -**ref_commit_sha** | Option<**String**> | commit SHA where issue/PR was referenced | [optional] -**ref_issue** | Option<[**models::Issue**](Issue.md)> | | [optional] -**removed_assignee** | Option<**bool**> | whether the assignees were removed or added | [optional] -**resolve_doer** | Option<[**models::User**](User.md)> | | [optional] -**review_id** | Option<**i64**> | | [optional] -**tracked_time** | Option<[**models::TrackedTime**](TrackedTime.md)> | | [optional] -**r#type** | Option<**String**> | | [optional] -**updated_at** | Option<**String**> | | [optional] -**user** | Option<[**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/docs/TopicName.md b/docs/TopicName.md deleted file mode 100644 index 8a07731..0000000 --- a/docs/TopicName.md +++ /dev/null @@ -1,11 +0,0 @@ -# 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/docs/TopicResponse.md b/docs/TopicResponse.md deleted file mode 100644 index e018c94..0000000 --- a/docs/TopicResponse.md +++ /dev/null @@ -1,15 +0,0 @@ -# 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/docs/TopicSearchResults.md b/docs/TopicSearchResults.md deleted file mode 100644 index 9640e72..0000000 --- a/docs/TopicSearchResults.md +++ /dev/null @@ -1,11 +0,0 @@ -# TopicSearchResults - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**topics** | Option<[**Vec**](TopicResponse.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/docs/TrackedTime.md b/docs/TrackedTime.md deleted file mode 100644 index 91f638d..0000000 --- a/docs/TrackedTime.md +++ /dev/null @@ -1,17 +0,0 @@ -# TrackedTime - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**created** | Option<**String**> | | [optional] -**id** | Option<**i64**> | | [optional] -**issue** | Option<[**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/docs/TransferRepoOption.md b/docs/TransferRepoOption.md deleted file mode 100644 index 04b5f3e..0000000 --- a/docs/TransferRepoOption.md +++ /dev/null @@ -1,12 +0,0 @@ -# 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/docs/UpdateBranchRepoOption.md b/docs/UpdateBranchRepoOption.md deleted file mode 100644 index c1712e4..0000000 --- a/docs/UpdateBranchRepoOption.md +++ /dev/null @@ -1,11 +0,0 @@ -# UpdateBranchRepoOption - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**name** | **String** | New branch name | - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/docs/UpdateFileOptions.md b/docs/UpdateFileOptions.md deleted file mode 100644 index 9d5435b..0000000 --- a/docs/UpdateFileOptions.md +++ /dev/null @@ -1,20 +0,0 @@ -# UpdateFileOptions - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**author** | Option<[**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<[**models::Identity**](Identity.md)> | | [optional] -**content** | **String** | content must be base64 encoded | -**dates** | Option<[**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/docs/UpdateRepoAvatarOption.md b/docs/UpdateRepoAvatarOption.md deleted file mode 100644 index 88eebc3..0000000 --- a/docs/UpdateRepoAvatarOption.md +++ /dev/null @@ -1,11 +0,0 @@ -# UpdateRepoAvatarOption - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**image** | Option<**String**> | image must be base64 encoded | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/docs/UpdateUserAvatarOption.md b/docs/UpdateUserAvatarOption.md deleted file mode 100644 index b0cb064..0000000 --- a/docs/UpdateUserAvatarOption.md +++ /dev/null @@ -1,11 +0,0 @@ -# UpdateUserAvatarOption - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**image** | Option<**String**> | image must be base64 encoded | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/docs/UpdateVariableOption.md b/docs/UpdateVariableOption.md deleted file mode 100644 index 4f12f4b..0000000 --- a/docs/UpdateVariableOption.md +++ /dev/null @@ -1,12 +0,0 @@ -# UpdateVariableOption - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**name** | Option<**String**> | New name for the variable. If the field is empty, the variable name won't be updated. | [optional] -**value** | **String** | Value of the variable to update | - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/docs/User.md b/docs/User.md deleted file mode 100644 index a843717..0000000 --- a/docs/User.md +++ /dev/null @@ -1,33 +0,0 @@ -# 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] -**html_url** | Option<**String**> | URL to the user's profile page | [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] -**login_name** | Option<**String**> | the user's authentication sign-in name. | [optional][default to empty] -**prohibit_login** | Option<**bool**> | Is user login prohibited | [optional] -**pronouns** | Option<**String**> | the user's pronouns | [optional] -**restricted** | Option<**bool**> | Is user restricted | [optional] -**source_id** | Option<**i64**> | The ID of the user's Authentication Source | [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/docs/UserApi.md b/docs/UserApi.md deleted file mode 100644 index edf07c6..0000000 --- a/docs/UserApi.md +++ /dev/null @@ -1,2219 +0,0 @@ -# \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 -[**create_user_variable**](UserApi.md#create_user_variable) | **POST** /user/actions/variables/{variablename} | Create a user-level variable -[**delete_user_secret**](UserApi.md#delete_user_secret) | **DELETE** /user/actions/secrets/{secretname} | Delete a secret in a user scope -[**delete_user_variable**](UserApi.md#delete_user_variable) | **DELETE** /user/actions/variables/{variablename} | Delete a user-level variable which is created by current doer -[**get_user_settings**](UserApi.md#get_user_settings) | **GET** /user/settings | Get current user's account settings -[**get_user_variable**](UserApi.md#get_user_variable) | **GET** /user/actions/variables/{variablename} | Get a user-level variable which is created by current doer -[**get_user_variables_list**](UserApi.md#get_user_variables_list) | **GET** /user/actions/variables | Get the user-level list of variables which is created by current doer -[**get_verification_token**](UserApi.md#get_verification_token) | **GET** /user/gpg_key_token | Get a Token to verify -[**update_user_secret**](UserApi.md#update_user_secret) | **PUT** /user/actions/secrets/{secretname} | Create or Update a secret value in a user scope -[**update_user_settings**](UserApi.md#update_user_settings) | **PATCH** /user/settings | Update settings in current user's account -[**update_user_variable**](UserApi.md#update_user_variable) | **PUT** /user/actions/variables/{variablename} | Update a user-level variable which is created by current doer -[**user_add_email**](UserApi.md#user_add_email) | **POST** /user/emails | Add an email addresses to the current user's account -[**user_block_user**](UserApi.md#user_block_user) | **PUT** /user/block/{username} | Blocks a user from the doer -[**user_check_following**](UserApi.md#user_check_following) | **GET** /users/{username}/following/{target} | Check if one user is following another user -[**user_check_quota**](UserApi.md#user_check_quota) | **GET** /user/quota/check | Check if the authenticated user is over quota for a given subject -[**user_create_hook**](UserApi.md#user_create_hook) | **POST** /user/hooks | Create a hook -[**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 | Generate an access token for the specified user -[**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 public key from current user's account -[**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 | Add a GPG public key to current user's account -[**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 from the specified user's account -[**user_delete_avatar**](UserApi.md#user_delete_avatar) | **DELETE** /user/avatar | Delete avatar of the current user. It will be replaced by a default one -[**user_delete_email**](UserApi.md#user_delete_email) | **DELETE** /user/emails | Delete email addresses from the current user's account -[**user_delete_hook**](UserApi.md#user_delete_hook) | **DELETE** /user/hooks/{id} | Delete a hook -[**user_delete_o_auth2_application**](UserApi.md#user_delete_o_auth2_application) | **DELETE** /user/applications/oauth2/{id} | Delete an OAuth2 application -[**user_edit_hook**](UserApi.md#user_edit_hook) | **PATCH** /user/hooks/{id} | Update a hook -[**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_hook**](UserApi.md#user_get_hook) | **GET** /user/hooks/{id} | Get a hook -[**user_get_o_auth2_application**](UserApi.md#user_get_o_auth2_application) | **GET** /user/applications/oauth2/{id} | Get an OAuth2 application -[**user_get_o_auth2_applications**](UserApi.md#user_get_o_auth2_applications) | **GET** /user/applications/oauth2 | List the authenticated user's oauth2 applications -[**user_get_quota**](UserApi.md#user_get_quota) | **GET** /user/quota | Get quota information for the authenticated user -[**user_get_runner_registration_token**](UserApi.md#user_get_runner_registration_token) | **GET** /user/actions/runners/registration-token | Get an user's actions runner registration token -[**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 specified user's access tokens -[**user_list_activity_feeds**](UserApi.md#user_list_activity_feeds) | **GET** /users/{username}/activities/feeds | List a user's activity feeds -[**user_list_blocked_users**](UserApi.md#user_list_blocked_users) | **GET** /user/list_blocked | List the authenticated user's blocked users -[**user_list_emails**](UserApi.md#user_list_emails) | **GET** /user/emails | List all email addresses of the current user -[**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_hooks**](UserApi.md#user_list_hooks) | **GET** /user/hooks | List the authenticated user's webhooks -[**user_list_keys**](UserApi.md#user_list_keys) | **GET** /users/{username}/keys | List the given user's public keys -[**user_list_quota_artifacts**](UserApi.md#user_list_quota_artifacts) | **GET** /user/quota/artifacts | List the artifacts affecting the authenticated user's quota -[**user_list_quota_attachments**](UserApi.md#user_list_quota_attachments) | **GET** /user/quota/attachments | List the attachments affecting the authenticated user's quota -[**user_list_quota_packages**](UserApi.md#user_list_quota_packages) | **GET** /user/quota/packages | List the packages affecting the authenticated user's quota -[**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_search_run_jobs**](UserApi.md#user_search_run_jobs) | **GET** /user/actions/runners/jobs | Search for user's action jobs according filter conditions -[**user_unblock_user**](UserApi.md#user_unblock_user) | **PUT** /user/unblock/{username} | Unblocks a user from the doer -[**user_update_avatar**](UserApi.md#user_update_avatar) | **POST** /user/avatar | Update avatar of the current user -[**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 - -> models::Repository create_current_user_repo(body) -Create a repository - -### Parameters - - -Name | Type | Description | Required | Notes -------------- | ------------- | ------------- | ------------- | ------------- -**body** | Option<[**CreateRepoOption**](CreateRepoOption.md)> | | | - -### Return type - -[**models::Repository**](Repository.md) - -### Authorization - -[TOTPHeader](../README.md#TOTPHeader), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [SudoHeader](../README.md#SudoHeader), [BasicAuth](../README.md#BasicAuth), [AccessToken](../README.md#AccessToken), [SudoParam](../README.md#SudoParam), [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_user_variable - -> create_user_variable(variablename, body) -Create a user-level variable - -### Parameters - - -Name | Type | Description | Required | Notes -------------- | ------------- | ------------- | ------------- | ------------- -**variablename** | **String** | name of the variable | [required] | -**body** | Option<[**CreateVariableOption**](CreateVariableOption.md)> | | | - -### Return type - - (empty response body) - -### Authorization - -[TOTPHeader](../README.md#TOTPHeader), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [SudoHeader](../README.md#SudoHeader), [BasicAuth](../README.md#BasicAuth), [AccessToken](../README.md#AccessToken), [SudoParam](../README.md#SudoParam), [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) - - -## delete_user_secret - -> delete_user_secret(secretname) -Delete a secret in a user scope - -### Parameters - - -Name | Type | Description | Required | Notes -------------- | ------------- | ------------- | ------------- | ------------- -**secretname** | **String** | name of the secret | [required] | - -### Return type - - (empty response body) - -### Authorization - -[TOTPHeader](../README.md#TOTPHeader), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [SudoHeader](../README.md#SudoHeader), [BasicAuth](../README.md#BasicAuth), [AccessToken](../README.md#AccessToken), [SudoParam](../README.md#SudoParam), [Token](../README.md#Token) - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - - -## delete_user_variable - -> delete_user_variable(variablename) -Delete a user-level variable which is created by current doer - -### Parameters - - -Name | Type | Description | Required | Notes -------------- | ------------- | ------------- | ------------- | ------------- -**variablename** | **String** | name of the variable | [required] | - -### Return type - - (empty response body) - -### Authorization - -[TOTPHeader](../README.md#TOTPHeader), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [SudoHeader](../README.md#SudoHeader), [BasicAuth](../README.md#BasicAuth), [AccessToken](../README.md#AccessToken), [SudoParam](../README.md#SudoParam), [Token](../README.md#Token) - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: application/json - -[[Back to top]](#) [[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 - -> models::UserSettings get_user_settings() -Get current user's account settings - -### Parameters - -This endpoint does not need any parameter. - -### Return type - -[**models::UserSettings**](UserSettings.md) - -### Authorization - -[TOTPHeader](../README.md#TOTPHeader), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [SudoHeader](../README.md#SudoHeader), [BasicAuth](../README.md#BasicAuth), [AccessToken](../README.md#AccessToken), [SudoParam](../README.md#SudoParam), [Token](../README.md#Token) - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: application/json - -[[Back to top]](#) [[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_variable - -> models::ActionVariable get_user_variable(variablename) -Get a user-level variable which is created by current doer - -### Parameters - - -Name | Type | Description | Required | Notes -------------- | ------------- | ------------- | ------------- | ------------- -**variablename** | **String** | name of the variable | [required] | - -### Return type - -[**models::ActionVariable**](ActionVariable.md) - -### Authorization - -[TOTPHeader](../README.md#TOTPHeader), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [SudoHeader](../README.md#SudoHeader), [BasicAuth](../README.md#BasicAuth), [AccessToken](../README.md#AccessToken), [SudoParam](../README.md#SudoParam), [Token](../README.md#Token) - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: application/json - -[[Back to top]](#) [[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_variables_list - -> Vec get_user_variables_list(page, limit) -Get the user-level list of variables which is created by current doer - -### 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**](ActionVariable.md) - -### Authorization - -[TOTPHeader](../README.md#TOTPHeader), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [SudoHeader](../README.md#SudoHeader), [BasicAuth](../README.md#BasicAuth), [AccessToken](../README.md#AccessToken), [SudoParam](../README.md#SudoParam), [Token](../README.md#Token) - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: application/json - -[[Back to top]](#) [[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 - -[TOTPHeader](../README.md#TOTPHeader), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [SudoHeader](../README.md#SudoHeader), [BasicAuth](../README.md#BasicAuth), [AccessToken](../README.md#AccessToken), [SudoParam](../README.md#SudoParam), [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_secret - -> update_user_secret(secretname, body) -Create or Update a secret value in a user scope - -### Parameters - - -Name | Type | Description | Required | Notes -------------- | ------------- | ------------- | ------------- | ------------- -**secretname** | **String** | name of the secret | [required] | -**body** | Option<[**CreateOrUpdateSecretOption**](CreateOrUpdateSecretOption.md)> | | | - -### Return type - - (empty response body) - -### Authorization - -[TOTPHeader](../README.md#TOTPHeader), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [SudoHeader](../README.md#SudoHeader), [BasicAuth](../README.md#BasicAuth), [AccessToken](../README.md#AccessToken), [SudoParam](../README.md#SudoParam), [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) - - -## update_user_settings - -> models::UserSettings update_user_settings(body) -Update settings in current user's account - -### Parameters - - -Name | Type | Description | Required | Notes -------------- | ------------- | ------------- | ------------- | ------------- -**body** | Option<[**UserSettingsOptions**](UserSettingsOptions.md)> | | | - -### Return type - -[**models::UserSettings**](UserSettings.md) - -### Authorization - -[TOTPHeader](../README.md#TOTPHeader), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [SudoHeader](../README.md#SudoHeader), [BasicAuth](../README.md#BasicAuth), [AccessToken](../README.md#AccessToken), [SudoParam](../README.md#SudoParam), [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) - - -## update_user_variable - -> update_user_variable(variablename, body) -Update a user-level variable which is created by current doer - -### Parameters - - -Name | Type | Description | Required | Notes -------------- | ------------- | ------------- | ------------- | ------------- -**variablename** | **String** | name of the variable | [required] | -**body** | Option<[**UpdateVariableOption**](UpdateVariableOption.md)> | | | - -### Return type - - (empty response body) - -### Authorization - -[TOTPHeader](../README.md#TOTPHeader), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [SudoHeader](../README.md#SudoHeader), [BasicAuth](../README.md#BasicAuth), [AccessToken](../README.md#AccessToken), [SudoParam](../README.md#SudoParam), [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_add_email - -> Vec user_add_email(body) -Add an email addresses to the current user's account - -### Parameters - - -Name | Type | Description | Required | Notes -------------- | ------------- | ------------- | ------------- | ------------- -**body** | Option<[**CreateEmailOption**](CreateEmailOption.md)> | | | - -### Return type - -[**Vec**](Email.md) - -### Authorization - -[TOTPHeader](../README.md#TOTPHeader), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [SudoHeader](../README.md#SudoHeader), [BasicAuth](../README.md#BasicAuth), [AccessToken](../README.md#AccessToken), [SudoParam](../README.md#SudoParam), [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_block_user - -> user_block_user(username) -Blocks a user from the doer - -### Parameters - - -Name | Type | Description | Required | Notes -------------- | ------------- | ------------- | ------------- | ------------- -**username** | **String** | username of the user | [required] | - -### Return type - - (empty response body) - -### Authorization - -[TOTPHeader](../README.md#TOTPHeader), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [SudoHeader](../README.md#SudoHeader), [BasicAuth](../README.md#BasicAuth), [AccessToken](../README.md#AccessToken), [SudoParam](../README.md#SudoParam), [Token](../README.md#Token) - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: application/json - -[[Back to top]](#) [[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 - -[TOTPHeader](../README.md#TOTPHeader), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [SudoHeader](../README.md#SudoHeader), [BasicAuth](../README.md#BasicAuth), [AccessToken](../README.md#AccessToken), [SudoParam](../README.md#SudoParam), [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_check_quota - -> bool user_check_quota(subject) -Check if the authenticated user is over quota for a given subject - -### Parameters - - -Name | Type | Description | Required | Notes -------------- | ------------- | ------------- | ------------- | ------------- -**subject** | **String** | subject of the quota | [required] | - -### Return type - -**bool** - -### Authorization - -[TOTPHeader](../README.md#TOTPHeader), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [SudoHeader](../README.md#SudoHeader), [BasicAuth](../README.md#BasicAuth), [AccessToken](../README.md#AccessToken), [SudoParam](../README.md#SudoParam), [Token](../README.md#Token) - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: application/json - -[[Back to top]](#) [[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_hook - -> models::Hook user_create_hook(body) -Create a hook - -### Parameters - - -Name | Type | Description | Required | Notes -------------- | ------------- | ------------- | ------------- | ------------- -**body** | [**CreateHookOption**](CreateHookOption.md) | | [required] | - -### Return type - -[**models::Hook**](Hook.md) - -### Authorization - -[TOTPHeader](../README.md#TOTPHeader), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [SudoHeader](../README.md#SudoHeader), [BasicAuth](../README.md#BasicAuth), [AccessToken](../README.md#AccessToken), [SudoParam](../README.md#SudoParam), [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_create_o_auth2_application - -> 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 - -[**models::OAuth2Application**](OAuth2Application.md) - -### Authorization - -[TOTPHeader](../README.md#TOTPHeader), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [SudoHeader](../README.md#SudoHeader), [BasicAuth](../README.md#BasicAuth), [AccessToken](../README.md#AccessToken), [SudoParam](../README.md#SudoParam), [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 - -> models::AccessToken user_create_token(username, body) -Generate an access token for the specified user - -### Parameters - - -Name | Type | Description | Required | Notes -------------- | ------------- | ------------- | ------------- | ------------- -**username** | **String** | username of user | [required] | -**body** | Option<[**CreateAccessTokenOption**](CreateAccessTokenOption.md)> | | | - -### Return type - -[**models::AccessToken**](AccessToken.md) - -### Authorization - -[TOTPHeader](../README.md#TOTPHeader), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [SudoHeader](../README.md#SudoHeader), [BasicAuth](../README.md#BasicAuth), [AccessToken](../README.md#AccessToken), [SudoParam](../README.md#SudoParam), [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 - -[TOTPHeader](../README.md#TOTPHeader), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [SudoHeader](../README.md#SudoHeader), [BasicAuth](../README.md#BasicAuth), [AccessToken](../README.md#AccessToken), [SudoParam](../README.md#SudoParam), [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_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 - -[TOTPHeader](../README.md#TOTPHeader), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [SudoHeader](../README.md#SudoHeader), [BasicAuth](../README.md#BasicAuth), [AccessToken](../README.md#AccessToken), [SudoParam](../README.md#SudoParam), [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_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 - -[TOTPHeader](../README.md#TOTPHeader), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [SudoHeader](../README.md#SudoHeader), [BasicAuth](../README.md#BasicAuth), [AccessToken](../README.md#AccessToken), [SudoParam](../README.md#SudoParam), [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_gpg_key - -> user_current_delete_gpg_key(id) -Remove a GPG public key from current user's account - -### Parameters - - -Name | Type | Description | Required | Notes -------------- | ------------- | ------------- | ------------- | ------------- -**id** | **i64** | id of key to delete | [required] | - -### Return type - - (empty response body) - -### Authorization - -[TOTPHeader](../README.md#TOTPHeader), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [SudoHeader](../README.md#SudoHeader), [BasicAuth](../README.md#BasicAuth), [AccessToken](../README.md#AccessToken), [SudoParam](../README.md#SudoParam), [Token](../README.md#Token) - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: application/json - -[[Back to top]](#) [[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 - -[TOTPHeader](../README.md#TOTPHeader), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [SudoHeader](../README.md#SudoHeader), [BasicAuth](../README.md#BasicAuth), [AccessToken](../README.md#AccessToken), [SudoParam](../README.md#SudoParam), [Token](../README.md#Token) - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: application/json - -[[Back to top]](#) [[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 - -[TOTPHeader](../README.md#TOTPHeader), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [SudoHeader](../README.md#SudoHeader), [BasicAuth](../README.md#BasicAuth), [AccessToken](../README.md#AccessToken), [SudoParam](../README.md#SudoParam), [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_get_gpg_key - -> 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 - -[**models::GpgKey**](GPGKey.md) - -### Authorization - -[TOTPHeader](../README.md#TOTPHeader), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [SudoHeader](../README.md#SudoHeader), [BasicAuth](../README.md#BasicAuth), [AccessToken](../README.md#AccessToken), [SudoParam](../README.md#SudoParam), [Token](../README.md#Token) - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: application/json - -[[Back to top]](#) [[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 - -> 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 - -[**models::PublicKey**](PublicKey.md) - -### Authorization - -[TOTPHeader](../README.md#TOTPHeader), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [SudoHeader](../README.md#SudoHeader), [BasicAuth](../README.md#BasicAuth), [AccessToken](../README.md#AccessToken), [SudoParam](../README.md#SudoParam), [Token](../README.md#Token) - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: application/json - -[[Back to top]](#) [[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 - -[TOTPHeader](../README.md#TOTPHeader), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [SudoHeader](../README.md#SudoHeader), [BasicAuth](../README.md#BasicAuth), [AccessToken](../README.md#AccessToken), [SudoParam](../README.md#SudoParam), [Token](../README.md#Token) - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: application/json - -[[Back to top]](#) [[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 - -[TOTPHeader](../README.md#TOTPHeader), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [SudoHeader](../README.md#SudoHeader), [BasicAuth](../README.md#BasicAuth), [AccessToken](../README.md#AccessToken), [SudoParam](../README.md#SudoParam), [Token](../README.md#Token) - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: application/json - -[[Back to top]](#) [[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 - -[TOTPHeader](../README.md#TOTPHeader), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [SudoHeader](../README.md#SudoHeader), [BasicAuth](../README.md#BasicAuth), [AccessToken](../README.md#AccessToken), [SudoParam](../README.md#SudoParam), [Token](../README.md#Token) - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: application/json - -[[Back to top]](#) [[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 - -[TOTPHeader](../README.md#TOTPHeader), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [SudoHeader](../README.md#SudoHeader), [BasicAuth](../README.md#BasicAuth), [AccessToken](../README.md#AccessToken), [SudoParam](../README.md#SudoParam), [Token](../README.md#Token) - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: application/json - -[[Back to top]](#) [[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, order_by) -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 | | -**order_by** | Option<**String**> | order the repositories | | - -### Return type - -[**Vec**](Repository.md) - -### Authorization - -[TOTPHeader](../README.md#TOTPHeader), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [SudoHeader](../README.md#SudoHeader), [BasicAuth](../README.md#BasicAuth), [AccessToken](../README.md#AccessToken), [SudoParam](../README.md#SudoParam), [Token](../README.md#Token) - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: application/json - -[[Back to top]](#) [[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 - -[TOTPHeader](../README.md#TOTPHeader), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [SudoHeader](../README.md#SudoHeader), [BasicAuth](../README.md#BasicAuth), [AccessToken](../README.md#AccessToken), [SudoParam](../README.md#SudoParam), [Token](../README.md#Token) - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: application/json - -[[Back to top]](#) [[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 - -[TOTPHeader](../README.md#TOTPHeader), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [SudoHeader](../README.md#SudoHeader), [BasicAuth](../README.md#BasicAuth), [AccessToken](../README.md#AccessToken), [SudoParam](../README.md#SudoParam), [Token](../README.md#Token) - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: application/json - -[[Back to top]](#) [[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 - -> models::GpgKey user_current_post_gpg_key(form) -Add a GPG public key to current user's account - -### Parameters - - -Name | Type | Description | Required | Notes -------------- | ------------- | ------------- | ------------- | ------------- -**form** | Option<[**CreateGpgKeyOption**](CreateGpgKeyOption.md)> | | | - -### Return type - -[**models::GpgKey**](GPGKey.md) - -### Authorization - -[TOTPHeader](../README.md#TOTPHeader), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [SudoHeader](../README.md#SudoHeader), [BasicAuth](../README.md#BasicAuth), [AccessToken](../README.md#AccessToken), [SudoParam](../README.md#SudoParam), [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 - -> models::PublicKey user_current_post_key(body) -Create a public key - -### Parameters - - -Name | Type | Description | Required | Notes -------------- | ------------- | ------------- | ------------- | ------------- -**body** | Option<[**CreateKeyOption**](CreateKeyOption.md)> | | | - -### Return type - -[**models::PublicKey**](PublicKey.md) - -### Authorization - -[TOTPHeader](../README.md#TOTPHeader), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [SudoHeader](../README.md#SudoHeader), [BasicAuth](../README.md#BasicAuth), [AccessToken](../README.md#AccessToken), [SudoParam](../README.md#SudoParam), [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 - -[TOTPHeader](../README.md#TOTPHeader), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [SudoHeader](../README.md#SudoHeader), [BasicAuth](../README.md#BasicAuth), [AccessToken](../README.md#AccessToken), [SudoParam](../README.md#SudoParam), [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_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 - -[TOTPHeader](../README.md#TOTPHeader), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [SudoHeader](../README.md#SudoHeader), [BasicAuth](../README.md#BasicAuth), [AccessToken](../README.md#AccessToken), [SudoParam](../README.md#SudoParam), [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_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 - -[TOTPHeader](../README.md#TOTPHeader), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [SudoHeader](../README.md#SudoHeader), [BasicAuth](../README.md#BasicAuth), [AccessToken](../README.md#AccessToken), [SudoParam](../README.md#SudoParam), [Token](../README.md#Token) - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: application/json - -[[Back to top]](#) [[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 from the specified user's account - -### 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 - -[TOTPHeader](../README.md#TOTPHeader), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [SudoHeader](../README.md#SudoHeader), [BasicAuth](../README.md#BasicAuth), [AccessToken](../README.md#AccessToken), [SudoParam](../README.md#SudoParam), [Token](../README.md#Token) - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: application/json - -[[Back to top]](#) [[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_avatar - -> user_delete_avatar() -Delete avatar of the current user. It will be replaced by a default one - -### Parameters - -This endpoint does not need any parameter. - -### Return type - - (empty response body) - -### Authorization - -[TOTPHeader](../README.md#TOTPHeader), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [SudoHeader](../README.md#SudoHeader), [BasicAuth](../README.md#BasicAuth), [AccessToken](../README.md#AccessToken), [SudoParam](../README.md#SudoParam), [Token](../README.md#Token) - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: application/json - -[[Back to top]](#) [[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 from the current user's account - -### Parameters - - -Name | Type | Description | Required | Notes -------------- | ------------- | ------------- | ------------- | ------------- -**body** | Option<[**DeleteEmailOption**](DeleteEmailOption.md)> | | | - -### Return type - - (empty response body) - -### Authorization - -[TOTPHeader](../README.md#TOTPHeader), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [SudoHeader](../README.md#SudoHeader), [BasicAuth](../README.md#BasicAuth), [AccessToken](../README.md#AccessToken), [SudoParam](../README.md#SudoParam), [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_delete_hook - -> user_delete_hook(id) -Delete a hook - -### Parameters - - -Name | Type | Description | Required | Notes -------------- | ------------- | ------------- | ------------- | ------------- -**id** | **i64** | id of the hook to delete | [required] | - -### Return type - - (empty response body) - -### Authorization - -[TOTPHeader](../README.md#TOTPHeader), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [SudoHeader](../README.md#SudoHeader), [BasicAuth](../README.md#BasicAuth), [AccessToken](../README.md#AccessToken), [SudoParam](../README.md#SudoParam), [Token](../README.md#Token) - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: application/json - -[[Back to top]](#) [[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 - -[TOTPHeader](../README.md#TOTPHeader), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [SudoHeader](../README.md#SudoHeader), [BasicAuth](../README.md#BasicAuth), [AccessToken](../README.md#AccessToken), [SudoParam](../README.md#SudoParam), [Token](../README.md#Token) - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: application/json - -[[Back to top]](#) [[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_edit_hook - -> models::Hook user_edit_hook(id, body) -Update a hook - -### Parameters - - -Name | Type | Description | Required | Notes -------------- | ------------- | ------------- | ------------- | ------------- -**id** | **i64** | id of the hook to update | [required] | -**body** | Option<[**EditHookOption**](EditHookOption.md)> | | | - -### Return type - -[**models::Hook**](Hook.md) - -### Authorization - -[TOTPHeader](../README.md#TOTPHeader), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [SudoHeader](../README.md#SudoHeader), [BasicAuth](../README.md#BasicAuth), [AccessToken](../README.md#AccessToken), [SudoParam](../README.md#SudoParam), [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_get - -> models::User user_get(username) -Get a user - -### Parameters - - -Name | Type | Description | Required | Notes -------------- | ------------- | ------------- | ------------- | ------------- -**username** | **String** | username of user to get | [required] | - -### Return type - -[**models::User**](User.md) - -### Authorization - -[TOTPHeader](../README.md#TOTPHeader), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [SudoHeader](../README.md#SudoHeader), [BasicAuth](../README.md#BasicAuth), [AccessToken](../README.md#AccessToken), [SudoParam](../README.md#SudoParam), [Token](../README.md#Token) - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: application/json - -[[Back to top]](#) [[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 - -> models::User user_get_current() -Get the authenticated user - -### Parameters - -This endpoint does not need any parameter. - -### Return type - -[**models::User**](User.md) - -### Authorization - -[TOTPHeader](../README.md#TOTPHeader), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [SudoHeader](../README.md#SudoHeader), [BasicAuth](../README.md#BasicAuth), [AccessToken](../README.md#AccessToken), [SudoParam](../README.md#SudoParam), [Token](../README.md#Token) - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: application/json - -[[Back to top]](#) [[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 - -[TOTPHeader](../README.md#TOTPHeader), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [SudoHeader](../README.md#SudoHeader), [BasicAuth](../README.md#BasicAuth), [AccessToken](../README.md#AccessToken), [SudoParam](../README.md#SudoParam), [Token](../README.md#Token) - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: application/json - -[[Back to top]](#) [[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_hook - -> models::Hook user_get_hook(id) -Get a hook - -### Parameters - - -Name | Type | Description | Required | Notes -------------- | ------------- | ------------- | ------------- | ------------- -**id** | **i64** | id of the hook to get | [required] | - -### Return type - -[**models::Hook**](Hook.md) - -### Authorization - -[TOTPHeader](../README.md#TOTPHeader), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [SudoHeader](../README.md#SudoHeader), [BasicAuth](../README.md#BasicAuth), [AccessToken](../README.md#AccessToken), [SudoParam](../README.md#SudoParam), [Token](../README.md#Token) - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: application/json - -[[Back to top]](#) [[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 - -> 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 - -[**models::OAuth2Application**](OAuth2Application.md) - -### Authorization - -[TOTPHeader](../README.md#TOTPHeader), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [SudoHeader](../README.md#SudoHeader), [BasicAuth](../README.md#BasicAuth), [AccessToken](../README.md#AccessToken), [SudoParam](../README.md#SudoParam), [Token](../README.md#Token) - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: application/json - -[[Back to top]](#) [[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_applications - -> Vec user_get_o_auth2_applications(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 - -[TOTPHeader](../README.md#TOTPHeader), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [SudoHeader](../README.md#SudoHeader), [BasicAuth](../README.md#BasicAuth), [AccessToken](../README.md#AccessToken), [SudoParam](../README.md#SudoParam), [Token](../README.md#Token) - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: application/json - -[[Back to top]](#) [[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_quota - -> models::QuotaInfo user_get_quota() -Get quota information for the authenticated user - -### Parameters - -This endpoint does not need any parameter. - -### Return type - -[**models::QuotaInfo**](QuotaInfo.md) - -### Authorization - -[TOTPHeader](../README.md#TOTPHeader), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [SudoHeader](../README.md#SudoHeader), [BasicAuth](../README.md#BasicAuth), [AccessToken](../README.md#AccessToken), [SudoParam](../README.md#SudoParam), [Token](../README.md#Token) - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: application/json - -[[Back to top]](#) [[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_runner_registration_token - -> models::RegistrationToken user_get_runner_registration_token() -Get an user's actions runner registration token - -### Parameters - -This endpoint does not need any parameter. - -### Return type - -[**models::RegistrationToken**](RegistrationToken.md) - -### Authorization - -[TOTPHeader](../README.md#TOTPHeader), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [SudoHeader](../README.md#SudoHeader), [BasicAuth](../README.md#BasicAuth), [AccessToken](../README.md#AccessToken), [SudoParam](../README.md#SudoParam), [Token](../README.md#Token) - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: application/json - -[[Back to top]](#) [[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 - -[TOTPHeader](../README.md#TOTPHeader), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [SudoHeader](../README.md#SudoHeader), [BasicAuth](../README.md#BasicAuth), [AccessToken](../README.md#AccessToken), [SudoParam](../README.md#SudoParam), [Token](../README.md#Token) - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: application/json - -[[Back to top]](#) [[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 specified 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 - -[TOTPHeader](../README.md#TOTPHeader), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [SudoHeader](../README.md#SudoHeader), [BasicAuth](../README.md#BasicAuth), [AccessToken](../README.md#AccessToken), [SudoParam](../README.md#SudoParam), [Token](../README.md#Token) - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: application/json - -[[Back to top]](#) [[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_activity_feeds - -> Vec user_list_activity_feeds(username, only_performed_by, date, page, limit) -List a user's activity feeds - -### Parameters - - -Name | Type | Description | Required | Notes -------------- | ------------- | ------------- | ------------- | ------------- -**username** | **String** | username of user | [required] | -**only_performed_by** | Option<**bool**> | if true, only show actions performed by the requested user | | -**date** | Option<**String**> | the date of the activities to be found | | -**page** | Option<**i32**> | page number of results to return (1-based) | | -**limit** | Option<**i32**> | page size of results | | - -### Return type - -[**Vec**](Activity.md) - -### Authorization - -[TOTPHeader](../README.md#TOTPHeader), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [SudoHeader](../README.md#SudoHeader), [BasicAuth](../README.md#BasicAuth), [AccessToken](../README.md#AccessToken), [SudoParam](../README.md#SudoParam), [Token](../README.md#Token) - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: application/json - -[[Back to top]](#) [[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_blocked_users - -> Vec user_list_blocked_users(page, limit) -List the authenticated user's blocked 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**](BlockedUser.md) - -### Authorization - -[TOTPHeader](../README.md#TOTPHeader), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [SudoHeader](../README.md#SudoHeader), [BasicAuth](../README.md#BasicAuth), [AccessToken](../README.md#AccessToken), [SudoParam](../README.md#SudoParam), [Token](../README.md#Token) - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: application/json - -[[Back to top]](#) [[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 all email addresses of the current user - -### Parameters - -This endpoint does not need any parameter. - -### Return type - -[**Vec**](Email.md) - -### Authorization - -[TOTPHeader](../README.md#TOTPHeader), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [SudoHeader](../README.md#SudoHeader), [BasicAuth](../README.md#BasicAuth), [AccessToken](../README.md#AccessToken), [SudoParam](../README.md#SudoParam), [Token](../README.md#Token) - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: application/json - -[[Back to top]](#) [[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 - -[TOTPHeader](../README.md#TOTPHeader), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [SudoHeader](../README.md#SudoHeader), [BasicAuth](../README.md#BasicAuth), [AccessToken](../README.md#AccessToken), [SudoParam](../README.md#SudoParam), [Token](../README.md#Token) - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: application/json - -[[Back to top]](#) [[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 - -[TOTPHeader](../README.md#TOTPHeader), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [SudoHeader](../README.md#SudoHeader), [BasicAuth](../README.md#BasicAuth), [AccessToken](../README.md#AccessToken), [SudoParam](../README.md#SudoParam), [Token](../README.md#Token) - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: application/json - -[[Back to top]](#) [[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 - -[TOTPHeader](../README.md#TOTPHeader), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [SudoHeader](../README.md#SudoHeader), [BasicAuth](../README.md#BasicAuth), [AccessToken](../README.md#AccessToken), [SudoParam](../README.md#SudoParam), [Token](../README.md#Token) - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: application/json - -[[Back to top]](#) [[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_hooks - -> Vec user_list_hooks(page, limit) -List the authenticated user's webhooks - -### 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**](Hook.md) - -### Authorization - -[TOTPHeader](../README.md#TOTPHeader), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [SudoHeader](../README.md#SudoHeader), [BasicAuth](../README.md#BasicAuth), [AccessToken](../README.md#AccessToken), [SudoParam](../README.md#SudoParam), [Token](../README.md#Token) - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: application/json - -[[Back to top]](#) [[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 - -[TOTPHeader](../README.md#TOTPHeader), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [SudoHeader](../README.md#SudoHeader), [BasicAuth](../README.md#BasicAuth), [AccessToken](../README.md#AccessToken), [SudoParam](../README.md#SudoParam), [Token](../README.md#Token) - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: application/json - -[[Back to top]](#) [[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_quota_artifacts - -> Vec user_list_quota_artifacts(page, limit) -List the artifacts affecting the authenticated user's quota - -### 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**](QuotaUsedArtifact.md) - -### Authorization - -[TOTPHeader](../README.md#TOTPHeader), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [SudoHeader](../README.md#SudoHeader), [BasicAuth](../README.md#BasicAuth), [AccessToken](../README.md#AccessToken), [SudoParam](../README.md#SudoParam), [Token](../README.md#Token) - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: application/json - -[[Back to top]](#) [[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_quota_attachments - -> Vec user_list_quota_attachments(page, limit) -List the attachments affecting the authenticated user's quota - -### 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**](QuotaUsedAttachment.md) - -### Authorization - -[TOTPHeader](../README.md#TOTPHeader), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [SudoHeader](../README.md#SudoHeader), [BasicAuth](../README.md#BasicAuth), [AccessToken](../README.md#AccessToken), [SudoParam](../README.md#SudoParam), [Token](../README.md#Token) - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: application/json - -[[Back to top]](#) [[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_quota_packages - -> Vec user_list_quota_packages(page, limit) -List the packages affecting the authenticated user's quota - -### 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**](QuotaUsedPackage.md) - -### Authorization - -[TOTPHeader](../README.md#TOTPHeader), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [SudoHeader](../README.md#SudoHeader), [BasicAuth](../README.md#BasicAuth), [AccessToken](../README.md#AccessToken), [SudoParam](../README.md#SudoParam), [Token](../README.md#Token) - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: application/json - -[[Back to top]](#) [[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 - -[TOTPHeader](../README.md#TOTPHeader), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [SudoHeader](../README.md#SudoHeader), [BasicAuth](../README.md#BasicAuth), [AccessToken](../README.md#AccessToken), [SudoParam](../README.md#SudoParam), [Token](../README.md#Token) - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: application/json - -[[Back to top]](#) [[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 - -[TOTPHeader](../README.md#TOTPHeader), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [SudoHeader](../README.md#SudoHeader), [BasicAuth](../README.md#BasicAuth), [AccessToken](../README.md#AccessToken), [SudoParam](../README.md#SudoParam), [Token](../README.md#Token) - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: application/json - -[[Back to top]](#) [[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 - -[TOTPHeader](../README.md#TOTPHeader), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [SudoHeader](../README.md#SudoHeader), [BasicAuth](../README.md#BasicAuth), [AccessToken](../README.md#AccessToken), [SudoParam](../README.md#SudoParam), [Token](../README.md#Token) - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: application/json - -[[Back to top]](#) [[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 - -[TOTPHeader](../README.md#TOTPHeader), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [SudoHeader](../README.md#SudoHeader), [BasicAuth](../README.md#BasicAuth), [AccessToken](../README.md#AccessToken), [SudoParam](../README.md#SudoParam), [Token](../README.md#Token) - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: application/json - -[[Back to top]](#) [[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 - -> models::UserSearchResults user_search(q, uid, sort, 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 | | -**sort** | Option<**String**> | sort order of results | | -**page** | Option<**i32**> | page number of results to return (1-based) | | -**limit** | Option<**i32**> | page size of results | | - -### Return type - -[**models::UserSearchResults**](UserSearchResults.md) - -### Authorization - -[TOTPHeader](../README.md#TOTPHeader), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [SudoHeader](../README.md#SudoHeader), [BasicAuth](../README.md#BasicAuth), [AccessToken](../README.md#AccessToken), [SudoParam](../README.md#SudoParam), [Token](../README.md#Token) - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: application/json - -[[Back to top]](#) [[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_run_jobs - -> Vec user_search_run_jobs(labels) -Search for user's action jobs according filter conditions - -### Parameters - - -Name | Type | Description | Required | Notes -------------- | ------------- | ------------- | ------------- | ------------- -**labels** | Option<**String**> | a comma separated list of run job labels to search for | | - -### Return type - -[**Vec**](ActionRunJob.md) - -### Authorization - -[TOTPHeader](../README.md#TOTPHeader), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [SudoHeader](../README.md#SudoHeader), [BasicAuth](../README.md#BasicAuth), [AccessToken](../README.md#AccessToken), [SudoParam](../README.md#SudoParam), [Token](../README.md#Token) - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: application/json - -[[Back to top]](#) [[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_unblock_user - -> user_unblock_user(username) -Unblocks a user from the doer - -### Parameters - - -Name | Type | Description | Required | Notes -------------- | ------------- | ------------- | ------------- | ------------- -**username** | **String** | username of the user | [required] | - -### Return type - - (empty response body) - -### Authorization - -[TOTPHeader](../README.md#TOTPHeader), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [SudoHeader](../README.md#SudoHeader), [BasicAuth](../README.md#BasicAuth), [AccessToken](../README.md#AccessToken), [SudoParam](../README.md#SudoParam), [Token](../README.md#Token) - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: application/json - -[[Back to top]](#) [[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_avatar - -> user_update_avatar(body) -Update avatar of the current user - -### Parameters - - -Name | Type | Description | Required | Notes -------------- | ------------- | ------------- | ------------- | ------------- -**body** | Option<[**UpdateUserAvatarOption**](UpdateUserAvatarOption.md)> | | | - -### Return type - - (empty response body) - -### Authorization - -[TOTPHeader](../README.md#TOTPHeader), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [SudoHeader](../README.md#SudoHeader), [BasicAuth](../README.md#BasicAuth), [AccessToken](../README.md#AccessToken), [SudoParam](../README.md#SudoParam), [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_update_o_auth2_application - -> 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 - -[**models::OAuth2Application**](OAuth2Application.md) - -### Authorization - -[TOTPHeader](../README.md#TOTPHeader), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [SudoHeader](../README.md#SudoHeader), [BasicAuth](../README.md#BasicAuth), [AccessToken](../README.md#AccessToken), [SudoParam](../README.md#SudoParam), [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 - -> models::GpgKey user_verify_gpg_key(body) -Verify a GPG key - -### Parameters - - -Name | Type | Description | Required | Notes -------------- | ------------- | ------------- | ------------- | ------------- -**body** | Option<[**VerifyGpgKeyOption**](VerifyGpgKeyOption.md)> | | | - -### Return type - -[**models::GpgKey**](GPGKey.md) - -### Authorization - -[TOTPHeader](../README.md#TOTPHeader), [AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken), [SudoHeader](../README.md#SudoHeader), [BasicAuth](../README.md#BasicAuth), [AccessToken](../README.md#AccessToken), [SudoParam](../README.md#SudoParam), [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) - diff --git a/docs/UserHeatmapData.md b/docs/UserHeatmapData.md deleted file mode 100644 index 8ad2caa..0000000 --- a/docs/UserHeatmapData.md +++ /dev/null @@ -1,12 +0,0 @@ -# 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/docs/UserSearchResults.md b/docs/UserSearchResults.md deleted file mode 100644 index 770d3e2..0000000 --- a/docs/UserSearchResults.md +++ /dev/null @@ -1,12 +0,0 @@ -# UserSearchResults - -## 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/docs/UserSettings.md b/docs/UserSettings.md deleted file mode 100644 index ae25b01..0000000 --- a/docs/UserSettings.md +++ /dev/null @@ -1,22 +0,0 @@ -# UserSettings - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**description** | Option<**String**> | | [optional] -**diff_view_style** | Option<**String**> | | [optional] -**enable_repo_unit_hints** | Option<**bool**> | | [optional] -**full_name** | Option<**String**> | | [optional] -**hide_activity** | Option<**bool**> | | [optional] -**hide_email** | Option<**bool**> | Privacy | [optional] -**hide_pronouns** | Option<**bool**> | | [optional] -**language** | Option<**String**> | | [optional] -**location** | Option<**String**> | | [optional] -**pronouns** | 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/docs/UserSettingsOptions.md b/docs/UserSettingsOptions.md deleted file mode 100644 index 2e4a2ef..0000000 --- a/docs/UserSettingsOptions.md +++ /dev/null @@ -1,22 +0,0 @@ -# UserSettingsOptions - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**description** | Option<**String**> | | [optional] -**diff_view_style** | Option<**String**> | | [optional] -**enable_repo_unit_hints** | Option<**bool**> | | [optional] -**full_name** | Option<**String**> | | [optional] -**hide_activity** | Option<**bool**> | | [optional] -**hide_email** | Option<**bool**> | Privacy | [optional] -**hide_pronouns** | Option<**bool**> | | [optional] -**language** | Option<**String**> | | [optional] -**location** | Option<**String**> | | [optional] -**pronouns** | 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/docs/VerifyGpgKeyOption.md b/docs/VerifyGpgKeyOption.md deleted file mode 100644 index d33d33a..0000000 --- a/docs/VerifyGpgKeyOption.md +++ /dev/null @@ -1,12 +0,0 @@ -# VerifyGpgKeyOption - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**armored_signature** | Option<**String**> | | [optional] -**key_id** | **String** | An Signature for a GPG key token | - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/docs/WatchInfo.md b/docs/WatchInfo.md deleted file mode 100644 index 988862e..0000000 --- a/docs/WatchInfo.md +++ /dev/null @@ -1,16 +0,0 @@ -# WatchInfo - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**created_at** | Option<**String**> | | [optional] -**ignored** | Option<**bool**> | | [optional] -**reason** | Option<**serde_json::Value**> | | [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/docs/WikiCommit.md b/docs/WikiCommit.md deleted file mode 100644 index ca978b8..0000000 --- a/docs/WikiCommit.md +++ /dev/null @@ -1,14 +0,0 @@ -# WikiCommit - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**author** | Option<[**models::CommitUser**](CommitUser.md)> | | [optional] -**commiter** | Option<[**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/docs/WikiCommitList.md b/docs/WikiCommitList.md deleted file mode 100644 index 409e2d9..0000000 --- a/docs/WikiCommitList.md +++ /dev/null @@ -1,12 +0,0 @@ -# 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/docs/WikiPage.md b/docs/WikiPage.md deleted file mode 100644 index 43d3296..0000000 --- a/docs/WikiPage.md +++ /dev/null @@ -1,18 +0,0 @@ -# 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<[**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/docs/WikiPageMetaData.md b/docs/WikiPageMetaData.md deleted file mode 100644 index 47c5806..0000000 --- a/docs/WikiPageMetaData.md +++ /dev/null @@ -1,14 +0,0 @@ -# WikiPageMetaData - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**html_url** | Option<**String**> | | [optional] -**last_commit** | Option<[**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/src/apis/activitypub_api.rs b/src/apis/activitypub_api.rs deleted file mode 100644 index 04785e8..0000000 --- a/src/apis/activitypub_api.rs +++ /dev/null @@ -1,1135 +0,0 @@ -/* - * Forgejo API - * - * This documentation describes the Forgejo API. - * - * The version of the OpenAPI document: 14.0.2-2-84240ce3a2+gitea-1.22.0 - * - * Generated by: https://openapi-generator.tech - */ - -use super::{configuration, ContentType, Error}; -use crate::{apis::ResponseContent, models}; -use reqwest; -use serde::{de::Error as _, Deserialize, Serialize}; - -/// struct for typed errors of method [`activitypub_instance_actor`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum ActivitypubInstanceActorError { - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`activitypub_instance_actor_inbox`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum ActivitypubInstanceActorInboxError { - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`activitypub_instance_actor_outbox`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum ActivitypubInstanceActorOutboxError { - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`activitypub_person`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum ActivitypubPersonError { - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`activitypub_person_activity`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum ActivitypubPersonActivityError { - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`activitypub_person_activity_note`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum ActivitypubPersonActivityNoteError { - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`activitypub_person_feed`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum ActivitypubPersonFeedError { - Status403(models::ApiForbiddenError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`activitypub_person_inbox`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum ActivitypubPersonInboxError { - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`activitypub_repository`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum ActivitypubRepositoryError { - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`activitypub_repository_inbox`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum ActivitypubRepositoryInboxError { - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`activitypub_repository_outbox`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum ActivitypubRepositoryOutboxError { - UnknownValue(serde_json::Value), -} - -pub async fn activitypub_instance_actor( - configuration: &configuration::Configuration, -) -> Result> { - let uri_str = format!("{}/activitypub/actor", configuration.base_path); - let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); - - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("access_token", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("sudo", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("token", value)]); - } - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("X-FORGEJO-OTP", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Authorization", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Sudo", value); - }; - if let Some(ref auth_conf) = configuration.basic_auth { - req_builder = req_builder.basic_auth(auth_conf.0.to_owned(), auth_conf.1.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::ActivityPub`"))), - ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::ActivityPub`")))), - } - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -pub async fn activitypub_instance_actor_inbox( - configuration: &configuration::Configuration, -) -> Result<(), Error> { - let uri_str = format!("{}/activitypub/actor/inbox", configuration.base_path); - let mut req_builder = configuration - .client - .request(reqwest::Method::POST, &uri_str); - - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("access_token", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("sudo", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("token", value)]); - } - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("X-FORGEJO-OTP", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Authorization", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Sudo", value); - }; - if let Some(ref auth_conf) = configuration.basic_auth { - req_builder = req_builder.basic_auth(auth_conf.0.to_owned(), auth_conf.1.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - - if !status.is_client_error() && !status.is_server_error() { - Ok(()) - } else { - let content = resp.text().await?; - let entity: Option = - serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -pub async fn activitypub_instance_actor_outbox( - configuration: &configuration::Configuration, -) -> Result> { - let uri_str = format!("{}/activitypub/actor/outbox", configuration.base_path); - let mut req_builder = configuration - .client - .request(reqwest::Method::POST, &uri_str); - - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("access_token", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("sudo", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("token", value)]); - } - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("X-FORGEJO-OTP", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Authorization", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Sudo", value); - }; - if let Some(ref auth_conf) = configuration.basic_auth { - req_builder = req_builder.basic_auth(auth_conf.0.to_owned(), auth_conf.1.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `serde_json::Value`"))), - ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `serde_json::Value`")))), - } - } else { - let content = resp.text().await?; - let entity: Option = - serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -pub async fn activitypub_person( - configuration: &configuration::Configuration, - user_id: i64, -) -> Result> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_user_id = user_id; - - let uri_str = format!( - "{}/activitypub/user-id/{user_id}", - configuration.base_path, - user_id = p_path_user_id - ); - let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); - - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("access_token", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("sudo", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("token", value)]); - } - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("X-FORGEJO-OTP", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Authorization", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Sudo", value); - }; - if let Some(ref auth_conf) = configuration.basic_auth { - req_builder = req_builder.basic_auth(auth_conf.0.to_owned(), auth_conf.1.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::ActivityPub`"))), - ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::ActivityPub`")))), - } - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -pub async fn activitypub_person_activity( - configuration: &configuration::Configuration, - user_id: i32, - activity_id: i32, -) -> Result> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_user_id = user_id; - let p_path_activity_id = activity_id; - - let uri_str = format!( - "{}/activitypub/user-id/{user_id}/activities/{activity_id}/activity", - configuration.base_path, - user_id = p_path_user_id, - activity_id = p_path_activity_id - ); - let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); - - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("access_token", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("sudo", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("token", value)]); - } - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("X-FORGEJO-OTP", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Authorization", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Sudo", value); - }; - if let Some(ref auth_conf) = configuration.basic_auth { - req_builder = req_builder.basic_auth(auth_conf.0.to_owned(), auth_conf.1.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::ActivityPub`"))), - ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::ActivityPub`")))), - } - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -pub async fn activitypub_person_activity_note( - configuration: &configuration::Configuration, - user_id: i32, - activity_id: i32, -) -> Result> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_user_id = user_id; - let p_path_activity_id = activity_id; - - let uri_str = format!( - "{}/activitypub/user-id/{user_id}/activities/{activity_id}", - configuration.base_path, - user_id = p_path_user_id, - activity_id = p_path_activity_id - ); - let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); - - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("access_token", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("sudo", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("token", value)]); - } - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("X-FORGEJO-OTP", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Authorization", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Sudo", value); - }; - if let Some(ref auth_conf) = configuration.basic_auth { - req_builder = req_builder.basic_auth(auth_conf.0.to_owned(), auth_conf.1.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::ActivityPub`"))), - ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::ActivityPub`")))), - } - } else { - let content = resp.text().await?; - let entity: Option = - serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -pub async fn activitypub_person_feed( - configuration: &configuration::Configuration, - user_id: i32, -) -> Result> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_user_id = user_id; - - let uri_str = format!( - "{}/activitypub/user-id/{user_id}/outbox", - configuration.base_path, - user_id = p_path_user_id - ); - let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); - - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("access_token", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("sudo", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("token", value)]); - } - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("X-FORGEJO-OTP", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Authorization", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Sudo", value); - }; - if let Some(ref auth_conf) = configuration.basic_auth { - req_builder = req_builder.basic_auth(auth_conf.0.to_owned(), auth_conf.1.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `serde_json::Value`"))), - ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `serde_json::Value`")))), - } - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -pub async fn activitypub_person_inbox( - configuration: &configuration::Configuration, - user_id: i64, -) -> Result<(), Error> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_user_id = user_id; - - let uri_str = format!( - "{}/activitypub/user-id/{user_id}/inbox", - configuration.base_path, - user_id = p_path_user_id - ); - let mut req_builder = configuration - .client - .request(reqwest::Method::POST, &uri_str); - - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("access_token", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("sudo", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("token", value)]); - } - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("X-FORGEJO-OTP", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Authorization", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Sudo", value); - }; - if let Some(ref auth_conf) = configuration.basic_auth { - req_builder = req_builder.basic_auth(auth_conf.0.to_owned(), auth_conf.1.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - - if !status.is_client_error() && !status.is_server_error() { - Ok(()) - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -pub async fn activitypub_repository( - configuration: &configuration::Configuration, - repository_id: i64, -) -> Result> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_repository_id = repository_id; - - let uri_str = format!( - "{}/activitypub/repository-id/{repository_id}", - configuration.base_path, - repository_id = p_path_repository_id - ); - let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); - - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("access_token", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("sudo", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("token", value)]); - } - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("X-FORGEJO-OTP", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Authorization", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Sudo", value); - }; - if let Some(ref auth_conf) = configuration.basic_auth { - req_builder = req_builder.basic_auth(auth_conf.0.to_owned(), auth_conf.1.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::ActivityPub`"))), - ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::ActivityPub`")))), - } - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -pub async fn activitypub_repository_inbox( - configuration: &configuration::Configuration, - repository_id: i64, - body: Option, -) -> Result<(), Error> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_repository_id = repository_id; - let p_body_body = body; - - let uri_str = format!( - "{}/activitypub/repository-id/{repository_id}/inbox", - configuration.base_path, - repository_id = p_path_repository_id - ); - let mut req_builder = configuration - .client - .request(reqwest::Method::POST, &uri_str); - - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("access_token", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("sudo", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("token", value)]); - } - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("X-FORGEJO-OTP", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Authorization", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Sudo", value); - }; - if let Some(ref auth_conf) = configuration.basic_auth { - req_builder = req_builder.basic_auth(auth_conf.0.to_owned(), auth_conf.1.to_owned()); - }; - req_builder = req_builder.json(&p_body_body); - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - - if !status.is_client_error() && !status.is_server_error() { - Ok(()) - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -pub async fn activitypub_repository_outbox( - configuration: &configuration::Configuration, - repository_id: i64, -) -> Result> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_repository_id = repository_id; - - let uri_str = format!( - "{}/activitypub/repository-id/{repository_id}/outbox", - configuration.base_path, - repository_id = p_path_repository_id - ); - let mut req_builder = configuration - .client - .request(reqwest::Method::POST, &uri_str); - - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("access_token", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("sudo", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("token", value)]); - } - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("X-FORGEJO-OTP", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Authorization", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Sudo", value); - }; - if let Some(ref auth_conf) = configuration.basic_auth { - req_builder = req_builder.basic_auth(auth_conf.0.to_owned(), auth_conf.1.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `serde_json::Value`"))), - ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `serde_json::Value`")))), - } - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} diff --git a/src/apis/admin_api.rs b/src/apis/admin_api.rs deleted file mode 100644 index 7910a94..0000000 --- a/src/apis/admin_api.rs +++ /dev/null @@ -1,4471 +0,0 @@ -/* - * Forgejo API - * - * This documentation describes the Forgejo API. - * - * The version of the OpenAPI document: 14.0.2-2-84240ce3a2+gitea-1.22.0 - * - * Generated by: https://openapi-generator.tech - */ - -use super::{configuration, ContentType, Error}; -use crate::{apis::ResponseContent, models}; -use reqwest; -use serde::{de::Error as _, Deserialize, Serialize}; - -/// struct for typed errors of method [`admin_add_rule_to_quota_group`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum AdminAddRuleToQuotaGroupError { - Status400(models::ApiError), - Status403(models::ApiForbiddenError), - Status404(models::ApiNotFound), - Status409(models::ApiError), - Status422(models::ApiValidationError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`admin_add_user_to_quota_group`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum AdminAddUserToQuotaGroupError { - Status400(models::ApiError), - Status403(models::ApiForbiddenError), - Status404(models::ApiNotFound), - Status409(models::ApiError), - Status422(models::ApiValidationError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`admin_adopt_repository`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum AdminAdoptRepositoryError { - Status403(models::ApiForbiddenError), - Status404(models::ApiNotFound), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`admin_create_hook`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum AdminCreateHookError { - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`admin_create_org`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum AdminCreateOrgError { - Status403(models::ApiForbiddenError), - Status422(models::ApiValidationError), - 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(models::ApiForbiddenError), - Status422(models::ApiValidationError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`admin_create_quota_group`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum AdminCreateQuotaGroupError { - Status400(models::ApiError), - Status403(models::ApiForbiddenError), - Status409(models::ApiError), - Status422(models::ApiValidationError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`admin_create_quota_rule`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum AdminCreateQuotaRuleError { - Status400(models::ApiError), - Status403(models::ApiForbiddenError), - Status409(models::ApiError), - Status422(models::ApiValidationError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`admin_create_repo`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum AdminCreateRepoError { - Status400(models::ApiError), - Status403(models::ApiForbiddenError), - Status404(models::ApiNotFound), - Status409(models::ApiError), - Status422(models::ApiValidationError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`admin_create_user`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum AdminCreateUserError { - Status400(models::ApiError), - Status403(models::ApiForbiddenError), - Status422(models::ApiValidationError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`admin_cron_list`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum AdminCronListError { - Status403(models::ApiForbiddenError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`admin_cron_run`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum AdminCronRunError { - Status404(models::ApiNotFound), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`admin_delete_hook`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum AdminDeleteHookError { - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`admin_delete_quota_group`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum AdminDeleteQuotaGroupError { - Status400(models::ApiError), - Status403(models::ApiForbiddenError), - Status404(models::ApiNotFound), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`admin_delete_quota_rule`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum AdminDeleteQuotaRuleError { - Status400(models::ApiError), - Status403(models::ApiForbiddenError), - Status404(models::ApiNotFound), - 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(models::ApiForbiddenError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`admin_delete_user`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum AdminDeleteUserError { - Status403(models::ApiForbiddenError), - Status404(models::ApiNotFound), - Status422(models::ApiValidationError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`admin_delete_user_emails`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum AdminDeleteUserEmailsError { - Status403(models::ApiForbiddenError), - Status422(models::ApiValidationError), - 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(models::ApiForbiddenError), - Status404(models::ApiNotFound), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`admin_edit_hook`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum AdminEditHookError { - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`admin_edit_quota_rule`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum AdminEditQuotaRuleError { - Status400(models::ApiError), - Status403(models::ApiForbiddenError), - Status404(models::ApiNotFound), - Status422(models::ApiValidationError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`admin_edit_user`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum AdminEditUserError { - Status400(models::ApiError), - Status403(models::ApiForbiddenError), - Status422(models::ApiValidationError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`admin_get_all_emails`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum AdminGetAllEmailsError { - Status403(models::ApiForbiddenError), - 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(models::ApiForbiddenError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`admin_get_hook`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum AdminGetHookError { - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`admin_get_quota_group`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum AdminGetQuotaGroupError { - Status400(models::ApiError), - Status403(models::ApiForbiddenError), - Status404(models::ApiNotFound), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`admin_get_quota_rule`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum AdminGetQuotaRuleError { - Status400(models::ApiError), - Status403(models::ApiForbiddenError), - Status404(models::ApiNotFound), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`admin_get_runner_registration_token`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum AdminGetRunnerRegistrationTokenError { - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`admin_get_user_quota`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum AdminGetUserQuotaError { - Status400(models::ApiError), - Status403(models::ApiForbiddenError), - Status404(models::ApiNotFound), - Status422(models::ApiValidationError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`admin_list_hooks`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum AdminListHooksError { - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`admin_list_quota_groups`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum AdminListQuotaGroupsError { - Status403(models::ApiForbiddenError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`admin_list_quota_rules`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum AdminListQuotaRulesError { - Status403(models::ApiForbiddenError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`admin_list_user_emails`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum AdminListUserEmailsError { - Status403(models::ApiForbiddenError), - Status404(models::ApiNotFound), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`admin_list_users_in_quota_group`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum AdminListUsersInQuotaGroupError { - Status400(models::ApiError), - Status403(models::ApiForbiddenError), - Status404(models::ApiNotFound), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`admin_remove_rule_from_quota_group`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum AdminRemoveRuleFromQuotaGroupError { - Status400(models::ApiError), - Status403(models::ApiForbiddenError), - Status404(models::ApiNotFound), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`admin_remove_user_from_quota_group`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum AdminRemoveUserFromQuotaGroupError { - Status400(models::ApiError), - Status403(models::ApiForbiddenError), - Status404(models::ApiNotFound), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`admin_rename_user`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum AdminRenameUserError { - Status403(models::ApiForbiddenError), - Status422(models::ApiValidationError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`admin_search_emails`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum AdminSearchEmailsError { - Status403(models::ApiForbiddenError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`admin_search_run_jobs`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum AdminSearchRunJobsError { - Status403(models::ApiForbiddenError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`admin_search_users`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum AdminSearchUsersError { - Status403(models::ApiForbiddenError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`admin_set_user_quota_groups`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum AdminSetUserQuotaGroupsError { - Status400(models::ApiError), - Status403(models::ApiForbiddenError), - Status404(models::ApiNotFound), - Status422(models::ApiValidationError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`admin_unadopted_list`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum AdminUnadoptedListError { - Status403(models::ApiForbiddenError), - UnknownValue(serde_json::Value), -} - -pub async fn admin_add_rule_to_quota_group( - configuration: &configuration::Configuration, - quotagroup: &str, - quotarule: &str, -) -> Result<(), Error> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_quotagroup = quotagroup; - let p_path_quotarule = quotarule; - - let uri_str = format!( - "{}/admin/quota/groups/{quotagroup}/rules/{quotarule}", - configuration.base_path, - quotagroup = crate::apis::urlencode(p_path_quotagroup), - quotarule = crate::apis::urlencode(p_path_quotarule) - ); - let mut req_builder = configuration.client.request(reqwest::Method::PUT, &uri_str); - - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("access_token", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("sudo", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("token", value)]); - } - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("X-FORGEJO-OTP", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Authorization", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Sudo", value); - }; - if let Some(ref auth_conf) = configuration.basic_auth { - req_builder = req_builder.basic_auth(auth_conf.0.to_owned(), auth_conf.1.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - - if !status.is_client_error() && !status.is_server_error() { - Ok(()) - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -pub async fn admin_add_user_to_quota_group( - configuration: &configuration::Configuration, - quotagroup: &str, - username: &str, -) -> Result<(), Error> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_quotagroup = quotagroup; - let p_path_username = username; - - let uri_str = format!( - "{}/admin/quota/groups/{quotagroup}/users/{username}", - configuration.base_path, - quotagroup = crate::apis::urlencode(p_path_quotagroup), - username = crate::apis::urlencode(p_path_username) - ); - let mut req_builder = configuration.client.request(reqwest::Method::PUT, &uri_str); - - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("access_token", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("sudo", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("token", value)]); - } - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("X-FORGEJO-OTP", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Authorization", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Sudo", value); - }; - if let Some(ref auth_conf) = configuration.basic_auth { - req_builder = req_builder.basic_auth(auth_conf.0.to_owned(), auth_conf.1.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - - if !status.is_client_error() && !status.is_server_error() { - Ok(()) - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -pub async fn admin_adopt_repository( - configuration: &configuration::Configuration, - owner: &str, - repo: &str, -) -> Result<(), Error> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_owner = owner; - let p_path_repo = repo; - - let uri_str = format!( - "{}/admin/unadopted/{owner}/{repo}", - configuration.base_path, - owner = crate::apis::urlencode(p_path_owner), - repo = crate::apis::urlencode(p_path_repo) - ); - let mut req_builder = configuration - .client - .request(reqwest::Method::POST, &uri_str); - - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("access_token", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("sudo", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("token", value)]); - } - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("X-FORGEJO-OTP", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Authorization", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Sudo", value); - }; - if let Some(ref auth_conf) = configuration.basic_auth { - req_builder = req_builder.basic_auth(auth_conf.0.to_owned(), auth_conf.1.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - - if !status.is_client_error() && !status.is_server_error() { - Ok(()) - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -pub async fn admin_create_hook( - configuration: &configuration::Configuration, - body: models::CreateHookOption, -) -> Result> { - // add a prefix to parameters to efficiently prevent name collisions - let p_body_body = body; - - let uri_str = format!("{}/admin/hooks", configuration.base_path); - let mut req_builder = configuration - .client - .request(reqwest::Method::POST, &uri_str); - - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("access_token", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("sudo", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("token", value)]); - } - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("X-FORGEJO-OTP", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Authorization", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Sudo", value); - }; - if let Some(ref auth_conf) = configuration.basic_auth { - req_builder = req_builder.basic_auth(auth_conf.0.to_owned(), auth_conf.1.to_owned()); - }; - req_builder = req_builder.json(&p_body_body); - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::Hook`"))), - ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::Hook`")))), - } - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -pub async fn admin_create_org( - configuration: &configuration::Configuration, - username: &str, - organization: models::CreateOrgOption, -) -> Result> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_username = username; - let p_body_organization = organization; - - let uri_str = format!( - "{}/admin/users/{username}/orgs", - configuration.base_path, - username = crate::apis::urlencode(p_path_username) - ); - let mut req_builder = configuration - .client - .request(reqwest::Method::POST, &uri_str); - - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("access_token", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("sudo", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("token", value)]); - } - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("X-FORGEJO-OTP", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Authorization", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Sudo", value); - }; - if let Some(ref auth_conf) = configuration.basic_auth { - req_builder = req_builder.basic_auth(auth_conf.0.to_owned(), auth_conf.1.to_owned()); - }; - req_builder = req_builder.json(&p_body_organization); - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::Organization`"))), - ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::Organization`")))), - } - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -pub async fn admin_create_public_key( - configuration: &configuration::Configuration, - username: &str, - key: Option, -) -> Result> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_username = username; - let p_body_key = key; - - let uri_str = format!( - "{}/admin/users/{username}/keys", - configuration.base_path, - username = crate::apis::urlencode(p_path_username) - ); - let mut req_builder = configuration - .client - .request(reqwest::Method::POST, &uri_str); - - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("access_token", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("sudo", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("token", value)]); - } - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("X-FORGEJO-OTP", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Authorization", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Sudo", value); - }; - if let Some(ref auth_conf) = configuration.basic_auth { - req_builder = req_builder.basic_auth(auth_conf.0.to_owned(), auth_conf.1.to_owned()); - }; - req_builder = req_builder.json(&p_body_key); - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::PublicKey`"))), - ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::PublicKey`")))), - } - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -pub async fn admin_create_quota_group( - configuration: &configuration::Configuration, - group: models::CreateQuotaGroupOptions, -) -> Result> { - // add a prefix to parameters to efficiently prevent name collisions - let p_body_group = group; - - let uri_str = format!("{}/admin/quota/groups", configuration.base_path); - let mut req_builder = configuration - .client - .request(reqwest::Method::POST, &uri_str); - - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("access_token", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("sudo", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("token", value)]); - } - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("X-FORGEJO-OTP", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Authorization", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Sudo", value); - }; - if let Some(ref auth_conf) = configuration.basic_auth { - req_builder = req_builder.basic_auth(auth_conf.0.to_owned(), auth_conf.1.to_owned()); - }; - req_builder = req_builder.json(&p_body_group); - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::QuotaGroup`"))), - ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::QuotaGroup`")))), - } - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -pub async fn admin_create_quota_rule( - configuration: &configuration::Configuration, - rule: models::CreateQuotaRuleOptions, -) -> Result> { - // add a prefix to parameters to efficiently prevent name collisions - let p_body_rule = rule; - - let uri_str = format!("{}/admin/quota/rules", configuration.base_path); - let mut req_builder = configuration - .client - .request(reqwest::Method::POST, &uri_str); - - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("access_token", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("sudo", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("token", value)]); - } - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("X-FORGEJO-OTP", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Authorization", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Sudo", value); - }; - if let Some(ref auth_conf) = configuration.basic_auth { - req_builder = req_builder.basic_auth(auth_conf.0.to_owned(), auth_conf.1.to_owned()); - }; - req_builder = req_builder.json(&p_body_rule); - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::QuotaRuleInfo`"))), - ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::QuotaRuleInfo`")))), - } - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -pub async fn admin_create_repo( - configuration: &configuration::Configuration, - username: &str, - repository: models::CreateRepoOption, -) -> Result> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_username = username; - let p_body_repository = repository; - - let uri_str = format!( - "{}/admin/users/{username}/repos", - configuration.base_path, - username = crate::apis::urlencode(p_path_username) - ); - let mut req_builder = configuration - .client - .request(reqwest::Method::POST, &uri_str); - - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("access_token", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("sudo", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("token", value)]); - } - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("X-FORGEJO-OTP", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Authorization", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Sudo", value); - }; - if let Some(ref auth_conf) = configuration.basic_auth { - req_builder = req_builder.basic_auth(auth_conf.0.to_owned(), auth_conf.1.to_owned()); - }; - req_builder = req_builder.json(&p_body_repository); - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::Repository`"))), - ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::Repository`")))), - } - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -pub async fn admin_create_user( - configuration: &configuration::Configuration, - body: Option, -) -> Result> { - // add a prefix to parameters to efficiently prevent name collisions - let p_body_body = body; - - let uri_str = format!("{}/admin/users", configuration.base_path); - let mut req_builder = configuration - .client - .request(reqwest::Method::POST, &uri_str); - - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("access_token", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("sudo", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("token", value)]); - } - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("X-FORGEJO-OTP", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Authorization", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Sudo", value); - }; - if let Some(ref auth_conf) = configuration.basic_auth { - req_builder = req_builder.basic_auth(auth_conf.0.to_owned(), auth_conf.1.to_owned()); - }; - req_builder = req_builder.json(&p_body_body); - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::User`"))), - ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::User`")))), - } - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -pub async fn admin_cron_list( - configuration: &configuration::Configuration, - page: Option, - limit: Option, -) -> Result, Error> { - // add a prefix to parameters to efficiently prevent name collisions - let p_query_page = page; - let p_query_limit = limit; - - let uri_str = format!("{}/admin/cron", configuration.base_path); - let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); - - if let Some(ref param_value) = p_query_page { - req_builder = req_builder.query(&[("page", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_limit { - req_builder = req_builder.query(&[("limit", ¶m_value.to_string())]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("access_token", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("sudo", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("token", value)]); - } - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("X-FORGEJO-OTP", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Authorization", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Sudo", value); - }; - if let Some(ref auth_conf) = configuration.basic_auth { - req_builder = req_builder.basic_auth(auth_conf.0.to_owned(), auth_conf.1.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `Vec<models::Cron>`"))), - ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `Vec<models::Cron>`")))), - } - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -pub async fn admin_cron_run( - configuration: &configuration::Configuration, - task: &str, -) -> Result<(), Error> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_task = task; - - let uri_str = format!( - "{}/admin/cron/{task}", - configuration.base_path, - task = crate::apis::urlencode(p_path_task) - ); - let mut req_builder = configuration - .client - .request(reqwest::Method::POST, &uri_str); - - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("access_token", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("sudo", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("token", value)]); - } - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("X-FORGEJO-OTP", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Authorization", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Sudo", value); - }; - if let Some(ref auth_conf) = configuration.basic_auth { - req_builder = req_builder.basic_auth(auth_conf.0.to_owned(), auth_conf.1.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - - if !status.is_client_error() && !status.is_server_error() { - Ok(()) - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -pub async fn admin_delete_hook( - configuration: &configuration::Configuration, - id: i64, -) -> Result<(), Error> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_id = id; - - let uri_str = format!( - "{}/admin/hooks/{id}", - configuration.base_path, - id = p_path_id - ); - let mut req_builder = configuration - .client - .request(reqwest::Method::DELETE, &uri_str); - - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("access_token", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("sudo", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("token", value)]); - } - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("X-FORGEJO-OTP", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Authorization", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Sudo", value); - }; - if let Some(ref auth_conf) = configuration.basic_auth { - req_builder = req_builder.basic_auth(auth_conf.0.to_owned(), auth_conf.1.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - - if !status.is_client_error() && !status.is_server_error() { - Ok(()) - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -pub async fn admin_delete_quota_group( - configuration: &configuration::Configuration, - quotagroup: &str, -) -> Result<(), Error> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_quotagroup = quotagroup; - - let uri_str = format!( - "{}/admin/quota/groups/{quotagroup}", - configuration.base_path, - quotagroup = crate::apis::urlencode(p_path_quotagroup) - ); - let mut req_builder = configuration - .client - .request(reqwest::Method::DELETE, &uri_str); - - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("access_token", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("sudo", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("token", value)]); - } - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("X-FORGEJO-OTP", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Authorization", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Sudo", value); - }; - if let Some(ref auth_conf) = configuration.basic_auth { - req_builder = req_builder.basic_auth(auth_conf.0.to_owned(), auth_conf.1.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - - if !status.is_client_error() && !status.is_server_error() { - Ok(()) - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -pub async fn admin_delete_quota_rule( - configuration: &configuration::Configuration, - quotarule: &str, -) -> Result<(), Error> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_quotarule = quotarule; - - let uri_str = format!( - "{}/admin/quota/rules/{quotarule}", - configuration.base_path, - quotarule = crate::apis::urlencode(p_path_quotarule) - ); - let mut req_builder = configuration - .client - .request(reqwest::Method::DELETE, &uri_str); - - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("access_token", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("sudo", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("token", value)]); - } - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("X-FORGEJO-OTP", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Authorization", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Sudo", value); - }; - if let Some(ref auth_conf) = configuration.basic_auth { - req_builder = req_builder.basic_auth(auth_conf.0.to_owned(), auth_conf.1.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - - if !status.is_client_error() && !status.is_server_error() { - Ok(()) - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -pub async fn admin_delete_unadopted_repository( - configuration: &configuration::Configuration, - owner: &str, - repo: &str, -) -> Result<(), Error> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_owner = owner; - let p_path_repo = repo; - - let uri_str = format!( - "{}/admin/unadopted/{owner}/{repo}", - configuration.base_path, - owner = crate::apis::urlencode(p_path_owner), - repo = crate::apis::urlencode(p_path_repo) - ); - let mut req_builder = configuration - .client - .request(reqwest::Method::DELETE, &uri_str); - - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("access_token", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("sudo", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("token", value)]); - } - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("X-FORGEJO-OTP", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Authorization", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Sudo", value); - }; - if let Some(ref auth_conf) = configuration.basic_auth { - req_builder = req_builder.basic_auth(auth_conf.0.to_owned(), auth_conf.1.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - - if !status.is_client_error() && !status.is_server_error() { - Ok(()) - } else { - let content = resp.text().await?; - let entity: Option = - serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -pub async fn admin_delete_user( - configuration: &configuration::Configuration, - username: &str, - purge: Option, -) -> Result<(), Error> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_username = username; - let p_query_purge = purge; - - let uri_str = format!( - "{}/admin/users/{username}", - configuration.base_path, - username = crate::apis::urlencode(p_path_username) - ); - let mut req_builder = configuration - .client - .request(reqwest::Method::DELETE, &uri_str); - - if let Some(ref param_value) = p_query_purge { - req_builder = req_builder.query(&[("purge", ¶m_value.to_string())]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("access_token", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("sudo", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("token", value)]); - } - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("X-FORGEJO-OTP", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Authorization", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Sudo", value); - }; - if let Some(ref auth_conf) = configuration.basic_auth { - req_builder = req_builder.basic_auth(auth_conf.0.to_owned(), auth_conf.1.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - - if !status.is_client_error() && !status.is_server_error() { - Ok(()) - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -pub async fn admin_delete_user_emails( - configuration: &configuration::Configuration, - username: &str, - body: Option, -) -> Result<(), Error> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_username = username; - let p_body_body = body; - - let uri_str = format!( - "{}/admin/users/{username}/emails", - configuration.base_path, - username = crate::apis::urlencode(p_path_username) - ); - let mut req_builder = configuration - .client - .request(reqwest::Method::DELETE, &uri_str); - - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("access_token", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("sudo", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("token", value)]); - } - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("X-FORGEJO-OTP", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Authorization", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Sudo", value); - }; - if let Some(ref auth_conf) = configuration.basic_auth { - req_builder = req_builder.basic_auth(auth_conf.0.to_owned(), auth_conf.1.to_owned()); - }; - req_builder = req_builder.json(&p_body_body); - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - - if !status.is_client_error() && !status.is_server_error() { - Ok(()) - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -pub async fn admin_delete_user_public_key( - configuration: &configuration::Configuration, - username: &str, - id: i64, -) -> Result<(), Error> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_username = username; - let p_path_id = id; - - let uri_str = format!( - "{}/admin/users/{username}/keys/{id}", - configuration.base_path, - username = crate::apis::urlencode(p_path_username), - id = p_path_id - ); - let mut req_builder = configuration - .client - .request(reqwest::Method::DELETE, &uri_str); - - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("access_token", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("sudo", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("token", value)]); - } - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("X-FORGEJO-OTP", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Authorization", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Sudo", value); - }; - if let Some(ref auth_conf) = configuration.basic_auth { - req_builder = req_builder.basic_auth(auth_conf.0.to_owned(), auth_conf.1.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - - if !status.is_client_error() && !status.is_server_error() { - Ok(()) - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -pub async fn admin_edit_hook( - configuration: &configuration::Configuration, - id: i64, - body: Option, -) -> Result> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_id = id; - let p_body_body = body; - - let uri_str = format!( - "{}/admin/hooks/{id}", - configuration.base_path, - id = p_path_id - ); - let mut req_builder = configuration - .client - .request(reqwest::Method::PATCH, &uri_str); - - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("access_token", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("sudo", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("token", value)]); - } - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("X-FORGEJO-OTP", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Authorization", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Sudo", value); - }; - if let Some(ref auth_conf) = configuration.basic_auth { - req_builder = req_builder.basic_auth(auth_conf.0.to_owned(), auth_conf.1.to_owned()); - }; - req_builder = req_builder.json(&p_body_body); - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::Hook`"))), - ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::Hook`")))), - } - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -pub async fn admin_edit_quota_rule( - configuration: &configuration::Configuration, - quotarule: &str, - rule: models::EditQuotaRuleOptions, -) -> Result> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_quotarule = quotarule; - let p_body_rule = rule; - - let uri_str = format!( - "{}/admin/quota/rules/{quotarule}", - configuration.base_path, - quotarule = crate::apis::urlencode(p_path_quotarule) - ); - let mut req_builder = configuration - .client - .request(reqwest::Method::PATCH, &uri_str); - - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("access_token", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("sudo", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("token", value)]); - } - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("X-FORGEJO-OTP", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Authorization", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Sudo", value); - }; - if let Some(ref auth_conf) = configuration.basic_auth { - req_builder = req_builder.basic_auth(auth_conf.0.to_owned(), auth_conf.1.to_owned()); - }; - req_builder = req_builder.json(&p_body_rule); - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::QuotaRuleInfo`"))), - ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::QuotaRuleInfo`")))), - } - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -pub async fn admin_edit_user( - configuration: &configuration::Configuration, - username: &str, - body: Option, -) -> Result> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_username = username; - let p_body_body = body; - - let uri_str = format!( - "{}/admin/users/{username}", - configuration.base_path, - username = crate::apis::urlencode(p_path_username) - ); - let mut req_builder = configuration - .client - .request(reqwest::Method::PATCH, &uri_str); - - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("access_token", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("sudo", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("token", value)]); - } - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("X-FORGEJO-OTP", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Authorization", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Sudo", value); - }; - if let Some(ref auth_conf) = configuration.basic_auth { - req_builder = req_builder.basic_auth(auth_conf.0.to_owned(), auth_conf.1.to_owned()); - }; - req_builder = req_builder.json(&p_body_body); - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::User`"))), - ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::User`")))), - } - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -pub async fn admin_get_all_emails( - configuration: &configuration::Configuration, - page: Option, - limit: Option, -) -> Result, Error> { - // add a prefix to parameters to efficiently prevent name collisions - let p_query_page = page; - let p_query_limit = limit; - - let uri_str = format!("{}/admin/emails", configuration.base_path); - let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); - - if let Some(ref param_value) = p_query_page { - req_builder = req_builder.query(&[("page", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_limit { - req_builder = req_builder.query(&[("limit", ¶m_value.to_string())]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("access_token", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("sudo", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("token", value)]); - } - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("X-FORGEJO-OTP", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Authorization", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Sudo", value); - }; - if let Some(ref auth_conf) = configuration.basic_auth { - req_builder = req_builder.basic_auth(auth_conf.0.to_owned(), auth_conf.1.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `Vec<models::Email>`"))), - ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `Vec<models::Email>`")))), - } - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -pub async fn admin_get_all_orgs( - configuration: &configuration::Configuration, - page: Option, - limit: Option, -) -> Result, Error> { - // add a prefix to parameters to efficiently prevent name collisions - let p_query_page = page; - let p_query_limit = limit; - - let uri_str = format!("{}/admin/orgs", configuration.base_path); - let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); - - if let Some(ref param_value) = p_query_page { - req_builder = req_builder.query(&[("page", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_limit { - req_builder = req_builder.query(&[("limit", ¶m_value.to_string())]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("access_token", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("sudo", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("token", value)]); - } - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("X-FORGEJO-OTP", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Authorization", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Sudo", value); - }; - if let Some(ref auth_conf) = configuration.basic_auth { - req_builder = req_builder.basic_auth(auth_conf.0.to_owned(), auth_conf.1.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `Vec<models::Organization>`"))), - ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `Vec<models::Organization>`")))), - } - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -pub async fn admin_get_hook( - configuration: &configuration::Configuration, - id: i64, -) -> Result> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_id = id; - - let uri_str = format!( - "{}/admin/hooks/{id}", - configuration.base_path, - id = p_path_id - ); - let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); - - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("access_token", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("sudo", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("token", value)]); - } - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("X-FORGEJO-OTP", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Authorization", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Sudo", value); - }; - if let Some(ref auth_conf) = configuration.basic_auth { - req_builder = req_builder.basic_auth(auth_conf.0.to_owned(), auth_conf.1.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::Hook`"))), - ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::Hook`")))), - } - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -pub async fn admin_get_quota_group( - configuration: &configuration::Configuration, - quotagroup: &str, -) -> Result> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_quotagroup = quotagroup; - - let uri_str = format!( - "{}/admin/quota/groups/{quotagroup}", - configuration.base_path, - quotagroup = crate::apis::urlencode(p_path_quotagroup) - ); - let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); - - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("access_token", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("sudo", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("token", value)]); - } - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("X-FORGEJO-OTP", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Authorization", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Sudo", value); - }; - if let Some(ref auth_conf) = configuration.basic_auth { - req_builder = req_builder.basic_auth(auth_conf.0.to_owned(), auth_conf.1.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::QuotaGroup`"))), - ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::QuotaGroup`")))), - } - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -pub async fn admin_get_quota_rule( - configuration: &configuration::Configuration, - quotarule: &str, -) -> Result> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_quotarule = quotarule; - - let uri_str = format!( - "{}/admin/quota/rules/{quotarule}", - configuration.base_path, - quotarule = crate::apis::urlencode(p_path_quotarule) - ); - let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); - - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("access_token", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("sudo", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("token", value)]); - } - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("X-FORGEJO-OTP", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Authorization", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Sudo", value); - }; - if let Some(ref auth_conf) = configuration.basic_auth { - req_builder = req_builder.basic_auth(auth_conf.0.to_owned(), auth_conf.1.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::QuotaRuleInfo`"))), - ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::QuotaRuleInfo`")))), - } - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -pub async fn admin_get_runner_registration_token( - configuration: &configuration::Configuration, -) -> Result> { - let uri_str = format!( - "{}/admin/runners/registration-token", - configuration.base_path - ); - let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); - - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("access_token", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("sudo", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("token", value)]); - } - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("X-FORGEJO-OTP", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Authorization", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Sudo", value); - }; - if let Some(ref auth_conf) = configuration.basic_auth { - req_builder = req_builder.basic_auth(auth_conf.0.to_owned(), auth_conf.1.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::RegistrationToken`"))), - ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::RegistrationToken`")))), - } - } else { - let content = resp.text().await?; - let entity: Option = - serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -pub async fn admin_get_user_quota( - configuration: &configuration::Configuration, - username: &str, -) -> Result> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_username = username; - - let uri_str = format!( - "{}/admin/users/{username}/quota", - configuration.base_path, - username = crate::apis::urlencode(p_path_username) - ); - let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); - - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("access_token", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("sudo", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("token", value)]); - } - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("X-FORGEJO-OTP", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Authorization", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Sudo", value); - }; - if let Some(ref auth_conf) = configuration.basic_auth { - req_builder = req_builder.basic_auth(auth_conf.0.to_owned(), auth_conf.1.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::QuotaInfo`"))), - ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::QuotaInfo`")))), - } - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -pub async fn admin_list_hooks( - configuration: &configuration::Configuration, - page: Option, - limit: Option, -) -> Result, Error> { - // add a prefix to parameters to efficiently prevent name collisions - let p_query_page = page; - let p_query_limit = limit; - - let uri_str = format!("{}/admin/hooks", configuration.base_path); - let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); - - if let Some(ref param_value) = p_query_page { - req_builder = req_builder.query(&[("page", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_limit { - req_builder = req_builder.query(&[("limit", ¶m_value.to_string())]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("access_token", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("sudo", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("token", value)]); - } - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("X-FORGEJO-OTP", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Authorization", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Sudo", value); - }; - if let Some(ref auth_conf) = configuration.basic_auth { - req_builder = req_builder.basic_auth(auth_conf.0.to_owned(), auth_conf.1.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `Vec<models::Hook>`"))), - ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `Vec<models::Hook>`")))), - } - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -pub async fn admin_list_quota_groups( - configuration: &configuration::Configuration, -) -> Result, Error> { - let uri_str = format!("{}/admin/quota/groups", configuration.base_path); - let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); - - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("access_token", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("sudo", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("token", value)]); - } - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("X-FORGEJO-OTP", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Authorization", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Sudo", value); - }; - if let Some(ref auth_conf) = configuration.basic_auth { - req_builder = req_builder.basic_auth(auth_conf.0.to_owned(), auth_conf.1.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `Vec<models::QuotaGroup>`"))), - ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `Vec<models::QuotaGroup>`")))), - } - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -pub async fn admin_list_quota_rules( - configuration: &configuration::Configuration, -) -> Result, Error> { - let uri_str = format!("{}/admin/quota/rules", configuration.base_path); - let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); - - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("access_token", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("sudo", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("token", value)]); - } - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("X-FORGEJO-OTP", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Authorization", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Sudo", value); - }; - if let Some(ref auth_conf) = configuration.basic_auth { - req_builder = req_builder.basic_auth(auth_conf.0.to_owned(), auth_conf.1.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `Vec<models::QuotaRuleInfo>`"))), - ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `Vec<models::QuotaRuleInfo>`")))), - } - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -pub async fn admin_list_user_emails( - configuration: &configuration::Configuration, - username: &str, -) -> Result, Error> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_username = username; - - let uri_str = format!( - "{}/admin/users/{username}/emails", - configuration.base_path, - username = crate::apis::urlencode(p_path_username) - ); - let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); - - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("access_token", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("sudo", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("token", value)]); - } - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("X-FORGEJO-OTP", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Authorization", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Sudo", value); - }; - if let Some(ref auth_conf) = configuration.basic_auth { - req_builder = req_builder.basic_auth(auth_conf.0.to_owned(), auth_conf.1.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `Vec<models::Email>`"))), - ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `Vec<models::Email>`")))), - } - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -pub async fn admin_list_users_in_quota_group( - configuration: &configuration::Configuration, - quotagroup: &str, -) -> Result, Error> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_quotagroup = quotagroup; - - let uri_str = format!( - "{}/admin/quota/groups/{quotagroup}/users", - configuration.base_path, - quotagroup = crate::apis::urlencode(p_path_quotagroup) - ); - let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); - - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("access_token", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("sudo", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("token", value)]); - } - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("X-FORGEJO-OTP", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Authorization", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Sudo", value); - }; - if let Some(ref auth_conf) = configuration.basic_auth { - req_builder = req_builder.basic_auth(auth_conf.0.to_owned(), auth_conf.1.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `Vec<models::User>`"))), - ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `Vec<models::User>`")))), - } - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -pub async fn admin_remove_rule_from_quota_group( - configuration: &configuration::Configuration, - quotagroup: &str, - quotarule: &str, -) -> Result<(), Error> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_quotagroup = quotagroup; - let p_path_quotarule = quotarule; - - let uri_str = format!( - "{}/admin/quota/groups/{quotagroup}/rules/{quotarule}", - configuration.base_path, - quotagroup = crate::apis::urlencode(p_path_quotagroup), - quotarule = crate::apis::urlencode(p_path_quotarule) - ); - let mut req_builder = configuration - .client - .request(reqwest::Method::DELETE, &uri_str); - - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("access_token", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("sudo", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("token", value)]); - } - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("X-FORGEJO-OTP", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Authorization", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Sudo", value); - }; - if let Some(ref auth_conf) = configuration.basic_auth { - req_builder = req_builder.basic_auth(auth_conf.0.to_owned(), auth_conf.1.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - - if !status.is_client_error() && !status.is_server_error() { - Ok(()) - } else { - let content = resp.text().await?; - let entity: Option = - serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -pub async fn admin_remove_user_from_quota_group( - configuration: &configuration::Configuration, - quotagroup: &str, - username: &str, -) -> Result<(), Error> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_quotagroup = quotagroup; - let p_path_username = username; - - let uri_str = format!( - "{}/admin/quota/groups/{quotagroup}/users/{username}", - configuration.base_path, - quotagroup = crate::apis::urlencode(p_path_quotagroup), - username = crate::apis::urlencode(p_path_username) - ); - let mut req_builder = configuration - .client - .request(reqwest::Method::DELETE, &uri_str); - - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("access_token", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("sudo", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("token", value)]); - } - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("X-FORGEJO-OTP", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Authorization", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Sudo", value); - }; - if let Some(ref auth_conf) = configuration.basic_auth { - req_builder = req_builder.basic_auth(auth_conf.0.to_owned(), auth_conf.1.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - - if !status.is_client_error() && !status.is_server_error() { - Ok(()) - } else { - let content = resp.text().await?; - let entity: Option = - serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -pub async fn admin_rename_user( - configuration: &configuration::Configuration, - username: &str, - body: models::RenameUserOption, -) -> Result<(), Error> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_username = username; - let p_body_body = body; - - let uri_str = format!( - "{}/admin/users/{username}/rename", - configuration.base_path, - username = crate::apis::urlencode(p_path_username) - ); - let mut req_builder = configuration - .client - .request(reqwest::Method::POST, &uri_str); - - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("access_token", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("sudo", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("token", value)]); - } - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("X-FORGEJO-OTP", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Authorization", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Sudo", value); - }; - if let Some(ref auth_conf) = configuration.basic_auth { - req_builder = req_builder.basic_auth(auth_conf.0.to_owned(), auth_conf.1.to_owned()); - }; - req_builder = req_builder.json(&p_body_body); - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - - if !status.is_client_error() && !status.is_server_error() { - Ok(()) - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -pub async fn admin_search_emails( - configuration: &configuration::Configuration, - q: Option<&str>, - page: Option, - limit: Option, -) -> Result, Error> { - // add a prefix to parameters to efficiently prevent name collisions - let p_query_q = q; - let p_query_page = page; - let p_query_limit = limit; - - let uri_str = format!("{}/admin/emails/search", configuration.base_path); - let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); - - if let Some(ref param_value) = p_query_q { - req_builder = req_builder.query(&[("q", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_page { - req_builder = req_builder.query(&[("page", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_limit { - req_builder = req_builder.query(&[("limit", ¶m_value.to_string())]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("access_token", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("sudo", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("token", value)]); - } - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("X-FORGEJO-OTP", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Authorization", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Sudo", value); - }; - if let Some(ref auth_conf) = configuration.basic_auth { - req_builder = req_builder.basic_auth(auth_conf.0.to_owned(), auth_conf.1.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `Vec<models::Email>`"))), - ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `Vec<models::Email>`")))), - } - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -pub async fn admin_search_run_jobs( - configuration: &configuration::Configuration, - labels: Option<&str>, -) -> Result, Error> { - // add a prefix to parameters to efficiently prevent name collisions - let p_query_labels = labels; - - let uri_str = format!("{}/admin/runners/jobs", configuration.base_path); - let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); - - if let Some(ref param_value) = p_query_labels { - req_builder = req_builder.query(&[("labels", ¶m_value.to_string())]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("access_token", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("sudo", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("token", value)]); - } - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("X-FORGEJO-OTP", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Authorization", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Sudo", value); - }; - if let Some(ref auth_conf) = configuration.basic_auth { - req_builder = req_builder.basic_auth(auth_conf.0.to_owned(), auth_conf.1.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `Vec<models::ActionRunJob>`"))), - ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `Vec<models::ActionRunJob>`")))), - } - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -pub async fn admin_search_users( - configuration: &configuration::Configuration, - source_id: Option, - login_name: Option<&str>, - sort: Option<&str>, - page: Option, - limit: Option, -) -> Result, Error> { - // add a prefix to parameters to efficiently prevent name collisions - let p_query_source_id = source_id; - let p_query_login_name = login_name; - let p_query_sort = sort; - let p_query_page = page; - let p_query_limit = limit; - - let uri_str = format!("{}/admin/users", configuration.base_path); - let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); - - if let Some(ref param_value) = p_query_source_id { - req_builder = req_builder.query(&[("source_id", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_login_name { - req_builder = req_builder.query(&[("login_name", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_sort { - req_builder = req_builder.query(&[("sort", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_page { - req_builder = req_builder.query(&[("page", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_limit { - req_builder = req_builder.query(&[("limit", ¶m_value.to_string())]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("access_token", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("sudo", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("token", value)]); - } - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("X-FORGEJO-OTP", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Authorization", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Sudo", value); - }; - if let Some(ref auth_conf) = configuration.basic_auth { - req_builder = req_builder.basic_auth(auth_conf.0.to_owned(), auth_conf.1.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `Vec<models::User>`"))), - ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `Vec<models::User>`")))), - } - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -pub async fn admin_set_user_quota_groups( - configuration: &configuration::Configuration, - username: &str, - groups: models::SetUserQuotaGroupsOptions, -) -> Result<(), Error> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_username = username; - let p_body_groups = groups; - - let uri_str = format!( - "{}/admin/users/{username}/quota/groups", - configuration.base_path, - username = crate::apis::urlencode(p_path_username) - ); - let mut req_builder = configuration - .client - .request(reqwest::Method::POST, &uri_str); - - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("access_token", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("sudo", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("token", value)]); - } - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("X-FORGEJO-OTP", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Authorization", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Sudo", value); - }; - if let Some(ref auth_conf) = configuration.basic_auth { - req_builder = req_builder.basic_auth(auth_conf.0.to_owned(), auth_conf.1.to_owned()); - }; - req_builder = req_builder.json(&p_body_groups); - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - - if !status.is_client_error() && !status.is_server_error() { - Ok(()) - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -pub async fn admin_unadopted_list( - configuration: &configuration::Configuration, - page: Option, - limit: Option, - pattern: Option<&str>, -) -> Result, Error> { - // add a prefix to parameters to efficiently prevent name collisions - let p_query_page = page; - let p_query_limit = limit; - let p_query_pattern = pattern; - - let uri_str = format!("{}/admin/unadopted", configuration.base_path); - let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); - - if let Some(ref param_value) = p_query_page { - req_builder = req_builder.query(&[("page", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_limit { - req_builder = req_builder.query(&[("limit", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_pattern { - req_builder = req_builder.query(&[("pattern", ¶m_value.to_string())]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("access_token", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("sudo", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("token", value)]); - } - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("X-FORGEJO-OTP", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Authorization", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Sudo", value); - }; - if let Some(ref auth_conf) = configuration.basic_auth { - req_builder = req_builder.basic_auth(auth_conf.0.to_owned(), auth_conf.1.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `Vec<String>`"))), - ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `Vec<String>`")))), - } - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} diff --git a/src/apis/configuration.rs b/src/apis/configuration.rs deleted file mode 100644 index cfbfc9d..0000000 --- a/src/apis/configuration.rs +++ /dev/null @@ -1,48 +0,0 @@ -/* - * Forgejo API - * - * This documentation describes the Forgejo API. - * - * The version of the OpenAPI document: 14.0.2-2-84240ce3a2+gitea-1.22.0 - * - * 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, -} - -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/14.0.2-2-84240ce3a2+gitea-1.22.0/rust".to_owned()), - client: reqwest::Client::new(), - basic_auth: None, - oauth_access_token: None, - bearer_access_token: None, - api_key: None, - } - } -} diff --git a/src/apis/issue_api.rs b/src/apis/issue_api.rs deleted file mode 100644 index 056f380..0000000 --- a/src/apis/issue_api.rs +++ /dev/null @@ -1,7883 +0,0 @@ -/* - * Forgejo API - * - * This documentation describes the Forgejo API. - * - * The version of the OpenAPI document: 14.0.2-2-84240ce3a2+gitea-1.22.0 - * - * Generated by: https://openapi-generator.tech - */ - -use super::{configuration, ContentType, Error}; -use crate::{apis::ResponseContent, models}; -use reqwest; -use serde::{de::Error as _, Deserialize, Serialize}; -use tokio::fs::File as TokioFile; -use tokio_util::codec::{BytesCodec, FramedRead}; - -/// struct for typed errors of method [`issue_add_label`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum IssueAddLabelError { - Status403(models::ApiForbiddenError), - Status404(models::ApiNotFound), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`issue_add_subscription`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum IssueAddSubscriptionError { - Status404(models::ApiNotFound), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`issue_add_time`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum IssueAddTimeError { - Status400(models::ApiError), - Status403(models::ApiForbiddenError), - Status404(models::ApiNotFound), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`issue_check_subscription`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum IssueCheckSubscriptionError { - Status404(models::ApiNotFound), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`issue_clear_labels`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum IssueClearLabelsError { - Status403(models::ApiForbiddenError), - Status404(models::ApiNotFound), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`issue_create_comment`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum IssueCreateCommentError { - Status403(models::ApiForbiddenError), - Status404(models::ApiNotFound), - Status423(models::ApiRepoArchivedError), - Status500(models::ApiInternalServerError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`issue_create_issue`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum IssueCreateIssueError { - Status403(models::ApiForbiddenError), - Status404(models::ApiNotFound), - Status412(models::ApiError), - Status422(models::ApiValidationError), - Status423(models::ApiRepoArchivedError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`issue_create_issue_attachment`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum IssueCreateIssueAttachmentError { - Status400(models::ApiError), - Status404(models::ApiError), - Status413(), - Status422(models::ApiValidationError), - Status423(models::ApiRepoArchivedError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`issue_create_issue_blocking`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum IssueCreateIssueBlockingError { - Status404(), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`issue_create_issue_comment_attachment`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum IssueCreateIssueCommentAttachmentError { - Status400(models::ApiError), - Status404(models::ApiError), - Status413(), - Status422(models::ApiValidationError), - Status423(models::ApiRepoArchivedError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`issue_create_issue_dependencies`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum IssueCreateIssueDependenciesError { - Status404(), - Status423(models::ApiRepoArchivedError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`issue_create_label`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum IssueCreateLabelError { - Status404(models::ApiNotFound), - Status422(models::ApiValidationError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`issue_create_milestone`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum IssueCreateMilestoneError { - Status404(models::ApiNotFound), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`issue_delete`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum IssueDeleteError { - Status403(models::ApiForbiddenError), - Status404(models::ApiNotFound), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`issue_delete_comment`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum IssueDeleteCommentError { - Status403(models::ApiForbiddenError), - Status500(models::ApiInternalServerError), - 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(models::ApiForbiddenError), - Status500(models::ApiInternalServerError), - 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(models::ApiForbiddenError), - Status404(models::ApiNotFound), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`issue_delete_issue_attachment`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum IssueDeleteIssueAttachmentError { - Status404(models::ApiError), - Status423(models::ApiRepoArchivedError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`issue_delete_issue_comment_attachment`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum IssueDeleteIssueCommentAttachmentError { - Status404(models::ApiError), - Status423(models::ApiRepoArchivedError), - 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(models::ApiForbiddenError), - Status404(models::ApiNotFound), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`issue_delete_label`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum IssueDeleteLabelError { - Status404(models::ApiNotFound), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`issue_delete_milestone`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum IssueDeleteMilestoneError { - Status404(models::ApiNotFound), - 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(models::ApiNotFound), - 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(models::ApiNotFound), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`issue_delete_time`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum IssueDeleteTimeError { - Status400(models::ApiError), - Status403(models::ApiForbiddenError), - Status404(models::ApiNotFound), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`issue_edit_comment`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum IssueEditCommentError { - Status403(models::ApiForbiddenError), - Status404(models::ApiNotFound), - Status423(models::ApiRepoArchivedError), - Status500(models::ApiInternalServerError), - 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(models::ApiForbiddenError), - Status404(models::ApiNotFound), - Status500(models::ApiInternalServerError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`issue_edit_issue`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum IssueEditIssueError { - Status403(models::ApiForbiddenError), - Status404(models::ApiNotFound), - Status412(models::ApiError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`issue_edit_issue_attachment`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum IssueEditIssueAttachmentError { - Status404(models::ApiError), - Status413(), - Status423(models::ApiRepoArchivedError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`issue_edit_issue_comment_attachment`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum IssueEditIssueCommentAttachmentError { - Status404(models::ApiError), - Status413(), - Status423(models::ApiRepoArchivedError), - 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(models::ApiForbiddenError), - Status404(models::ApiNotFound), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`issue_edit_label`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum IssueEditLabelError { - Status404(models::ApiNotFound), - Status422(models::ApiValidationError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`issue_edit_milestone`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum IssueEditMilestoneError { - Status404(models::ApiNotFound), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`issue_get_comment`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum IssueGetCommentError { - Status403(models::ApiForbiddenError), - Status404(models::ApiNotFound), - Status500(models::ApiInternalServerError), - 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(models::ApiForbiddenError), - Status404(models::ApiNotFound), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`issue_get_comments`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum IssueGetCommentsError { - Status404(models::ApiNotFound), - Status422(models::ApiValidationError), - Status500(models::ApiInternalServerError), - 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 { - Status404(models::ApiNotFound), - Status422(models::ApiValidationError), - Status500(models::ApiInternalServerError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`issue_get_issue`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum IssueGetIssueError { - Status404(models::ApiNotFound), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`issue_get_issue_attachment`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum IssueGetIssueAttachmentError { - Status404(models::ApiError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`issue_get_issue_comment_attachment`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum IssueGetIssueCommentAttachmentError { - Status404(models::ApiError), - 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(models::ApiForbiddenError), - Status404(models::ApiNotFound), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`issue_get_label`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum IssueGetLabelError { - Status404(models::ApiNotFound), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`issue_get_labels`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum IssueGetLabelsError { - Status404(models::ApiNotFound), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`issue_get_milestone`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum IssueGetMilestoneError { - Status404(models::ApiNotFound), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`issue_get_milestones_list`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum IssueGetMilestonesListError { - Status404(models::ApiNotFound), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`issue_get_repo_comments`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum IssueGetRepoCommentsError { - Status404(models::ApiNotFound), - Status422(models::ApiValidationError), - Status500(models::ApiInternalServerError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`issue_list_blocks`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum IssueListBlocksError { - Status404(models::ApiNotFound), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`issue_list_issue_attachments`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum IssueListIssueAttachmentsError { - Status404(models::ApiError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`issue_list_issue_comment_attachments`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum IssueListIssueCommentAttachmentsError { - Status404(models::ApiError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`issue_list_issue_dependencies`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum IssueListIssueDependenciesError { - Status404(models::ApiNotFound), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`issue_list_issues`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum IssueListIssuesError { - Status404(models::ApiNotFound), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`issue_list_labels`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum IssueListLabelsError { - Status404(models::ApiNotFound), - 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(models::ApiForbiddenError), - Status404(models::ApiNotFound), - 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(models::ApiForbiddenError), - Status404(models::ApiNotFound), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`issue_remove_issue_blocking`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum IssueRemoveIssueBlockingError { - Status404(models::ApiNotFound), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`issue_remove_issue_dependencies`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum IssueRemoveIssueDependenciesError { - Status404(models::ApiNotFound), - Status423(models::ApiRepoArchivedError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`issue_remove_label`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum IssueRemoveLabelError { - Status403(models::ApiForbiddenError), - Status404(models::ApiNotFound), - Status422(models::ApiValidationError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`issue_replace_labels`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum IssueReplaceLabelsError { - Status403(models::ApiForbiddenError), - Status404(models::ApiNotFound), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`issue_reset_time`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum IssueResetTimeError { - Status400(models::ApiError), - Status403(models::ApiForbiddenError), - Status404(models::ApiNotFound), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`issue_search_issues`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum IssueSearchIssuesError { - Status400(models::ApiError), - Status422(models::ApiValidationError), - 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(models::ApiNotFound), - 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(models::ApiNotFound), - Status409(), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`issue_subscriptions`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum IssueSubscriptionsError { - Status404(models::ApiNotFound), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`issue_tracked_times`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum IssueTrackedTimesError { - Status404(models::ApiNotFound), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`move_issue_pin`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum MoveIssuePinError { - Status403(models::ApiForbiddenError), - Status404(models::ApiNotFound), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`pin_issue`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum PinIssueError { - Status403(models::ApiForbiddenError), - Status404(models::ApiNotFound), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`unpin_issue`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum UnpinIssueError { - Status403(models::ApiForbiddenError), - Status404(models::ApiNotFound), - UnknownValue(serde_json::Value), -} - -pub async fn issue_add_label( - configuration: &configuration::Configuration, - owner: &str, - repo: &str, - index: i64, - body: Option, -) -> Result, Error> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_owner = owner; - let p_path_repo = repo; - let p_path_index = index; - let p_body_body = body; - - let uri_str = format!( - "{}/repos/{owner}/{repo}/issues/{index}/labels", - configuration.base_path, - owner = crate::apis::urlencode(p_path_owner), - repo = crate::apis::urlencode(p_path_repo), - index = p_path_index - ); - let mut req_builder = configuration - .client - .request(reqwest::Method::POST, &uri_str); - - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("access_token", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("sudo", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("token", value)]); - } - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("X-FORGEJO-OTP", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Authorization", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Sudo", value); - }; - if let Some(ref auth_conf) = configuration.basic_auth { - req_builder = req_builder.basic_auth(auth_conf.0.to_owned(), auth_conf.1.to_owned()); - }; - req_builder = req_builder.json(&p_body_body); - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `Vec<models::Label>`"))), - ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `Vec<models::Label>`")))), - } - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -pub async fn issue_add_subscription( - configuration: &configuration::Configuration, - owner: &str, - repo: &str, - index: i64, - user: &str, -) -> Result<(), Error> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_owner = owner; - let p_path_repo = repo; - let p_path_index = index; - let p_path_user = user; - - let uri_str = format!( - "{}/repos/{owner}/{repo}/issues/{index}/subscriptions/{user}", - configuration.base_path, - owner = crate::apis::urlencode(p_path_owner), - repo = crate::apis::urlencode(p_path_repo), - index = p_path_index, - user = crate::apis::urlencode(p_path_user) - ); - let mut req_builder = configuration.client.request(reqwest::Method::PUT, &uri_str); - - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("access_token", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("sudo", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("token", value)]); - } - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("X-FORGEJO-OTP", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Authorization", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Sudo", value); - }; - if let Some(ref auth_conf) = configuration.basic_auth { - req_builder = req_builder.basic_auth(auth_conf.0.to_owned(), auth_conf.1.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - - if !status.is_client_error() && !status.is_server_error() { - Ok(()) - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -pub async fn issue_add_time( - configuration: &configuration::Configuration, - owner: &str, - repo: &str, - index: i64, - body: Option, -) -> Result> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_owner = owner; - let p_path_repo = repo; - let p_path_index = index; - let p_body_body = body; - - let uri_str = format!( - "{}/repos/{owner}/{repo}/issues/{index}/times", - configuration.base_path, - owner = crate::apis::urlencode(p_path_owner), - repo = crate::apis::urlencode(p_path_repo), - index = p_path_index - ); - let mut req_builder = configuration - .client - .request(reqwest::Method::POST, &uri_str); - - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("access_token", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("sudo", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("token", value)]); - } - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("X-FORGEJO-OTP", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Authorization", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Sudo", value); - }; - if let Some(ref auth_conf) = configuration.basic_auth { - req_builder = req_builder.basic_auth(auth_conf.0.to_owned(), auth_conf.1.to_owned()); - }; - req_builder = req_builder.json(&p_body_body); - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::TrackedTime`"))), - ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::TrackedTime`")))), - } - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -pub async fn issue_check_subscription( - configuration: &configuration::Configuration, - owner: &str, - repo: &str, - index: i64, -) -> Result> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_owner = owner; - let p_path_repo = repo; - let p_path_index = index; - - let uri_str = format!( - "{}/repos/{owner}/{repo}/issues/{index}/subscriptions/check", - configuration.base_path, - owner = crate::apis::urlencode(p_path_owner), - repo = crate::apis::urlencode(p_path_repo), - index = p_path_index - ); - let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); - - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("access_token", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("sudo", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("token", value)]); - } - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("X-FORGEJO-OTP", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Authorization", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Sudo", value); - }; - if let Some(ref auth_conf) = configuration.basic_auth { - req_builder = req_builder.basic_auth(auth_conf.0.to_owned(), auth_conf.1.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::WatchInfo`"))), - ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::WatchInfo`")))), - } - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -pub async fn issue_clear_labels( - configuration: &configuration::Configuration, - owner: &str, - repo: &str, - index: i64, - body: Option, -) -> Result<(), Error> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_owner = owner; - let p_path_repo = repo; - let p_path_index = index; - let p_body_body = body; - - let uri_str = format!( - "{}/repos/{owner}/{repo}/issues/{index}/labels", - configuration.base_path, - owner = crate::apis::urlencode(p_path_owner), - repo = crate::apis::urlencode(p_path_repo), - index = p_path_index - ); - let mut req_builder = configuration - .client - .request(reqwest::Method::DELETE, &uri_str); - - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("access_token", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("sudo", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("token", value)]); - } - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("X-FORGEJO-OTP", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Authorization", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Sudo", value); - }; - if let Some(ref auth_conf) = configuration.basic_auth { - req_builder = req_builder.basic_auth(auth_conf.0.to_owned(), auth_conf.1.to_owned()); - }; - req_builder = req_builder.json(&p_body_body); - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - - if !status.is_client_error() && !status.is_server_error() { - Ok(()) - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -pub async fn issue_create_comment( - configuration: &configuration::Configuration, - owner: &str, - repo: &str, - index: i64, - body: Option, -) -> Result> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_owner = owner; - let p_path_repo = repo; - let p_path_index = index; - let p_body_body = body; - - let uri_str = format!( - "{}/repos/{owner}/{repo}/issues/{index}/comments", - configuration.base_path, - owner = crate::apis::urlencode(p_path_owner), - repo = crate::apis::urlencode(p_path_repo), - index = p_path_index - ); - let mut req_builder = configuration - .client - .request(reqwest::Method::POST, &uri_str); - - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("access_token", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("sudo", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("token", value)]); - } - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("X-FORGEJO-OTP", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Authorization", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Sudo", value); - }; - if let Some(ref auth_conf) = configuration.basic_auth { - req_builder = req_builder.basic_auth(auth_conf.0.to_owned(), auth_conf.1.to_owned()); - }; - req_builder = req_builder.json(&p_body_body); - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::Comment`"))), - ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::Comment`")))), - } - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -pub async fn issue_create_issue( - configuration: &configuration::Configuration, - owner: &str, - repo: &str, - body: Option, -) -> Result> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_owner = owner; - let p_path_repo = repo; - let p_body_body = body; - - let uri_str = format!( - "{}/repos/{owner}/{repo}/issues", - configuration.base_path, - owner = crate::apis::urlencode(p_path_owner), - repo = crate::apis::urlencode(p_path_repo) - ); - let mut req_builder = configuration - .client - .request(reqwest::Method::POST, &uri_str); - - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("access_token", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("sudo", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("token", value)]); - } - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("X-FORGEJO-OTP", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Authorization", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Sudo", value); - }; - if let Some(ref auth_conf) = configuration.basic_auth { - req_builder = req_builder.basic_auth(auth_conf.0.to_owned(), auth_conf.1.to_owned()); - }; - req_builder = req_builder.json(&p_body_body); - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::Issue`"))), - ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::Issue`")))), - } - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -pub async fn issue_create_issue_attachment( - configuration: &configuration::Configuration, - owner: &str, - repo: &str, - index: i64, - attachment: std::path::PathBuf, - name: Option<&str>, - updated_at: Option, -) -> Result> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_owner = owner; - let p_path_repo = repo; - let p_path_index = index; - let p_form_attachment = attachment; - let p_query_name = name; - let p_query_updated_at = updated_at; - - let uri_str = format!( - "{}/repos/{owner}/{repo}/issues/{index}/assets", - configuration.base_path, - owner = crate::apis::urlencode(p_path_owner), - repo = crate::apis::urlencode(p_path_repo), - index = p_path_index - ); - let mut req_builder = configuration - .client - .request(reqwest::Method::POST, &uri_str); - - if let Some(ref param_value) = p_query_name { - req_builder = req_builder.query(&[("name", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_updated_at { - req_builder = req_builder.query(&[("updated_at", ¶m_value.to_string())]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("access_token", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("sudo", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("token", value)]); - } - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("X-FORGEJO-OTP", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Authorization", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Sudo", value); - }; - if let Some(ref auth_conf) = configuration.basic_auth { - req_builder = req_builder.basic_auth(auth_conf.0.to_owned(), auth_conf.1.to_owned()); - }; - let mut multipart_form = reqwest::multipart::Form::new(); - let file = TokioFile::open(&p_form_attachment).await?; - let stream = FramedRead::new(file, BytesCodec::new()); - let file_name = p_form_attachment - .file_name() - .map(|n| n.to_string_lossy().to_string()) - .unwrap_or_default(); - let file_part = - reqwest::multipart::Part::stream(reqwest::Body::wrap_stream(stream)).file_name(file_name); - multipart_form = multipart_form.part("attachment", file_part); - req_builder = req_builder.multipart(multipart_form); - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::Attachment`"))), - ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::Attachment`")))), - } - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -pub async fn issue_create_issue_blocking( - configuration: &configuration::Configuration, - owner: &str, - repo: &str, - index: i64, - body: Option, -) -> Result> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_owner = owner; - let p_path_repo = repo; - let p_path_index = index; - let p_body_body = body; - - let uri_str = format!( - "{}/repos/{owner}/{repo}/issues/{index}/blocks", - configuration.base_path, - owner = crate::apis::urlencode(p_path_owner), - repo = crate::apis::urlencode(p_path_repo), - index = p_path_index - ); - let mut req_builder = configuration - .client - .request(reqwest::Method::POST, &uri_str); - - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("access_token", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("sudo", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("token", value)]); - } - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("X-FORGEJO-OTP", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Authorization", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Sudo", value); - }; - if let Some(ref auth_conf) = configuration.basic_auth { - req_builder = req_builder.basic_auth(auth_conf.0.to_owned(), auth_conf.1.to_owned()); - }; - req_builder = req_builder.json(&p_body_body); - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::Issue`"))), - ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::Issue`")))), - } - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -pub async fn issue_create_issue_comment_attachment( - configuration: &configuration::Configuration, - owner: &str, - repo: &str, - id: i64, - attachment: std::path::PathBuf, - name: Option<&str>, - updated_at: Option, -) -> Result> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_owner = owner; - let p_path_repo = repo; - let p_path_id = id; - let p_form_attachment = attachment; - let p_query_name = name; - let p_query_updated_at = updated_at; - - let uri_str = format!( - "{}/repos/{owner}/{repo}/issues/comments/{id}/assets", - configuration.base_path, - owner = crate::apis::urlencode(p_path_owner), - repo = crate::apis::urlencode(p_path_repo), - id = p_path_id - ); - let mut req_builder = configuration - .client - .request(reqwest::Method::POST, &uri_str); - - if let Some(ref param_value) = p_query_name { - req_builder = req_builder.query(&[("name", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_updated_at { - req_builder = req_builder.query(&[("updated_at", ¶m_value.to_string())]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("access_token", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("sudo", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("token", value)]); - } - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("X-FORGEJO-OTP", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Authorization", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Sudo", value); - }; - if let Some(ref auth_conf) = configuration.basic_auth { - req_builder = req_builder.basic_auth(auth_conf.0.to_owned(), auth_conf.1.to_owned()); - }; - let mut multipart_form = reqwest::multipart::Form::new(); - let file = TokioFile::open(&p_form_attachment).await?; - let stream = FramedRead::new(file, BytesCodec::new()); - let file_name = p_form_attachment - .file_name() - .map(|n| n.to_string_lossy().to_string()) - .unwrap_or_default(); - let file_part = - reqwest::multipart::Part::stream(reqwest::Body::wrap_stream(stream)).file_name(file_name); - multipart_form = multipart_form.part("attachment", file_part); - req_builder = req_builder.multipart(multipart_form); - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::Attachment`"))), - ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::Attachment`")))), - } - } else { - let content = resp.text().await?; - let entity: Option = - serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -pub async fn issue_create_issue_dependencies( - configuration: &configuration::Configuration, - owner: &str, - repo: &str, - index: i64, - body: Option, -) -> Result> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_owner = owner; - let p_path_repo = repo; - let p_path_index = index; - let p_body_body = body; - - let uri_str = format!( - "{}/repos/{owner}/{repo}/issues/{index}/dependencies", - configuration.base_path, - owner = crate::apis::urlencode(p_path_owner), - repo = crate::apis::urlencode(p_path_repo), - index = p_path_index - ); - let mut req_builder = configuration - .client - .request(reqwest::Method::POST, &uri_str); - - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("access_token", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("sudo", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("token", value)]); - } - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("X-FORGEJO-OTP", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Authorization", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Sudo", value); - }; - if let Some(ref auth_conf) = configuration.basic_auth { - req_builder = req_builder.basic_auth(auth_conf.0.to_owned(), auth_conf.1.to_owned()); - }; - req_builder = req_builder.json(&p_body_body); - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::Issue`"))), - ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::Issue`")))), - } - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -pub async fn issue_create_label( - configuration: &configuration::Configuration, - owner: &str, - repo: &str, - body: Option, -) -> Result> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_owner = owner; - let p_path_repo = repo; - let p_body_body = body; - - let uri_str = format!( - "{}/repos/{owner}/{repo}/labels", - configuration.base_path, - owner = crate::apis::urlencode(p_path_owner), - repo = crate::apis::urlencode(p_path_repo) - ); - let mut req_builder = configuration - .client - .request(reqwest::Method::POST, &uri_str); - - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("access_token", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("sudo", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("token", value)]); - } - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("X-FORGEJO-OTP", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Authorization", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Sudo", value); - }; - if let Some(ref auth_conf) = configuration.basic_auth { - req_builder = req_builder.basic_auth(auth_conf.0.to_owned(), auth_conf.1.to_owned()); - }; - req_builder = req_builder.json(&p_body_body); - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::Label`"))), - ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::Label`")))), - } - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -pub async fn issue_create_milestone( - configuration: &configuration::Configuration, - owner: &str, - repo: &str, - body: Option, -) -> Result> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_owner = owner; - let p_path_repo = repo; - let p_body_body = body; - - let uri_str = format!( - "{}/repos/{owner}/{repo}/milestones", - configuration.base_path, - owner = crate::apis::urlencode(p_path_owner), - repo = crate::apis::urlencode(p_path_repo) - ); - let mut req_builder = configuration - .client - .request(reqwest::Method::POST, &uri_str); - - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("access_token", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("sudo", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("token", value)]); - } - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("X-FORGEJO-OTP", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Authorization", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Sudo", value); - }; - if let Some(ref auth_conf) = configuration.basic_auth { - req_builder = req_builder.basic_auth(auth_conf.0.to_owned(), auth_conf.1.to_owned()); - }; - req_builder = req_builder.json(&p_body_body); - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::Milestone`"))), - ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::Milestone`")))), - } - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -pub async fn issue_delete( - configuration: &configuration::Configuration, - owner: &str, - repo: &str, - index: i64, -) -> Result<(), Error> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_owner = owner; - let p_path_repo = repo; - let p_path_index = index; - - let uri_str = format!( - "{}/repos/{owner}/{repo}/issues/{index}", - configuration.base_path, - owner = crate::apis::urlencode(p_path_owner), - repo = crate::apis::urlencode(p_path_repo), - index = p_path_index - ); - let mut req_builder = configuration - .client - .request(reqwest::Method::DELETE, &uri_str); - - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("access_token", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("sudo", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("token", value)]); - } - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("X-FORGEJO-OTP", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Authorization", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Sudo", value); - }; - if let Some(ref auth_conf) = configuration.basic_auth { - req_builder = req_builder.basic_auth(auth_conf.0.to_owned(), auth_conf.1.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - - if !status.is_client_error() && !status.is_server_error() { - Ok(()) - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -pub async fn issue_delete_comment( - configuration: &configuration::Configuration, - owner: &str, - repo: &str, - id: i64, -) -> Result<(), Error> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_owner = owner; - let p_path_repo = repo; - let p_path_id = id; - - let uri_str = format!( - "{}/repos/{owner}/{repo}/issues/comments/{id}", - configuration.base_path, - owner = crate::apis::urlencode(p_path_owner), - repo = crate::apis::urlencode(p_path_repo), - id = p_path_id - ); - let mut req_builder = configuration - .client - .request(reqwest::Method::DELETE, &uri_str); - - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("access_token", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("sudo", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("token", value)]); - } - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("X-FORGEJO-OTP", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Authorization", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Sudo", value); - }; - if let Some(ref auth_conf) = configuration.basic_auth { - req_builder = req_builder.basic_auth(auth_conf.0.to_owned(), auth_conf.1.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - - if !status.is_client_error() && !status.is_server_error() { - Ok(()) - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -#[deprecated] -pub async fn issue_delete_comment_deprecated( - configuration: &configuration::Configuration, - owner: &str, - repo: &str, - index: i32, - id: i64, -) -> Result<(), Error> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_owner = owner; - let p_path_repo = repo; - let p_path_index = index; - let p_path_id = id; - - let uri_str = format!( - "{}/repos/{owner}/{repo}/issues/{index}/comments/{id}", - configuration.base_path, - owner = crate::apis::urlencode(p_path_owner), - repo = crate::apis::urlencode(p_path_repo), - index = p_path_index, - id = p_path_id - ); - let mut req_builder = configuration - .client - .request(reqwest::Method::DELETE, &uri_str); - - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("access_token", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("sudo", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("token", value)]); - } - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("X-FORGEJO-OTP", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Authorization", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Sudo", value); - }; - if let Some(ref auth_conf) = configuration.basic_auth { - req_builder = req_builder.basic_auth(auth_conf.0.to_owned(), auth_conf.1.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - - if !status.is_client_error() && !status.is_server_error() { - Ok(()) - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -pub async fn issue_delete_comment_reaction( - configuration: &configuration::Configuration, - owner: &str, - repo: &str, - id: i64, - content: Option, -) -> Result<(), Error> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_owner = owner; - let p_path_repo = repo; - let p_path_id = id; - let p_body_content = content; - - let uri_str = format!( - "{}/repos/{owner}/{repo}/issues/comments/{id}/reactions", - configuration.base_path, - owner = crate::apis::urlencode(p_path_owner), - repo = crate::apis::urlencode(p_path_repo), - id = p_path_id - ); - let mut req_builder = configuration - .client - .request(reqwest::Method::DELETE, &uri_str); - - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("access_token", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("sudo", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("token", value)]); - } - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("X-FORGEJO-OTP", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Authorization", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Sudo", value); - }; - if let Some(ref auth_conf) = configuration.basic_auth { - req_builder = req_builder.basic_auth(auth_conf.0.to_owned(), auth_conf.1.to_owned()); - }; - req_builder = req_builder.json(&p_body_content); - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - - if !status.is_client_error() && !status.is_server_error() { - Ok(()) - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -pub async fn issue_delete_issue_attachment( - configuration: &configuration::Configuration, - owner: &str, - repo: &str, - index: i64, - attachment_id: i64, -) -> Result<(), Error> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_owner = owner; - let p_path_repo = repo; - let p_path_index = index; - let p_path_attachment_id = attachment_id; - - let uri_str = format!( - "{}/repos/{owner}/{repo}/issues/{index}/assets/{attachment_id}", - configuration.base_path, - owner = crate::apis::urlencode(p_path_owner), - repo = crate::apis::urlencode(p_path_repo), - index = p_path_index, - attachment_id = p_path_attachment_id - ); - let mut req_builder = configuration - .client - .request(reqwest::Method::DELETE, &uri_str); - - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("access_token", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("sudo", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("token", value)]); - } - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("X-FORGEJO-OTP", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Authorization", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Sudo", value); - }; - if let Some(ref auth_conf) = configuration.basic_auth { - req_builder = req_builder.basic_auth(auth_conf.0.to_owned(), auth_conf.1.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - - if !status.is_client_error() && !status.is_server_error() { - Ok(()) - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -pub async fn issue_delete_issue_comment_attachment( - configuration: &configuration::Configuration, - owner: &str, - repo: &str, - id: i64, - attachment_id: i64, -) -> Result<(), Error> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_owner = owner; - let p_path_repo = repo; - let p_path_id = id; - let p_path_attachment_id = attachment_id; - - let uri_str = format!( - "{}/repos/{owner}/{repo}/issues/comments/{id}/assets/{attachment_id}", - configuration.base_path, - owner = crate::apis::urlencode(p_path_owner), - repo = crate::apis::urlencode(p_path_repo), - id = p_path_id, - attachment_id = p_path_attachment_id - ); - let mut req_builder = configuration - .client - .request(reqwest::Method::DELETE, &uri_str); - - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("access_token", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("sudo", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("token", value)]); - } - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("X-FORGEJO-OTP", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Authorization", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Sudo", value); - }; - if let Some(ref auth_conf) = configuration.basic_auth { - req_builder = req_builder.basic_auth(auth_conf.0.to_owned(), auth_conf.1.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - - if !status.is_client_error() && !status.is_server_error() { - Ok(()) - } else { - let content = resp.text().await?; - let entity: Option = - serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -pub async fn issue_delete_issue_reaction( - configuration: &configuration::Configuration, - owner: &str, - repo: &str, - index: i64, - content: Option, -) -> Result<(), Error> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_owner = owner; - let p_path_repo = repo; - let p_path_index = index; - let p_body_content = content; - - let uri_str = format!( - "{}/repos/{owner}/{repo}/issues/{index}/reactions", - configuration.base_path, - owner = crate::apis::urlencode(p_path_owner), - repo = crate::apis::urlencode(p_path_repo), - index = p_path_index - ); - let mut req_builder = configuration - .client - .request(reqwest::Method::DELETE, &uri_str); - - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("access_token", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("sudo", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("token", value)]); - } - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("X-FORGEJO-OTP", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Authorization", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Sudo", value); - }; - if let Some(ref auth_conf) = configuration.basic_auth { - req_builder = req_builder.basic_auth(auth_conf.0.to_owned(), auth_conf.1.to_owned()); - }; - req_builder = req_builder.json(&p_body_content); - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - - if !status.is_client_error() && !status.is_server_error() { - Ok(()) - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -pub async fn issue_delete_label( - configuration: &configuration::Configuration, - owner: &str, - repo: &str, - id: i64, -) -> Result<(), Error> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_owner = owner; - let p_path_repo = repo; - let p_path_id = id; - - let uri_str = format!( - "{}/repos/{owner}/{repo}/labels/{id}", - configuration.base_path, - owner = crate::apis::urlencode(p_path_owner), - repo = crate::apis::urlencode(p_path_repo), - id = p_path_id - ); - let mut req_builder = configuration - .client - .request(reqwest::Method::DELETE, &uri_str); - - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("access_token", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("sudo", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("token", value)]); - } - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("X-FORGEJO-OTP", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Authorization", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Sudo", value); - }; - if let Some(ref auth_conf) = configuration.basic_auth { - req_builder = req_builder.basic_auth(auth_conf.0.to_owned(), auth_conf.1.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - - if !status.is_client_error() && !status.is_server_error() { - Ok(()) - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -pub async fn issue_delete_milestone( - configuration: &configuration::Configuration, - owner: &str, - repo: &str, - id: i64, -) -> Result<(), Error> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_owner = owner; - let p_path_repo = repo; - let p_path_id = id; - - let uri_str = format!( - "{}/repos/{owner}/{repo}/milestones/{id}", - configuration.base_path, - owner = crate::apis::urlencode(p_path_owner), - repo = crate::apis::urlencode(p_path_repo), - id = p_path_id - ); - let mut req_builder = configuration - .client - .request(reqwest::Method::DELETE, &uri_str); - - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("access_token", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("sudo", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("token", value)]); - } - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("X-FORGEJO-OTP", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Authorization", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Sudo", value); - }; - if let Some(ref auth_conf) = configuration.basic_auth { - req_builder = req_builder.basic_auth(auth_conf.0.to_owned(), auth_conf.1.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - - if !status.is_client_error() && !status.is_server_error() { - Ok(()) - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -pub async fn issue_delete_stop_watch( - configuration: &configuration::Configuration, - owner: &str, - repo: &str, - index: i64, -) -> Result<(), Error> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_owner = owner; - let p_path_repo = repo; - let p_path_index = index; - - let uri_str = format!( - "{}/repos/{owner}/{repo}/issues/{index}/stopwatch/delete", - configuration.base_path, - owner = crate::apis::urlencode(p_path_owner), - repo = crate::apis::urlencode(p_path_repo), - index = p_path_index - ); - let mut req_builder = configuration - .client - .request(reqwest::Method::DELETE, &uri_str); - - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("access_token", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("sudo", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("token", value)]); - } - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("X-FORGEJO-OTP", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Authorization", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Sudo", value); - }; - if let Some(ref auth_conf) = configuration.basic_auth { - req_builder = req_builder.basic_auth(auth_conf.0.to_owned(), auth_conf.1.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - - if !status.is_client_error() && !status.is_server_error() { - Ok(()) - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -pub async fn issue_delete_subscription( - configuration: &configuration::Configuration, - owner: &str, - repo: &str, - index: i64, - user: &str, -) -> Result<(), Error> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_owner = owner; - let p_path_repo = repo; - let p_path_index = index; - let p_path_user = user; - - let uri_str = format!( - "{}/repos/{owner}/{repo}/issues/{index}/subscriptions/{user}", - configuration.base_path, - owner = crate::apis::urlencode(p_path_owner), - repo = crate::apis::urlencode(p_path_repo), - index = p_path_index, - user = crate::apis::urlencode(p_path_user) - ); - let mut req_builder = configuration - .client - .request(reqwest::Method::DELETE, &uri_str); - - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("access_token", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("sudo", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("token", value)]); - } - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("X-FORGEJO-OTP", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Authorization", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Sudo", value); - }; - if let Some(ref auth_conf) = configuration.basic_auth { - req_builder = req_builder.basic_auth(auth_conf.0.to_owned(), auth_conf.1.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - - if !status.is_client_error() && !status.is_server_error() { - Ok(()) - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -pub async fn issue_delete_time( - configuration: &configuration::Configuration, - owner: &str, - repo: &str, - index: i64, - id: i64, -) -> Result<(), Error> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_owner = owner; - let p_path_repo = repo; - let p_path_index = index; - let p_path_id = id; - - let uri_str = format!( - "{}/repos/{owner}/{repo}/issues/{index}/times/{id}", - configuration.base_path, - owner = crate::apis::urlencode(p_path_owner), - repo = crate::apis::urlencode(p_path_repo), - index = p_path_index, - id = p_path_id - ); - let mut req_builder = configuration - .client - .request(reqwest::Method::DELETE, &uri_str); - - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("access_token", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("sudo", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("token", value)]); - } - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("X-FORGEJO-OTP", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Authorization", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Sudo", value); - }; - if let Some(ref auth_conf) = configuration.basic_auth { - req_builder = req_builder.basic_auth(auth_conf.0.to_owned(), auth_conf.1.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - - if !status.is_client_error() && !status.is_server_error() { - Ok(()) - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -pub async fn issue_edit_comment( - configuration: &configuration::Configuration, - owner: &str, - repo: &str, - id: i64, - body: Option, -) -> Result> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_owner = owner; - let p_path_repo = repo; - let p_path_id = id; - let p_body_body = body; - - let uri_str = format!( - "{}/repos/{owner}/{repo}/issues/comments/{id}", - configuration.base_path, - owner = crate::apis::urlencode(p_path_owner), - repo = crate::apis::urlencode(p_path_repo), - id = p_path_id - ); - let mut req_builder = configuration - .client - .request(reqwest::Method::PATCH, &uri_str); - - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("access_token", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("sudo", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("token", value)]); - } - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("X-FORGEJO-OTP", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Authorization", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Sudo", value); - }; - if let Some(ref auth_conf) = configuration.basic_auth { - req_builder = req_builder.basic_auth(auth_conf.0.to_owned(), auth_conf.1.to_owned()); - }; - req_builder = req_builder.json(&p_body_body); - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::Comment`"))), - ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::Comment`")))), - } - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -#[deprecated] -pub async fn issue_edit_comment_deprecated( - configuration: &configuration::Configuration, - owner: &str, - repo: &str, - index: i32, - id: i64, - body: Option, -) -> Result> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_owner = owner; - let p_path_repo = repo; - let p_path_index = index; - let p_path_id = id; - let p_body_body = body; - - let uri_str = format!( - "{}/repos/{owner}/{repo}/issues/{index}/comments/{id}", - configuration.base_path, - owner = crate::apis::urlencode(p_path_owner), - repo = crate::apis::urlencode(p_path_repo), - index = p_path_index, - id = p_path_id - ); - let mut req_builder = configuration - .client - .request(reqwest::Method::PATCH, &uri_str); - - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("access_token", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("sudo", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("token", value)]); - } - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("X-FORGEJO-OTP", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Authorization", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Sudo", value); - }; - if let Some(ref auth_conf) = configuration.basic_auth { - req_builder = req_builder.basic_auth(auth_conf.0.to_owned(), auth_conf.1.to_owned()); - }; - req_builder = req_builder.json(&p_body_body); - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::Comment`"))), - ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::Comment`")))), - } - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -pub async fn issue_edit_issue( - configuration: &configuration::Configuration, - owner: &str, - repo: &str, - index: i64, - body: Option, -) -> Result> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_owner = owner; - let p_path_repo = repo; - let p_path_index = index; - let p_body_body = body; - - let uri_str = format!( - "{}/repos/{owner}/{repo}/issues/{index}", - configuration.base_path, - owner = crate::apis::urlencode(p_path_owner), - repo = crate::apis::urlencode(p_path_repo), - index = p_path_index - ); - let mut req_builder = configuration - .client - .request(reqwest::Method::PATCH, &uri_str); - - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("access_token", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("sudo", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("token", value)]); - } - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("X-FORGEJO-OTP", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Authorization", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Sudo", value); - }; - if let Some(ref auth_conf) = configuration.basic_auth { - req_builder = req_builder.basic_auth(auth_conf.0.to_owned(), auth_conf.1.to_owned()); - }; - req_builder = req_builder.json(&p_body_body); - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::Issue`"))), - ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::Issue`")))), - } - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -pub async fn issue_edit_issue_attachment( - configuration: &configuration::Configuration, - owner: &str, - repo: &str, - index: i64, - attachment_id: i64, - body: Option, -) -> Result> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_owner = owner; - let p_path_repo = repo; - let p_path_index = index; - let p_path_attachment_id = attachment_id; - let p_body_body = body; - - let uri_str = format!( - "{}/repos/{owner}/{repo}/issues/{index}/assets/{attachment_id}", - configuration.base_path, - owner = crate::apis::urlencode(p_path_owner), - repo = crate::apis::urlencode(p_path_repo), - index = p_path_index, - attachment_id = p_path_attachment_id - ); - let mut req_builder = configuration - .client - .request(reqwest::Method::PATCH, &uri_str); - - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("access_token", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("sudo", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("token", value)]); - } - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("X-FORGEJO-OTP", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Authorization", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Sudo", value); - }; - if let Some(ref auth_conf) = configuration.basic_auth { - req_builder = req_builder.basic_auth(auth_conf.0.to_owned(), auth_conf.1.to_owned()); - }; - req_builder = req_builder.json(&p_body_body); - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::Attachment`"))), - ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::Attachment`")))), - } - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -pub async fn issue_edit_issue_comment_attachment( - configuration: &configuration::Configuration, - owner: &str, - repo: &str, - id: i64, - attachment_id: i64, - body: Option, -) -> Result> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_owner = owner; - let p_path_repo = repo; - let p_path_id = id; - let p_path_attachment_id = attachment_id; - let p_body_body = body; - - let uri_str = format!( - "{}/repos/{owner}/{repo}/issues/comments/{id}/assets/{attachment_id}", - configuration.base_path, - owner = crate::apis::urlencode(p_path_owner), - repo = crate::apis::urlencode(p_path_repo), - id = p_path_id, - attachment_id = p_path_attachment_id - ); - let mut req_builder = configuration - .client - .request(reqwest::Method::PATCH, &uri_str); - - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("access_token", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("sudo", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("token", value)]); - } - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("X-FORGEJO-OTP", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Authorization", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Sudo", value); - }; - if let Some(ref auth_conf) = configuration.basic_auth { - req_builder = req_builder.basic_auth(auth_conf.0.to_owned(), auth_conf.1.to_owned()); - }; - req_builder = req_builder.json(&p_body_body); - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::Attachment`"))), - ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::Attachment`")))), - } - } else { - let content = resp.text().await?; - let entity: Option = - serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -pub async fn issue_edit_issue_deadline( - configuration: &configuration::Configuration, - owner: &str, - repo: &str, - index: i64, - body: Option, -) -> Result> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_owner = owner; - let p_path_repo = repo; - let p_path_index = index; - let p_body_body = body; - - let uri_str = format!( - "{}/repos/{owner}/{repo}/issues/{index}/deadline", - configuration.base_path, - owner = crate::apis::urlencode(p_path_owner), - repo = crate::apis::urlencode(p_path_repo), - index = p_path_index - ); - let mut req_builder = configuration - .client - .request(reqwest::Method::POST, &uri_str); - - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("access_token", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("sudo", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("token", value)]); - } - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("X-FORGEJO-OTP", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Authorization", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Sudo", value); - }; - if let Some(ref auth_conf) = configuration.basic_auth { - req_builder = req_builder.basic_auth(auth_conf.0.to_owned(), auth_conf.1.to_owned()); - }; - req_builder = req_builder.json(&p_body_body); - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::IssueDeadline`"))), - ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::IssueDeadline`")))), - } - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -pub async fn issue_edit_label( - configuration: &configuration::Configuration, - owner: &str, - repo: &str, - id: i64, - body: Option, -) -> Result> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_owner = owner; - let p_path_repo = repo; - let p_path_id = id; - let p_body_body = body; - - let uri_str = format!( - "{}/repos/{owner}/{repo}/labels/{id}", - configuration.base_path, - owner = crate::apis::urlencode(p_path_owner), - repo = crate::apis::urlencode(p_path_repo), - id = p_path_id - ); - let mut req_builder = configuration - .client - .request(reqwest::Method::PATCH, &uri_str); - - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("access_token", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("sudo", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("token", value)]); - } - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("X-FORGEJO-OTP", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Authorization", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Sudo", value); - }; - if let Some(ref auth_conf) = configuration.basic_auth { - req_builder = req_builder.basic_auth(auth_conf.0.to_owned(), auth_conf.1.to_owned()); - }; - req_builder = req_builder.json(&p_body_body); - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::Label`"))), - ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::Label`")))), - } - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -pub async fn issue_edit_milestone( - configuration: &configuration::Configuration, - owner: &str, - repo: &str, - id: i64, - body: Option, -) -> Result> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_owner = owner; - let p_path_repo = repo; - let p_path_id = id; - let p_body_body = body; - - let uri_str = format!( - "{}/repos/{owner}/{repo}/milestones/{id}", - configuration.base_path, - owner = crate::apis::urlencode(p_path_owner), - repo = crate::apis::urlencode(p_path_repo), - id = p_path_id - ); - let mut req_builder = configuration - .client - .request(reqwest::Method::PATCH, &uri_str); - - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("access_token", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("sudo", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("token", value)]); - } - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("X-FORGEJO-OTP", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Authorization", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Sudo", value); - }; - if let Some(ref auth_conf) = configuration.basic_auth { - req_builder = req_builder.basic_auth(auth_conf.0.to_owned(), auth_conf.1.to_owned()); - }; - req_builder = req_builder.json(&p_body_body); - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::Milestone`"))), - ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::Milestone`")))), - } - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -pub async fn issue_get_comment( - configuration: &configuration::Configuration, - owner: &str, - repo: &str, - id: i64, -) -> Result> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_owner = owner; - let p_path_repo = repo; - let p_path_id = id; - - let uri_str = format!( - "{}/repos/{owner}/{repo}/issues/comments/{id}", - configuration.base_path, - owner = crate::apis::urlencode(p_path_owner), - repo = crate::apis::urlencode(p_path_repo), - id = p_path_id - ); - let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); - - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("access_token", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("sudo", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("token", value)]); - } - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("X-FORGEJO-OTP", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Authorization", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Sudo", value); - }; - if let Some(ref auth_conf) = configuration.basic_auth { - req_builder = req_builder.basic_auth(auth_conf.0.to_owned(), auth_conf.1.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::Comment`"))), - ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::Comment`")))), - } - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -pub async fn issue_get_comment_reactions( - configuration: &configuration::Configuration, - owner: &str, - repo: &str, - id: i64, -) -> Result, Error> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_owner = owner; - let p_path_repo = repo; - let p_path_id = id; - - let uri_str = format!( - "{}/repos/{owner}/{repo}/issues/comments/{id}/reactions", - configuration.base_path, - owner = crate::apis::urlencode(p_path_owner), - repo = crate::apis::urlencode(p_path_repo), - id = p_path_id - ); - let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); - - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("access_token", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("sudo", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("token", value)]); - } - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("X-FORGEJO-OTP", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Authorization", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Sudo", value); - }; - if let Some(ref auth_conf) = configuration.basic_auth { - req_builder = req_builder.basic_auth(auth_conf.0.to_owned(), auth_conf.1.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `Vec<models::Reaction>`"))), - ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `Vec<models::Reaction>`")))), - } - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -pub async fn issue_get_comments( - configuration: &configuration::Configuration, - owner: &str, - repo: &str, - index: i64, - since: Option, - before: Option, -) -> Result, Error> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_owner = owner; - let p_path_repo = repo; - let p_path_index = index; - let p_query_since = since; - let p_query_before = before; - - let uri_str = format!( - "{}/repos/{owner}/{repo}/issues/{index}/comments", - configuration.base_path, - owner = crate::apis::urlencode(p_path_owner), - repo = crate::apis::urlencode(p_path_repo), - index = p_path_index - ); - let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); - - if let Some(ref param_value) = p_query_since { - req_builder = req_builder.query(&[("since", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_before { - req_builder = req_builder.query(&[("before", ¶m_value.to_string())]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("access_token", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("sudo", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("token", value)]); - } - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("X-FORGEJO-OTP", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Authorization", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Sudo", value); - }; - if let Some(ref auth_conf) = configuration.basic_auth { - req_builder = req_builder.basic_auth(auth_conf.0.to_owned(), auth_conf.1.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `Vec<models::Comment>`"))), - ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `Vec<models::Comment>`")))), - } - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -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> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_owner = owner; - let p_path_repo = repo; - let p_path_index = index; - let p_query_since = since; - let p_query_page = page; - let p_query_limit = limit; - let p_query_before = before; - - let uri_str = format!( - "{}/repos/{owner}/{repo}/issues/{index}/timeline", - configuration.base_path, - owner = crate::apis::urlencode(p_path_owner), - repo = crate::apis::urlencode(p_path_repo), - index = p_path_index - ); - let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); - - if let Some(ref param_value) = p_query_since { - req_builder = req_builder.query(&[("since", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_page { - req_builder = req_builder.query(&[("page", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_limit { - req_builder = req_builder.query(&[("limit", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_before { - req_builder = req_builder.query(&[("before", ¶m_value.to_string())]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("access_token", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("sudo", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("token", value)]); - } - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("X-FORGEJO-OTP", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Authorization", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Sudo", value); - }; - if let Some(ref auth_conf) = configuration.basic_auth { - req_builder = req_builder.basic_auth(auth_conf.0.to_owned(), auth_conf.1.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `Vec<models::TimelineComment>`"))), - ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `Vec<models::TimelineComment>`")))), - } - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -pub async fn issue_get_issue( - configuration: &configuration::Configuration, - owner: &str, - repo: &str, - index: i64, -) -> Result> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_owner = owner; - let p_path_repo = repo; - let p_path_index = index; - - let uri_str = format!( - "{}/repos/{owner}/{repo}/issues/{index}", - configuration.base_path, - owner = crate::apis::urlencode(p_path_owner), - repo = crate::apis::urlencode(p_path_repo), - index = p_path_index - ); - let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); - - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("access_token", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("sudo", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("token", value)]); - } - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("X-FORGEJO-OTP", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Authorization", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Sudo", value); - }; - if let Some(ref auth_conf) = configuration.basic_auth { - req_builder = req_builder.basic_auth(auth_conf.0.to_owned(), auth_conf.1.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::Issue`"))), - ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::Issue`")))), - } - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -pub async fn issue_get_issue_attachment( - configuration: &configuration::Configuration, - owner: &str, - repo: &str, - index: i64, - attachment_id: i64, -) -> Result> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_owner = owner; - let p_path_repo = repo; - let p_path_index = index; - let p_path_attachment_id = attachment_id; - - let uri_str = format!( - "{}/repos/{owner}/{repo}/issues/{index}/assets/{attachment_id}", - configuration.base_path, - owner = crate::apis::urlencode(p_path_owner), - repo = crate::apis::urlencode(p_path_repo), - index = p_path_index, - attachment_id = p_path_attachment_id - ); - let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); - - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("access_token", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("sudo", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("token", value)]); - } - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("X-FORGEJO-OTP", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Authorization", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Sudo", value); - }; - if let Some(ref auth_conf) = configuration.basic_auth { - req_builder = req_builder.basic_auth(auth_conf.0.to_owned(), auth_conf.1.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::Attachment`"))), - ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::Attachment`")))), - } - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -pub async fn issue_get_issue_comment_attachment( - configuration: &configuration::Configuration, - owner: &str, - repo: &str, - id: i64, - attachment_id: i64, -) -> Result> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_owner = owner; - let p_path_repo = repo; - let p_path_id = id; - let p_path_attachment_id = attachment_id; - - let uri_str = format!( - "{}/repos/{owner}/{repo}/issues/comments/{id}/assets/{attachment_id}", - configuration.base_path, - owner = crate::apis::urlencode(p_path_owner), - repo = crate::apis::urlencode(p_path_repo), - id = p_path_id, - attachment_id = p_path_attachment_id - ); - let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); - - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("access_token", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("sudo", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("token", value)]); - } - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("X-FORGEJO-OTP", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Authorization", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Sudo", value); - }; - if let Some(ref auth_conf) = configuration.basic_auth { - req_builder = req_builder.basic_auth(auth_conf.0.to_owned(), auth_conf.1.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::Attachment`"))), - ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::Attachment`")))), - } - } else { - let content = resp.text().await?; - let entity: Option = - serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -pub async fn issue_get_issue_reactions( - configuration: &configuration::Configuration, - owner: &str, - repo: &str, - index: i64, - page: Option, - limit: Option, -) -> Result, Error> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_owner = owner; - let p_path_repo = repo; - let p_path_index = index; - let p_query_page = page; - let p_query_limit = limit; - - let uri_str = format!( - "{}/repos/{owner}/{repo}/issues/{index}/reactions", - configuration.base_path, - owner = crate::apis::urlencode(p_path_owner), - repo = crate::apis::urlencode(p_path_repo), - index = p_path_index - ); - let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); - - if let Some(ref param_value) = p_query_page { - req_builder = req_builder.query(&[("page", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_limit { - req_builder = req_builder.query(&[("limit", ¶m_value.to_string())]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("access_token", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("sudo", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("token", value)]); - } - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("X-FORGEJO-OTP", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Authorization", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Sudo", value); - }; - if let Some(ref auth_conf) = configuration.basic_auth { - req_builder = req_builder.basic_auth(auth_conf.0.to_owned(), auth_conf.1.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `Vec<models::Reaction>`"))), - ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `Vec<models::Reaction>`")))), - } - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -pub async fn issue_get_label( - configuration: &configuration::Configuration, - owner: &str, - repo: &str, - id: i64, -) -> Result> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_owner = owner; - let p_path_repo = repo; - let p_path_id = id; - - let uri_str = format!( - "{}/repos/{owner}/{repo}/labels/{id}", - configuration.base_path, - owner = crate::apis::urlencode(p_path_owner), - repo = crate::apis::urlencode(p_path_repo), - id = p_path_id - ); - let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); - - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("access_token", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("sudo", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("token", value)]); - } - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("X-FORGEJO-OTP", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Authorization", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Sudo", value); - }; - if let Some(ref auth_conf) = configuration.basic_auth { - req_builder = req_builder.basic_auth(auth_conf.0.to_owned(), auth_conf.1.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::Label`"))), - ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::Label`")))), - } - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -pub async fn issue_get_labels( - configuration: &configuration::Configuration, - owner: &str, - repo: &str, - index: i64, -) -> Result, Error> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_owner = owner; - let p_path_repo = repo; - let p_path_index = index; - - let uri_str = format!( - "{}/repos/{owner}/{repo}/issues/{index}/labels", - configuration.base_path, - owner = crate::apis::urlencode(p_path_owner), - repo = crate::apis::urlencode(p_path_repo), - index = p_path_index - ); - let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); - - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("access_token", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("sudo", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("token", value)]); - } - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("X-FORGEJO-OTP", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Authorization", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Sudo", value); - }; - if let Some(ref auth_conf) = configuration.basic_auth { - req_builder = req_builder.basic_auth(auth_conf.0.to_owned(), auth_conf.1.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `Vec<models::Label>`"))), - ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `Vec<models::Label>`")))), - } - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -pub async fn issue_get_milestone( - configuration: &configuration::Configuration, - owner: &str, - repo: &str, - id: i64, -) -> Result> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_owner = owner; - let p_path_repo = repo; - let p_path_id = id; - - let uri_str = format!( - "{}/repos/{owner}/{repo}/milestones/{id}", - configuration.base_path, - owner = crate::apis::urlencode(p_path_owner), - repo = crate::apis::urlencode(p_path_repo), - id = p_path_id - ); - let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); - - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("access_token", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("sudo", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("token", value)]); - } - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("X-FORGEJO-OTP", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Authorization", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Sudo", value); - }; - if let Some(ref auth_conf) = configuration.basic_auth { - req_builder = req_builder.basic_auth(auth_conf.0.to_owned(), auth_conf.1.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::Milestone`"))), - ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::Milestone`")))), - } - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -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> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_owner = owner; - let p_path_repo = repo; - let p_query_state = state; - let p_query_name = name; - let p_query_page = page; - let p_query_limit = limit; - - let uri_str = format!( - "{}/repos/{owner}/{repo}/milestones", - configuration.base_path, - owner = crate::apis::urlencode(p_path_owner), - repo = crate::apis::urlencode(p_path_repo) - ); - let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); - - if let Some(ref param_value) = p_query_state { - req_builder = req_builder.query(&[("state", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_name { - req_builder = req_builder.query(&[("name", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_page { - req_builder = req_builder.query(&[("page", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_limit { - req_builder = req_builder.query(&[("limit", ¶m_value.to_string())]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("access_token", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("sudo", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("token", value)]); - } - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("X-FORGEJO-OTP", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Authorization", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Sudo", value); - }; - if let Some(ref auth_conf) = configuration.basic_auth { - req_builder = req_builder.basic_auth(auth_conf.0.to_owned(), auth_conf.1.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `Vec<models::Milestone>`"))), - ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `Vec<models::Milestone>`")))), - } - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -pub async fn issue_get_repo_comments( - configuration: &configuration::Configuration, - owner: &str, - repo: &str, - since: Option, - before: Option, - page: Option, - limit: Option, -) -> Result, Error> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_owner = owner; - let p_path_repo = repo; - let p_query_since = since; - let p_query_before = before; - let p_query_page = page; - let p_query_limit = limit; - - let uri_str = format!( - "{}/repos/{owner}/{repo}/issues/comments", - configuration.base_path, - owner = crate::apis::urlencode(p_path_owner), - repo = crate::apis::urlencode(p_path_repo) - ); - let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); - - if let Some(ref param_value) = p_query_since { - req_builder = req_builder.query(&[("since", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_before { - req_builder = req_builder.query(&[("before", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_page { - req_builder = req_builder.query(&[("page", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_limit { - req_builder = req_builder.query(&[("limit", ¶m_value.to_string())]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("access_token", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("sudo", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("token", value)]); - } - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("X-FORGEJO-OTP", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Authorization", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Sudo", value); - }; - if let Some(ref auth_conf) = configuration.basic_auth { - req_builder = req_builder.basic_auth(auth_conf.0.to_owned(), auth_conf.1.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `Vec<models::Comment>`"))), - ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `Vec<models::Comment>`")))), - } - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -pub async fn issue_list_blocks( - configuration: &configuration::Configuration, - owner: &str, - repo: &str, - index: i64, - page: Option, - limit: Option, -) -> Result, Error> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_owner = owner; - let p_path_repo = repo; - let p_path_index = index; - let p_query_page = page; - let p_query_limit = limit; - - let uri_str = format!( - "{}/repos/{owner}/{repo}/issues/{index}/blocks", - configuration.base_path, - owner = crate::apis::urlencode(p_path_owner), - repo = crate::apis::urlencode(p_path_repo), - index = p_path_index - ); - let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); - - if let Some(ref param_value) = p_query_page { - req_builder = req_builder.query(&[("page", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_limit { - req_builder = req_builder.query(&[("limit", ¶m_value.to_string())]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("access_token", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("sudo", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("token", value)]); - } - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("X-FORGEJO-OTP", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Authorization", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Sudo", value); - }; - if let Some(ref auth_conf) = configuration.basic_auth { - req_builder = req_builder.basic_auth(auth_conf.0.to_owned(), auth_conf.1.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `Vec<models::Issue>`"))), - ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `Vec<models::Issue>`")))), - } - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -pub async fn issue_list_issue_attachments( - configuration: &configuration::Configuration, - owner: &str, - repo: &str, - index: i64, -) -> Result, Error> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_owner = owner; - let p_path_repo = repo; - let p_path_index = index; - - let uri_str = format!( - "{}/repos/{owner}/{repo}/issues/{index}/assets", - configuration.base_path, - owner = crate::apis::urlencode(p_path_owner), - repo = crate::apis::urlencode(p_path_repo), - index = p_path_index - ); - let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); - - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("access_token", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("sudo", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("token", value)]); - } - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("X-FORGEJO-OTP", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Authorization", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Sudo", value); - }; - if let Some(ref auth_conf) = configuration.basic_auth { - req_builder = req_builder.basic_auth(auth_conf.0.to_owned(), auth_conf.1.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `Vec<models::Attachment>`"))), - ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `Vec<models::Attachment>`")))), - } - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -pub async fn issue_list_issue_comment_attachments( - configuration: &configuration::Configuration, - owner: &str, - repo: &str, - id: i64, -) -> Result, Error> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_owner = owner; - let p_path_repo = repo; - let p_path_id = id; - - let uri_str = format!( - "{}/repos/{owner}/{repo}/issues/comments/{id}/assets", - configuration.base_path, - owner = crate::apis::urlencode(p_path_owner), - repo = crate::apis::urlencode(p_path_repo), - id = p_path_id - ); - let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); - - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("access_token", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("sudo", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("token", value)]); - } - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("X-FORGEJO-OTP", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Authorization", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Sudo", value); - }; - if let Some(ref auth_conf) = configuration.basic_auth { - req_builder = req_builder.basic_auth(auth_conf.0.to_owned(), auth_conf.1.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `Vec<models::Attachment>`"))), - ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `Vec<models::Attachment>`")))), - } - } else { - let content = resp.text().await?; - let entity: Option = - serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -pub async fn issue_list_issue_dependencies( - configuration: &configuration::Configuration, - owner: &str, - repo: &str, - index: i64, - page: Option, - limit: Option, -) -> Result, Error> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_owner = owner; - let p_path_repo = repo; - let p_path_index = index; - let p_query_page = page; - let p_query_limit = limit; - - let uri_str = format!( - "{}/repos/{owner}/{repo}/issues/{index}/dependencies", - configuration.base_path, - owner = crate::apis::urlencode(p_path_owner), - repo = crate::apis::urlencode(p_path_repo), - index = p_path_index - ); - let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); - - if let Some(ref param_value) = p_query_page { - req_builder = req_builder.query(&[("page", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_limit { - req_builder = req_builder.query(&[("limit", ¶m_value.to_string())]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("access_token", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("sudo", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("token", value)]); - } - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("X-FORGEJO-OTP", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Authorization", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Sudo", value); - }; - if let Some(ref auth_conf) = configuration.basic_auth { - req_builder = req_builder.basic_auth(auth_conf.0.to_owned(), auth_conf.1.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `Vec<models::Issue>`"))), - ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `Vec<models::Issue>`")))), - } - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -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, - sort: Option<&str>, -) -> Result, Error> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_owner = owner; - let p_path_repo = repo; - let p_query_state = state; - let p_query_labels = labels; - let p_query_q = q; - let p_query_type = r#type; - let p_query_milestones = milestones; - let p_query_since = since; - let p_query_before = before; - let p_query_created_by = created_by; - let p_query_assigned_by = assigned_by; - let p_query_mentioned_by = mentioned_by; - let p_query_page = page; - let p_query_limit = limit; - let p_query_sort = sort; - - let uri_str = format!( - "{}/repos/{owner}/{repo}/issues", - configuration.base_path, - owner = crate::apis::urlencode(p_path_owner), - repo = crate::apis::urlencode(p_path_repo) - ); - let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); - - if let Some(ref param_value) = p_query_state { - req_builder = req_builder.query(&[("state", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_labels { - req_builder = req_builder.query(&[("labels", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_q { - req_builder = req_builder.query(&[("q", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_type { - req_builder = req_builder.query(&[("type", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_milestones { - req_builder = req_builder.query(&[("milestones", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_since { - req_builder = req_builder.query(&[("since", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_before { - req_builder = req_builder.query(&[("before", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_created_by { - req_builder = req_builder.query(&[("created_by", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_assigned_by { - req_builder = req_builder.query(&[("assigned_by", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_mentioned_by { - req_builder = req_builder.query(&[("mentioned_by", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_page { - req_builder = req_builder.query(&[("page", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_limit { - req_builder = req_builder.query(&[("limit", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_sort { - req_builder = req_builder.query(&[("sort", ¶m_value.to_string())]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("access_token", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("sudo", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("token", value)]); - } - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("X-FORGEJO-OTP", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Authorization", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Sudo", value); - }; - if let Some(ref auth_conf) = configuration.basic_auth { - req_builder = req_builder.basic_auth(auth_conf.0.to_owned(), auth_conf.1.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `Vec<models::Issue>`"))), - ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `Vec<models::Issue>`")))), - } - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -pub async fn issue_list_labels( - configuration: &configuration::Configuration, - owner: &str, - repo: &str, - sort: Option<&str>, - page: Option, - limit: Option, -) -> Result, Error> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_owner = owner; - let p_path_repo = repo; - let p_query_sort = sort; - let p_query_page = page; - let p_query_limit = limit; - - let uri_str = format!( - "{}/repos/{owner}/{repo}/labels", - configuration.base_path, - owner = crate::apis::urlencode(p_path_owner), - repo = crate::apis::urlencode(p_path_repo) - ); - let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); - - if let Some(ref param_value) = p_query_sort { - req_builder = req_builder.query(&[("sort", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_page { - req_builder = req_builder.query(&[("page", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_limit { - req_builder = req_builder.query(&[("limit", ¶m_value.to_string())]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("access_token", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("sudo", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("token", value)]); - } - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("X-FORGEJO-OTP", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Authorization", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Sudo", value); - }; - if let Some(ref auth_conf) = configuration.basic_auth { - req_builder = req_builder.basic_auth(auth_conf.0.to_owned(), auth_conf.1.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `Vec<models::Label>`"))), - ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `Vec<models::Label>`")))), - } - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -pub async fn issue_post_comment_reaction( - configuration: &configuration::Configuration, - owner: &str, - repo: &str, - id: i64, - content: Option, -) -> Result> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_owner = owner; - let p_path_repo = repo; - let p_path_id = id; - let p_body_content = content; - - let uri_str = format!( - "{}/repos/{owner}/{repo}/issues/comments/{id}/reactions", - configuration.base_path, - owner = crate::apis::urlencode(p_path_owner), - repo = crate::apis::urlencode(p_path_repo), - id = p_path_id - ); - let mut req_builder = configuration - .client - .request(reqwest::Method::POST, &uri_str); - - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("access_token", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("sudo", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("token", value)]); - } - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("X-FORGEJO-OTP", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Authorization", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Sudo", value); - }; - if let Some(ref auth_conf) = configuration.basic_auth { - req_builder = req_builder.basic_auth(auth_conf.0.to_owned(), auth_conf.1.to_owned()); - }; - req_builder = req_builder.json(&p_body_content); - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::Reaction`"))), - ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::Reaction`")))), - } - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -pub async fn issue_post_issue_reaction( - configuration: &configuration::Configuration, - owner: &str, - repo: &str, - index: i64, - content: Option, -) -> Result> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_owner = owner; - let p_path_repo = repo; - let p_path_index = index; - let p_body_content = content; - - let uri_str = format!( - "{}/repos/{owner}/{repo}/issues/{index}/reactions", - configuration.base_path, - owner = crate::apis::urlencode(p_path_owner), - repo = crate::apis::urlencode(p_path_repo), - index = p_path_index - ); - let mut req_builder = configuration - .client - .request(reqwest::Method::POST, &uri_str); - - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("access_token", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("sudo", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("token", value)]); - } - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("X-FORGEJO-OTP", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Authorization", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Sudo", value); - }; - if let Some(ref auth_conf) = configuration.basic_auth { - req_builder = req_builder.basic_auth(auth_conf.0.to_owned(), auth_conf.1.to_owned()); - }; - req_builder = req_builder.json(&p_body_content); - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::Reaction`"))), - ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::Reaction`")))), - } - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -pub async fn issue_remove_issue_blocking( - configuration: &configuration::Configuration, - owner: &str, - repo: &str, - index: i64, - body: Option, -) -> Result> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_owner = owner; - let p_path_repo = repo; - let p_path_index = index; - let p_body_body = body; - - let uri_str = format!( - "{}/repos/{owner}/{repo}/issues/{index}/blocks", - configuration.base_path, - owner = crate::apis::urlencode(p_path_owner), - repo = crate::apis::urlencode(p_path_repo), - index = p_path_index - ); - let mut req_builder = configuration - .client - .request(reqwest::Method::DELETE, &uri_str); - - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("access_token", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("sudo", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("token", value)]); - } - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("X-FORGEJO-OTP", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Authorization", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Sudo", value); - }; - if let Some(ref auth_conf) = configuration.basic_auth { - req_builder = req_builder.basic_auth(auth_conf.0.to_owned(), auth_conf.1.to_owned()); - }; - req_builder = req_builder.json(&p_body_body); - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::Issue`"))), - ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::Issue`")))), - } - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -pub async fn issue_remove_issue_dependencies( - configuration: &configuration::Configuration, - owner: &str, - repo: &str, - index: i64, - body: Option, -) -> Result> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_owner = owner; - let p_path_repo = repo; - let p_path_index = index; - let p_body_body = body; - - let uri_str = format!( - "{}/repos/{owner}/{repo}/issues/{index}/dependencies", - configuration.base_path, - owner = crate::apis::urlencode(p_path_owner), - repo = crate::apis::urlencode(p_path_repo), - index = p_path_index - ); - let mut req_builder = configuration - .client - .request(reqwest::Method::DELETE, &uri_str); - - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("access_token", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("sudo", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("token", value)]); - } - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("X-FORGEJO-OTP", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Authorization", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Sudo", value); - }; - if let Some(ref auth_conf) = configuration.basic_auth { - req_builder = req_builder.basic_auth(auth_conf.0.to_owned(), auth_conf.1.to_owned()); - }; - req_builder = req_builder.json(&p_body_body); - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::Issue`"))), - ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::Issue`")))), - } - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -pub async fn issue_remove_label( - configuration: &configuration::Configuration, - owner: &str, - repo: &str, - index: i64, - identifier: &str, - body: Option, -) -> Result<(), Error> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_owner = owner; - let p_path_repo = repo; - let p_path_index = index; - let p_path_identifier = identifier; - let p_body_body = body; - - let uri_str = format!( - "{}/repos/{owner}/{repo}/issues/{index}/labels/{identifier}", - configuration.base_path, - owner = crate::apis::urlencode(p_path_owner), - repo = crate::apis::urlencode(p_path_repo), - index = p_path_index, - identifier = crate::apis::urlencode(p_path_identifier) - ); - let mut req_builder = configuration - .client - .request(reqwest::Method::DELETE, &uri_str); - - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("access_token", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("sudo", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("token", value)]); - } - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("X-FORGEJO-OTP", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Authorization", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Sudo", value); - }; - if let Some(ref auth_conf) = configuration.basic_auth { - req_builder = req_builder.basic_auth(auth_conf.0.to_owned(), auth_conf.1.to_owned()); - }; - req_builder = req_builder.json(&p_body_body); - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - - if !status.is_client_error() && !status.is_server_error() { - Ok(()) - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -pub async fn issue_replace_labels( - configuration: &configuration::Configuration, - owner: &str, - repo: &str, - index: i64, - body: Option, -) -> Result, Error> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_owner = owner; - let p_path_repo = repo; - let p_path_index = index; - let p_body_body = body; - - let uri_str = format!( - "{}/repos/{owner}/{repo}/issues/{index}/labels", - configuration.base_path, - owner = crate::apis::urlencode(p_path_owner), - repo = crate::apis::urlencode(p_path_repo), - index = p_path_index - ); - let mut req_builder = configuration.client.request(reqwest::Method::PUT, &uri_str); - - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("access_token", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("sudo", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("token", value)]); - } - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("X-FORGEJO-OTP", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Authorization", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Sudo", value); - }; - if let Some(ref auth_conf) = configuration.basic_auth { - req_builder = req_builder.basic_auth(auth_conf.0.to_owned(), auth_conf.1.to_owned()); - }; - req_builder = req_builder.json(&p_body_body); - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `Vec<models::Label>`"))), - ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `Vec<models::Label>`")))), - } - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -pub async fn issue_reset_time( - configuration: &configuration::Configuration, - owner: &str, - repo: &str, - index: i64, -) -> Result<(), Error> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_owner = owner; - let p_path_repo = repo; - let p_path_index = index; - - let uri_str = format!( - "{}/repos/{owner}/{repo}/issues/{index}/times", - configuration.base_path, - owner = crate::apis::urlencode(p_path_owner), - repo = crate::apis::urlencode(p_path_repo), - index = p_path_index - ); - let mut req_builder = configuration - .client - .request(reqwest::Method::DELETE, &uri_str); - - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("access_token", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("sudo", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("token", value)]); - } - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("X-FORGEJO-OTP", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Authorization", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Sudo", value); - }; - if let Some(ref auth_conf) = configuration.basic_auth { - req_builder = req_builder.basic_auth(auth_conf.0.to_owned(), auth_conf.1.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - - if !status.is_client_error() && !status.is_server_error() { - Ok(()) - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -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, - reviewed: Option, - owner: Option<&str>, - team: Option<&str>, - page: Option, - limit: Option, - sort: Option<&str>, -) -> Result, Error> { - // add a prefix to parameters to efficiently prevent name collisions - let p_query_state = state; - let p_query_labels = labels; - let p_query_milestones = milestones; - let p_query_q = q; - let p_query_priority_repo_id = priority_repo_id; - let p_query_type = r#type; - let p_query_since = since; - let p_query_before = before; - let p_query_assigned = assigned; - let p_query_created = created; - let p_query_mentioned = mentioned; - let p_query_review_requested = review_requested; - let p_query_reviewed = reviewed; - let p_query_owner = owner; - let p_query_team = team; - let p_query_page = page; - let p_query_limit = limit; - let p_query_sort = sort; - - let uri_str = format!("{}/repos/issues/search", configuration.base_path); - let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); - - if let Some(ref param_value) = p_query_state { - req_builder = req_builder.query(&[("state", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_labels { - req_builder = req_builder.query(&[("labels", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_milestones { - req_builder = req_builder.query(&[("milestones", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_q { - req_builder = req_builder.query(&[("q", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_priority_repo_id { - req_builder = req_builder.query(&[("priority_repo_id", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_type { - req_builder = req_builder.query(&[("type", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_since { - req_builder = req_builder.query(&[("since", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_before { - req_builder = req_builder.query(&[("before", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_assigned { - req_builder = req_builder.query(&[("assigned", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_created { - req_builder = req_builder.query(&[("created", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_mentioned { - req_builder = req_builder.query(&[("mentioned", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_review_requested { - req_builder = req_builder.query(&[("review_requested", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_reviewed { - req_builder = req_builder.query(&[("reviewed", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_owner { - req_builder = req_builder.query(&[("owner", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_team { - req_builder = req_builder.query(&[("team", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_page { - req_builder = req_builder.query(&[("page", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_limit { - req_builder = req_builder.query(&[("limit", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_sort { - req_builder = req_builder.query(&[("sort", ¶m_value.to_string())]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("access_token", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("sudo", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("token", value)]); - } - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("X-FORGEJO-OTP", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Authorization", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Sudo", value); - }; - if let Some(ref auth_conf) = configuration.basic_auth { - req_builder = req_builder.basic_auth(auth_conf.0.to_owned(), auth_conf.1.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `Vec<models::Issue>`"))), - ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `Vec<models::Issue>`")))), - } - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -pub async fn issue_start_stop_watch( - configuration: &configuration::Configuration, - owner: &str, - repo: &str, - index: i64, -) -> Result<(), Error> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_owner = owner; - let p_path_repo = repo; - let p_path_index = index; - - let uri_str = format!( - "{}/repos/{owner}/{repo}/issues/{index}/stopwatch/start", - configuration.base_path, - owner = crate::apis::urlencode(p_path_owner), - repo = crate::apis::urlencode(p_path_repo), - index = p_path_index - ); - let mut req_builder = configuration - .client - .request(reqwest::Method::POST, &uri_str); - - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("access_token", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("sudo", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("token", value)]); - } - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("X-FORGEJO-OTP", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Authorization", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Sudo", value); - }; - if let Some(ref auth_conf) = configuration.basic_auth { - req_builder = req_builder.basic_auth(auth_conf.0.to_owned(), auth_conf.1.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - - if !status.is_client_error() && !status.is_server_error() { - Ok(()) - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -pub async fn issue_stop_stop_watch( - configuration: &configuration::Configuration, - owner: &str, - repo: &str, - index: i64, -) -> Result<(), Error> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_owner = owner; - let p_path_repo = repo; - let p_path_index = index; - - let uri_str = format!( - "{}/repos/{owner}/{repo}/issues/{index}/stopwatch/stop", - configuration.base_path, - owner = crate::apis::urlencode(p_path_owner), - repo = crate::apis::urlencode(p_path_repo), - index = p_path_index - ); - let mut req_builder = configuration - .client - .request(reqwest::Method::POST, &uri_str); - - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("access_token", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("sudo", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("token", value)]); - } - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("X-FORGEJO-OTP", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Authorization", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Sudo", value); - }; - if let Some(ref auth_conf) = configuration.basic_auth { - req_builder = req_builder.basic_auth(auth_conf.0.to_owned(), auth_conf.1.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - - if !status.is_client_error() && !status.is_server_error() { - Ok(()) - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -pub async fn issue_subscriptions( - configuration: &configuration::Configuration, - owner: &str, - repo: &str, - index: i64, - page: Option, - limit: Option, -) -> Result, Error> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_owner = owner; - let p_path_repo = repo; - let p_path_index = index; - let p_query_page = page; - let p_query_limit = limit; - - let uri_str = format!( - "{}/repos/{owner}/{repo}/issues/{index}/subscriptions", - configuration.base_path, - owner = crate::apis::urlencode(p_path_owner), - repo = crate::apis::urlencode(p_path_repo), - index = p_path_index - ); - let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); - - if let Some(ref param_value) = p_query_page { - req_builder = req_builder.query(&[("page", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_limit { - req_builder = req_builder.query(&[("limit", ¶m_value.to_string())]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("access_token", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("sudo", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("token", value)]); - } - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("X-FORGEJO-OTP", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Authorization", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Sudo", value); - }; - if let Some(ref auth_conf) = configuration.basic_auth { - req_builder = req_builder.basic_auth(auth_conf.0.to_owned(), auth_conf.1.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `Vec<models::User>`"))), - ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `Vec<models::User>`")))), - } - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -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> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_owner = owner; - let p_path_repo = repo; - let p_path_index = index; - let p_query_user = user; - let p_query_since = since; - let p_query_before = before; - let p_query_page = page; - let p_query_limit = limit; - - let uri_str = format!( - "{}/repos/{owner}/{repo}/issues/{index}/times", - configuration.base_path, - owner = crate::apis::urlencode(p_path_owner), - repo = crate::apis::urlencode(p_path_repo), - index = p_path_index - ); - let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); - - if let Some(ref param_value) = p_query_user { - req_builder = req_builder.query(&[("user", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_since { - req_builder = req_builder.query(&[("since", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_before { - req_builder = req_builder.query(&[("before", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_page { - req_builder = req_builder.query(&[("page", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_limit { - req_builder = req_builder.query(&[("limit", ¶m_value.to_string())]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("access_token", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("sudo", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("token", value)]); - } - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("X-FORGEJO-OTP", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Authorization", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Sudo", value); - }; - if let Some(ref auth_conf) = configuration.basic_auth { - req_builder = req_builder.basic_auth(auth_conf.0.to_owned(), auth_conf.1.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `Vec<models::TrackedTime>`"))), - ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `Vec<models::TrackedTime>`")))), - } - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -pub async fn move_issue_pin( - configuration: &configuration::Configuration, - owner: &str, - repo: &str, - index: i64, - position: i64, -) -> Result<(), Error> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_owner = owner; - let p_path_repo = repo; - let p_path_index = index; - let p_path_position = position; - - let uri_str = format!( - "{}/repos/{owner}/{repo}/issues/{index}/pin/{position}", - configuration.base_path, - owner = crate::apis::urlencode(p_path_owner), - repo = crate::apis::urlencode(p_path_repo), - index = p_path_index, - position = p_path_position - ); - let mut req_builder = configuration - .client - .request(reqwest::Method::PATCH, &uri_str); - - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("access_token", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("sudo", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("token", value)]); - } - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("X-FORGEJO-OTP", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Authorization", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Sudo", value); - }; - if let Some(ref auth_conf) = configuration.basic_auth { - req_builder = req_builder.basic_auth(auth_conf.0.to_owned(), auth_conf.1.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - - if !status.is_client_error() && !status.is_server_error() { - Ok(()) - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -pub async fn pin_issue( - configuration: &configuration::Configuration, - owner: &str, - repo: &str, - index: i64, -) -> Result<(), Error> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_owner = owner; - let p_path_repo = repo; - let p_path_index = index; - - let uri_str = format!( - "{}/repos/{owner}/{repo}/issues/{index}/pin", - configuration.base_path, - owner = crate::apis::urlencode(p_path_owner), - repo = crate::apis::urlencode(p_path_repo), - index = p_path_index - ); - let mut req_builder = configuration - .client - .request(reqwest::Method::POST, &uri_str); - - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("access_token", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("sudo", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("token", value)]); - } - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("X-FORGEJO-OTP", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Authorization", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Sudo", value); - }; - if let Some(ref auth_conf) = configuration.basic_auth { - req_builder = req_builder.basic_auth(auth_conf.0.to_owned(), auth_conf.1.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - - if !status.is_client_error() && !status.is_server_error() { - Ok(()) - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -pub async fn unpin_issue( - configuration: &configuration::Configuration, - owner: &str, - repo: &str, - index: i64, -) -> Result<(), Error> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_owner = owner; - let p_path_repo = repo; - let p_path_index = index; - - let uri_str = format!( - "{}/repos/{owner}/{repo}/issues/{index}/pin", - configuration.base_path, - owner = crate::apis::urlencode(p_path_owner), - repo = crate::apis::urlencode(p_path_repo), - index = p_path_index - ); - let mut req_builder = configuration - .client - .request(reqwest::Method::DELETE, &uri_str); - - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("access_token", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("sudo", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("token", value)]); - } - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("X-FORGEJO-OTP", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Authorization", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Sudo", value); - }; - if let Some(ref auth_conf) = configuration.basic_auth { - req_builder = req_builder.basic_auth(auth_conf.0.to_owned(), auth_conf.1.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - - if !status.is_client_error() && !status.is_server_error() { - Ok(()) - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} diff --git a/src/apis/miscellaneous_api.rs b/src/apis/miscellaneous_api.rs deleted file mode 100644 index 179a173..0000000 --- a/src/apis/miscellaneous_api.rs +++ /dev/null @@ -1,1327 +0,0 @@ -/* - * Forgejo API - * - * This documentation describes the Forgejo API. - * - * The version of the OpenAPI document: 14.0.2-2-84240ce3a2+gitea-1.22.0 - * - * Generated by: https://openapi-generator.tech - */ - -use super::{configuration, ContentType, Error}; -use crate::{apis::ResponseContent, models}; -use reqwest; -use serde::{de::Error as _, Deserialize, Serialize}; - -/// struct for typed errors of method [`get_gitignore_template_info`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum GetGitignoreTemplateInfoError { - Status404(models::ApiNotFound), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`get_label_template_info`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum GetLabelTemplateInfoError { - Status404(models::ApiNotFound), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`get_license_template_info`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum GetLicenseTemplateInfoError { - Status404(models::ApiNotFound), - UnknownValue(serde_json::Value), -} - -/// 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_ssh_signing_key`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum GetSshSigningKeyError { - Status404(models::ApiNotFound), - 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 [`list_gitignores_templates`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum ListGitignoresTemplatesError { - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`list_label_templates`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum ListLabelTemplatesError { - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`list_license_templates`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum ListLicenseTemplatesError { - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`render_markdown`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum RenderMarkdownError { - Status422(models::ApiValidationError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`render_markdown_raw`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum RenderMarkdownRawError { - Status422(models::ApiValidationError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`render_markup`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum RenderMarkupError { - Status422(models::ApiValidationError), - UnknownValue(serde_json::Value), -} - -pub async fn get_gitignore_template_info( - configuration: &configuration::Configuration, - name: &str, -) -> Result> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_name = name; - - let uri_str = format!( - "{}/gitignore/templates/{name}", - configuration.base_path, - name = crate::apis::urlencode(p_path_name) - ); - let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); - - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("access_token", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("sudo", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("token", value)]); - } - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("X-FORGEJO-OTP", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Authorization", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Sudo", value); - }; - if let Some(ref auth_conf) = configuration.basic_auth { - req_builder = req_builder.basic_auth(auth_conf.0.to_owned(), auth_conf.1.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::GitignoreTemplateInfo`"))), - ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::GitignoreTemplateInfo`")))), - } - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -pub async fn get_label_template_info( - configuration: &configuration::Configuration, - name: &str, -) -> Result, Error> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_name = name; - - let uri_str = format!( - "{}/label/templates/{name}", - configuration.base_path, - name = crate::apis::urlencode(p_path_name) - ); - let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); - - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("access_token", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("sudo", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("token", value)]); - } - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("X-FORGEJO-OTP", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Authorization", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Sudo", value); - }; - if let Some(ref auth_conf) = configuration.basic_auth { - req_builder = req_builder.basic_auth(auth_conf.0.to_owned(), auth_conf.1.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `Vec<models::LabelTemplate>`"))), - ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `Vec<models::LabelTemplate>`")))), - } - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -pub async fn get_license_template_info( - configuration: &configuration::Configuration, - name: &str, -) -> Result> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_name = name; - - let uri_str = format!( - "{}/licenses/{name}", - configuration.base_path, - name = crate::apis::urlencode(p_path_name) - ); - let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); - - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("access_token", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("sudo", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("token", value)]); - } - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("X-FORGEJO-OTP", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Authorization", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Sudo", value); - }; - if let Some(ref auth_conf) = configuration.basic_auth { - req_builder = req_builder.basic_auth(auth_conf.0.to_owned(), auth_conf.1.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::LicenseTemplateInfo`"))), - ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::LicenseTemplateInfo`")))), - } - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -pub async fn get_node_info( - configuration: &configuration::Configuration, -) -> Result> { - let uri_str = format!("{}/nodeinfo", configuration.base_path); - let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); - - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("access_token", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("sudo", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("token", value)]); - } - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("X-FORGEJO-OTP", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Authorization", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Sudo", value); - }; - if let Some(ref auth_conf) = configuration.basic_auth { - req_builder = req_builder.basic_auth(auth_conf.0.to_owned(), auth_conf.1.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::NodeInfo`"))), - ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::NodeInfo`")))), - } - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -pub async fn get_signing_key( - configuration: &configuration::Configuration, -) -> Result> { - let uri_str = format!("{}/signing-key.gpg", configuration.base_path); - let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); - - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("access_token", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("sudo", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("token", value)]); - } - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("X-FORGEJO-OTP", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Authorization", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Sudo", value); - }; - if let Some(ref auth_conf) = configuration.basic_auth { - req_builder = req_builder.basic_auth(auth_conf.0.to_owned(), auth_conf.1.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => return Ok(content), - ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `String`")))), - } - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -pub async fn get_ssh_signing_key( - configuration: &configuration::Configuration, -) -> Result> { - let uri_str = format!("{}/signing-key.ssh", configuration.base_path); - let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); - - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("access_token", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("sudo", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("token", value)]); - } - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("X-FORGEJO-OTP", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Authorization", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Sudo", value); - }; - if let Some(ref auth_conf) = configuration.basic_auth { - req_builder = req_builder.basic_auth(auth_conf.0.to_owned(), auth_conf.1.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => return Ok(content), - ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `String`")))), - } - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -pub async fn get_version( - configuration: &configuration::Configuration, -) -> Result> { - let uri_str = format!("{}/version", configuration.base_path); - let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); - - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("access_token", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("sudo", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("token", value)]); - } - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("X-FORGEJO-OTP", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Authorization", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Sudo", value); - }; - if let Some(ref auth_conf) = configuration.basic_auth { - req_builder = req_builder.basic_auth(auth_conf.0.to_owned(), auth_conf.1.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::ServerVersion`"))), - ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::ServerVersion`")))), - } - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -pub async fn list_gitignores_templates( - configuration: &configuration::Configuration, -) -> Result, Error> { - let uri_str = format!("{}/gitignore/templates", configuration.base_path); - let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); - - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("access_token", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("sudo", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("token", value)]); - } - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("X-FORGEJO-OTP", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Authorization", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Sudo", value); - }; - if let Some(ref auth_conf) = configuration.basic_auth { - req_builder = req_builder.basic_auth(auth_conf.0.to_owned(), auth_conf.1.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `Vec<String>`"))), - ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `Vec<String>`")))), - } - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -pub async fn list_label_templates( - configuration: &configuration::Configuration, -) -> Result, Error> { - let uri_str = format!("{}/label/templates", configuration.base_path); - let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); - - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("access_token", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("sudo", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("token", value)]); - } - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("X-FORGEJO-OTP", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Authorization", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Sudo", value); - }; - if let Some(ref auth_conf) = configuration.basic_auth { - req_builder = req_builder.basic_auth(auth_conf.0.to_owned(), auth_conf.1.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `Vec<String>`"))), - ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `Vec<String>`")))), - } - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -pub async fn list_license_templates( - configuration: &configuration::Configuration, -) -> Result, Error> { - let uri_str = format!("{}/licenses", configuration.base_path); - let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); - - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("access_token", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("sudo", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("token", value)]); - } - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("X-FORGEJO-OTP", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Authorization", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Sudo", value); - }; - if let Some(ref auth_conf) = configuration.basic_auth { - req_builder = req_builder.basic_auth(auth_conf.0.to_owned(), auth_conf.1.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `Vec<models::LicensesTemplateListEntry>`"))), - ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `Vec<models::LicensesTemplateListEntry>`")))), - } - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -pub async fn render_markdown( - configuration: &configuration::Configuration, - body: Option, -) -> Result> { - // add a prefix to parameters to efficiently prevent name collisions - let p_body_body = body; - - let uri_str = format!("{}/markdown", configuration.base_path); - let mut req_builder = configuration - .client - .request(reqwest::Method::POST, &uri_str); - - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("access_token", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("sudo", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("token", value)]); - } - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("X-FORGEJO-OTP", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Authorization", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Sudo", value); - }; - if let Some(ref auth_conf) = configuration.basic_auth { - req_builder = req_builder.basic_auth(auth_conf.0.to_owned(), auth_conf.1.to_owned()); - }; - req_builder = req_builder.json(&p_body_body); - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `String`"))), - ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `String`")))), - } - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -pub async fn render_markdown_raw( - configuration: &configuration::Configuration, - body: &str, -) -> Result> { - // add a prefix to parameters to efficiently prevent name collisions - let p_body_body = body; - - let uri_str = format!("{}/markdown/raw", configuration.base_path); - let mut req_builder = configuration - .client - .request(reqwest::Method::POST, &uri_str); - - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("access_token", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("sudo", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("token", value)]); - } - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("X-FORGEJO-OTP", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Authorization", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Sudo", value); - }; - if let Some(ref auth_conf) = configuration.basic_auth { - req_builder = req_builder.basic_auth(auth_conf.0.to_owned(), auth_conf.1.to_owned()); - }; - req_builder = req_builder.json(&p_body_body); - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `String`"))), - ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `String`")))), - } - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -pub async fn render_markup( - configuration: &configuration::Configuration, - body: Option, -) -> Result> { - // add a prefix to parameters to efficiently prevent name collisions - let p_body_body = body; - - let uri_str = format!("{}/markup", configuration.base_path); - let mut req_builder = configuration - .client - .request(reqwest::Method::POST, &uri_str); - - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("access_token", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("sudo", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("token", value)]); - } - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("X-FORGEJO-OTP", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Authorization", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Sudo", value); - }; - if let Some(ref auth_conf) = configuration.basic_auth { - req_builder = req_builder.basic_auth(auth_conf.0.to_owned(), auth_conf.1.to_owned()); - }; - req_builder = req_builder.json(&p_body_body); - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `String`"))), - ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `String`")))), - } - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} diff --git a/src/apis/mod.rs b/src/apis/mod.rs deleted file mode 100644 index 447fc60..0000000 --- a/src/apis/mod.rs +++ /dev/null @@ -1,127 +0,0 @@ -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 fn parse_deep_object(prefix: &str, value: &serde_json::Value) -> Vec<(String, String)> { - if let serde_json::Value::Object(object) = value { - let mut params = vec![]; - - for (key, value) in object { - match value { - serde_json::Value::Object(_) => params.append(&mut parse_deep_object( - &format!("{}[{}]", prefix, key), - value, - )), - serde_json::Value::Array(array) => { - for (i, value) in array.iter().enumerate() { - params.append(&mut parse_deep_object( - &format!("{}[{}][{}]", prefix, key, i), - value, - )); - } - } - serde_json::Value::String(s) => { - params.push((format!("{}[{}]", prefix, key), s.clone())) - } - _ => params.push((format!("{}[{}]", prefix, key), value.to_string())), - } - } - - return params; - } - - unimplemented!("Only objects are supported with style=deepObject") -} - -/// Internal use only -/// A content type supported by this client. -#[allow(dead_code)] -enum ContentType { - Json, - Text, - Unsupported(String), -} - -impl From<&str> for ContentType { - fn from(content_type: &str) -> Self { - if content_type.starts_with("application") && content_type.contains("json") { - return Self::Json; - } else if content_type.starts_with("text/plain") { - return Self::Text; - } else { - return Self::Unsupported(content_type.to_string()); - } - } -} - -pub mod activitypub_api; -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/src/apis/notification_api.rs b/src/apis/notification_api.rs deleted file mode 100644 index 60907c9..0000000 --- a/src/apis/notification_api.rs +++ /dev/null @@ -1,952 +0,0 @@ -/* - * Forgejo API - * - * This documentation describes the Forgejo API. - * - * The version of the OpenAPI document: 14.0.2-2-84240ce3a2+gitea-1.22.0 - * - * Generated by: https://openapi-generator.tech - */ - -use super::{configuration, ContentType, Error}; -use crate::{apis::ResponseContent, models}; -use reqwest; -use serde::{de::Error as _, Deserialize, Serialize}; - -/// 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(models::ApiForbiddenError), - Status404(models::ApiNotFound), - 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(models::ApiForbiddenError), - Status404(models::ApiNotFound), - 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> { - // add a prefix to parameters to efficiently prevent name collisions - let p_query_all = all; - let p_query_status_types = status_types; - let p_query_subject_type = subject_type; - let p_query_since = since; - let p_query_before = before; - let p_query_page = page; - let p_query_limit = limit; - - let uri_str = format!("{}/notifications", configuration.base_path); - let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); - - if let Some(ref param_value) = p_query_all { - req_builder = req_builder.query(&[("all", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_status_types { - req_builder = match "multi" { - "multi" => req_builder.query( - ¶m_value - .into_iter() - .map(|p| ("status-types".to_owned(), p.to_string())) - .collect::>(), - ), - _ => req_builder.query(&[( - "status-types", - ¶m_value - .into_iter() - .map(|p| p.to_string()) - .collect::>() - .join(",") - .to_string(), - )]), - }; - } - if let Some(ref param_value) = p_query_subject_type { - req_builder = match "multi" { - "multi" => req_builder.query( - ¶m_value - .into_iter() - .map(|p| ("subject-type".to_owned(), p.to_string())) - .collect::>(), - ), - _ => req_builder.query(&[( - "subject-type", - ¶m_value - .into_iter() - .map(|p| p.to_string()) - .collect::>() - .join(",") - .to_string(), - )]), - }; - } - if let Some(ref param_value) = p_query_since { - req_builder = req_builder.query(&[("since", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_before { - req_builder = req_builder.query(&[("before", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_page { - req_builder = req_builder.query(&[("page", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_limit { - req_builder = req_builder.query(&[("limit", ¶m_value.to_string())]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("access_token", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("sudo", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("token", value)]); - } - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("X-FORGEJO-OTP", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Authorization", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Sudo", value); - }; - if let Some(ref auth_conf) = configuration.basic_auth { - req_builder = req_builder.basic_auth(auth_conf.0.to_owned(), auth_conf.1.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `Vec<models::NotificationThread>`"))), - ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `Vec<models::NotificationThread>`")))), - } - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -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> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_owner = owner; - let p_path_repo = repo; - let p_query_all = all; - let p_query_status_types = status_types; - let p_query_subject_type = subject_type; - let p_query_since = since; - let p_query_before = before; - let p_query_page = page; - let p_query_limit = limit; - - let uri_str = format!( - "{}/repos/{owner}/{repo}/notifications", - configuration.base_path, - owner = crate::apis::urlencode(p_path_owner), - repo = crate::apis::urlencode(p_path_repo) - ); - let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); - - if let Some(ref param_value) = p_query_all { - req_builder = req_builder.query(&[("all", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_status_types { - req_builder = match "multi" { - "multi" => req_builder.query( - ¶m_value - .into_iter() - .map(|p| ("status-types".to_owned(), p.to_string())) - .collect::>(), - ), - _ => req_builder.query(&[( - "status-types", - ¶m_value - .into_iter() - .map(|p| p.to_string()) - .collect::>() - .join(",") - .to_string(), - )]), - }; - } - if let Some(ref param_value) = p_query_subject_type { - req_builder = match "multi" { - "multi" => req_builder.query( - ¶m_value - .into_iter() - .map(|p| ("subject-type".to_owned(), p.to_string())) - .collect::>(), - ), - _ => req_builder.query(&[( - "subject-type", - ¶m_value - .into_iter() - .map(|p| p.to_string()) - .collect::>() - .join(",") - .to_string(), - )]), - }; - } - if let Some(ref param_value) = p_query_since { - req_builder = req_builder.query(&[("since", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_before { - req_builder = req_builder.query(&[("before", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_page { - req_builder = req_builder.query(&[("page", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_limit { - req_builder = req_builder.query(&[("limit", ¶m_value.to_string())]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("access_token", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("sudo", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("token", value)]); - } - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("X-FORGEJO-OTP", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Authorization", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Sudo", value); - }; - if let Some(ref auth_conf) = configuration.basic_auth { - req_builder = req_builder.basic_auth(auth_conf.0.to_owned(), auth_conf.1.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `Vec<models::NotificationThread>`"))), - ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `Vec<models::NotificationThread>`")))), - } - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -pub async fn notify_get_thread( - configuration: &configuration::Configuration, - id: i64, -) -> Result> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_id = id; - - let uri_str = format!( - "{}/notifications/threads/{id}", - configuration.base_path, - id = p_path_id - ); - let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); - - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("access_token", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("sudo", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("token", value)]); - } - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("X-FORGEJO-OTP", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Authorization", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Sudo", value); - }; - if let Some(ref auth_conf) = configuration.basic_auth { - req_builder = req_builder.basic_auth(auth_conf.0.to_owned(), auth_conf.1.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::NotificationThread`"))), - ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::NotificationThread`")))), - } - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -pub async fn notify_new_available( - configuration: &configuration::Configuration, -) -> Result> { - let uri_str = format!("{}/notifications/new", configuration.base_path); - let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); - - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("access_token", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("sudo", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("token", value)]); - } - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("X-FORGEJO-OTP", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Authorization", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Sudo", value); - }; - if let Some(ref auth_conf) = configuration.basic_auth { - req_builder = req_builder.basic_auth(auth_conf.0.to_owned(), auth_conf.1.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::NotificationCount`"))), - ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::NotificationCount`")))), - } - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -pub async fn notify_read_list( - configuration: &configuration::Configuration, - last_read_at: Option, - all: Option, - status_types: Option>, - to_status: Option<&str>, -) -> Result, Error> { - // add a prefix to parameters to efficiently prevent name collisions - let p_query_last_read_at = last_read_at; - let p_query_all = all; - let p_query_status_types = status_types; - let p_query_to_status = to_status; - - let uri_str = format!("{}/notifications", configuration.base_path); - let mut req_builder = configuration.client.request(reqwest::Method::PUT, &uri_str); - - if let Some(ref param_value) = p_query_last_read_at { - req_builder = req_builder.query(&[("last_read_at", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_all { - req_builder = req_builder.query(&[("all", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_status_types { - req_builder = match "multi" { - "multi" => req_builder.query( - ¶m_value - .into_iter() - .map(|p| ("status-types".to_owned(), p.to_string())) - .collect::>(), - ), - _ => req_builder.query(&[( - "status-types", - ¶m_value - .into_iter() - .map(|p| p.to_string()) - .collect::>() - .join(",") - .to_string(), - )]), - }; - } - if let Some(ref param_value) = p_query_to_status { - req_builder = req_builder.query(&[("to-status", ¶m_value.to_string())]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("access_token", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("sudo", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("token", value)]); - } - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("X-FORGEJO-OTP", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Authorization", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Sudo", value); - }; - if let Some(ref auth_conf) = configuration.basic_auth { - req_builder = req_builder.basic_auth(auth_conf.0.to_owned(), auth_conf.1.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `Vec<models::NotificationThread>`"))), - ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `Vec<models::NotificationThread>`")))), - } - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -pub async fn notify_read_repo_list( - configuration: &configuration::Configuration, - owner: &str, - repo: &str, - all: Option, - status_types: Option>, - to_status: Option<&str>, - last_read_at: Option, -) -> Result, Error> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_owner = owner; - let p_path_repo = repo; - let p_query_all = all; - let p_query_status_types = status_types; - let p_query_to_status = to_status; - let p_query_last_read_at = last_read_at; - - let uri_str = format!( - "{}/repos/{owner}/{repo}/notifications", - configuration.base_path, - owner = crate::apis::urlencode(p_path_owner), - repo = crate::apis::urlencode(p_path_repo) - ); - let mut req_builder = configuration.client.request(reqwest::Method::PUT, &uri_str); - - if let Some(ref param_value) = p_query_all { - req_builder = req_builder.query(&[("all", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_status_types { - req_builder = match "multi" { - "multi" => req_builder.query( - ¶m_value - .into_iter() - .map(|p| ("status-types".to_owned(), p.to_string())) - .collect::>(), - ), - _ => req_builder.query(&[( - "status-types", - ¶m_value - .into_iter() - .map(|p| p.to_string()) - .collect::>() - .join(",") - .to_string(), - )]), - }; - } - if let Some(ref param_value) = p_query_to_status { - req_builder = req_builder.query(&[("to-status", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_last_read_at { - req_builder = req_builder.query(&[("last_read_at", ¶m_value.to_string())]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("access_token", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("sudo", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("token", value)]); - } - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("X-FORGEJO-OTP", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Authorization", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Sudo", value); - }; - if let Some(ref auth_conf) = configuration.basic_auth { - req_builder = req_builder.basic_auth(auth_conf.0.to_owned(), auth_conf.1.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `Vec<models::NotificationThread>`"))), - ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `Vec<models::NotificationThread>`")))), - } - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -pub async fn notify_read_thread( - configuration: &configuration::Configuration, - id: i64, - to_status: Option<&str>, -) -> Result> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_id = id; - let p_query_to_status = to_status; - - let uri_str = format!( - "{}/notifications/threads/{id}", - configuration.base_path, - id = p_path_id - ); - let mut req_builder = configuration - .client - .request(reqwest::Method::PATCH, &uri_str); - - if let Some(ref param_value) = p_query_to_status { - req_builder = req_builder.query(&[("to-status", ¶m_value.to_string())]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("access_token", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("sudo", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("token", value)]); - } - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("X-FORGEJO-OTP", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Authorization", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Sudo", value); - }; - if let Some(ref auth_conf) = configuration.basic_auth { - req_builder = req_builder.basic_auth(auth_conf.0.to_owned(), auth_conf.1.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::NotificationThread`"))), - ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::NotificationThread`")))), - } - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} diff --git a/src/apis/organization_api.rs b/src/apis/organization_api.rs deleted file mode 100644 index 92dd277..0000000 --- a/src/apis/organization_api.rs +++ /dev/null @@ -1,7066 +0,0 @@ -/* - * Forgejo API - * - * This documentation describes the Forgejo API. - * - * The version of the OpenAPI document: 14.0.2-2-84240ce3a2+gitea-1.22.0 - * - * Generated by: https://openapi-generator.tech - */ - -use super::{configuration, ContentType, Error}; -use crate::{apis::ResponseContent, models}; -use reqwest; -use serde::{de::Error as _, Deserialize, Serialize}; - -/// struct for typed errors of method [`create_org_repo`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum CreateOrgRepoError { - Status400(models::ApiError), - Status403(models::ApiForbiddenError), - Status404(models::ApiNotFound), - 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(models::ApiForbiddenError), - Status404(models::ApiNotFound), - Status422(models::ApiValidationError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`create_org_variable`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum CreateOrgVariableError { - Status400(models::ApiError), - Status404(models::ApiNotFound), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`delete_org_secret`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum DeleteOrgSecretError { - Status400(models::ApiError), - Status404(models::ApiNotFound), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`delete_org_variable`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum DeleteOrgVariableError { - Status400(models::ApiError), - Status404(models::ApiNotFound), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`get_org_variable`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum GetOrgVariableError { - Status400(models::ApiError), - Status404(models::ApiNotFound), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`get_org_variables_list`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum GetOrgVariablesListError { - Status400(models::ApiError), - Status404(models::ApiNotFound), - 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(models::ApiNotFound), - 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(models::ApiForbiddenError), - Status404(models::ApiNotFound), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`org_block_user`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum OrgBlockUserError { - Status404(models::ApiNotFound), - Status422(models::ApiValidationError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`org_check_quota`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum OrgCheckQuotaError { - Status403(models::ApiForbiddenError), - Status404(models::ApiNotFound), - Status422(models::ApiValidationError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`org_conceal_member`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum OrgConcealMemberError { - Status403(models::ApiForbiddenError), - Status404(models::ApiNotFound), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`org_create`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum OrgCreateError { - Status403(models::ApiForbiddenError), - Status422(models::ApiValidationError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`org_create_hook`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum OrgCreateHookError { - Status404(models::ApiNotFound), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`org_create_label`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum OrgCreateLabelError { - Status404(models::ApiNotFound), - Status422(models::ApiValidationError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`org_create_team`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum OrgCreateTeamError { - Status404(models::ApiNotFound), - Status422(models::ApiValidationError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`org_delete`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum OrgDeleteError { - Status404(models::ApiNotFound), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`org_delete_avatar`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum OrgDeleteAvatarError { - Status404(models::ApiNotFound), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`org_delete_hook`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum OrgDeleteHookError { - Status404(models::ApiNotFound), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`org_delete_label`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum OrgDeleteLabelError { - Status404(models::ApiNotFound), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`org_delete_member`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum OrgDeleteMemberError { - Status404(models::ApiNotFound), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`org_delete_team`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum OrgDeleteTeamError { - Status404(models::ApiNotFound), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`org_edit`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum OrgEditError { - Status404(models::ApiNotFound), - Status422(models::ApiError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`org_edit_hook`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum OrgEditHookError { - Status404(models::ApiNotFound), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`org_edit_label`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum OrgEditLabelError { - Status404(models::ApiNotFound), - Status422(models::ApiValidationError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`org_edit_team`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum OrgEditTeamError { - Status404(models::ApiNotFound), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`org_get`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum OrgGetError { - Status404(models::ApiNotFound), - 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 { - Status404(models::ApiNotFound), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`org_get_label`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum OrgGetLabelError { - Status404(models::ApiNotFound), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`org_get_quota`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum OrgGetQuotaError { - Status403(models::ApiForbiddenError), - Status404(models::ApiNotFound), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`org_get_runner_registration_token`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum OrgGetRunnerRegistrationTokenError { - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`org_get_team`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum OrgGetTeamError { - Status404(models::ApiNotFound), - 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(models::ApiForbiddenError), - Status404(models::ApiNotFound), - 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_actions_secrets`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum OrgListActionsSecretsError { - Status404(models::ApiNotFound), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`org_list_activity_feeds`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum OrgListActivityFeedsError { - Status404(models::ApiNotFound), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`org_list_blocked_users`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum OrgListBlockedUsersError { - 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 { - Status401(models::ApiUnauthorizedError), - Status403(models::ApiForbiddenError), - Status404(models::ApiNotFound), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`org_list_hooks`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum OrgListHooksError { - Status404(models::ApiNotFound), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`org_list_labels`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum OrgListLabelsError { - Status404(models::ApiNotFound), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`org_list_members`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum OrgListMembersError { - Status404(models::ApiNotFound), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`org_list_public_members`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum OrgListPublicMembersError { - Status404(models::ApiNotFound), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`org_list_quota_artifacts`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum OrgListQuotaArtifactsError { - Status403(models::ApiForbiddenError), - Status404(models::ApiNotFound), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`org_list_quota_attachments`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum OrgListQuotaAttachmentsError { - Status403(models::ApiForbiddenError), - Status404(models::ApiNotFound), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`org_list_quota_packages`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum OrgListQuotaPackagesError { - Status403(models::ApiForbiddenError), - Status404(models::ApiNotFound), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`org_list_repos`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum OrgListReposError { - Status404(models::ApiNotFound), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`org_list_team_activity_feeds`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum OrgListTeamActivityFeedsError { - Status404(models::ApiNotFound), - 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(models::ApiNotFound), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`org_list_team_members`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum OrgListTeamMembersError { - Status404(models::ApiNotFound), - 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(models::ApiNotFound), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`org_list_team_repos`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum OrgListTeamReposError { - Status404(models::ApiNotFound), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`org_list_teams`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum OrgListTeamsError { - Status404(models::ApiNotFound), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`org_list_user_orgs`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum OrgListUserOrgsError { - Status404(models::ApiNotFound), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`org_publicize_member`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum OrgPublicizeMemberError { - Status403(models::ApiForbiddenError), - Status404(models::ApiNotFound), - 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(models::ApiNotFound), - 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(models::ApiForbiddenError), - Status404(models::ApiNotFound), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`org_search_run_jobs`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum OrgSearchRunJobsError { - Status403(models::ApiForbiddenError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`org_unblock_user`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum OrgUnblockUserError { - Status404(models::ApiNotFound), - Status422(models::ApiValidationError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`org_update_avatar`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum OrgUpdateAvatarError { - Status404(models::ApiNotFound), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`rename_org`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum RenameOrgError { - Status403(models::ApiForbiddenError), - Status422(models::ApiValidationError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`team_search`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum TeamSearchError { - Status404(models::ApiNotFound), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`update_org_secret`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum UpdateOrgSecretError { - Status400(models::ApiError), - Status404(models::ApiNotFound), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`update_org_variable`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum UpdateOrgVariableError { - Status400(models::ApiError), - Status404(models::ApiNotFound), - UnknownValue(serde_json::Value), -} - -pub async fn create_org_repo( - configuration: &configuration::Configuration, - org: &str, - body: Option, -) -> Result> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_org = org; - let p_body_body = body; - - let uri_str = format!( - "{}/orgs/{org}/repos", - configuration.base_path, - org = crate::apis::urlencode(p_path_org) - ); - let mut req_builder = configuration - .client - .request(reqwest::Method::POST, &uri_str); - - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("access_token", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("sudo", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("token", value)]); - } - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("X-FORGEJO-OTP", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Authorization", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Sudo", value); - }; - if let Some(ref auth_conf) = configuration.basic_auth { - req_builder = req_builder.basic_auth(auth_conf.0.to_owned(), auth_conf.1.to_owned()); - }; - req_builder = req_builder.json(&p_body_body); - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::Repository`"))), - ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::Repository`")))), - } - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -#[deprecated] -pub async fn create_org_repo_deprecated( - configuration: &configuration::Configuration, - org: &str, - body: Option, -) -> Result> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_org = org; - let p_body_body = body; - - let uri_str = format!( - "{}/org/{org}/repos", - configuration.base_path, - org = crate::apis::urlencode(p_path_org) - ); - let mut req_builder = configuration - .client - .request(reqwest::Method::POST, &uri_str); - - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("access_token", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("sudo", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("token", value)]); - } - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("X-FORGEJO-OTP", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Authorization", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Sudo", value); - }; - if let Some(ref auth_conf) = configuration.basic_auth { - req_builder = req_builder.basic_auth(auth_conf.0.to_owned(), auth_conf.1.to_owned()); - }; - req_builder = req_builder.json(&p_body_body); - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::Repository`"))), - ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::Repository`")))), - } - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -pub async fn create_org_variable( - configuration: &configuration::Configuration, - org: &str, - variablename: &str, - body: Option, -) -> Result<(), Error> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_org = org; - let p_path_variablename = variablename; - let p_body_body = body; - - let uri_str = format!( - "{}/orgs/{org}/actions/variables/{variablename}", - configuration.base_path, - org = crate::apis::urlencode(p_path_org), - variablename = crate::apis::urlencode(p_path_variablename) - ); - let mut req_builder = configuration - .client - .request(reqwest::Method::POST, &uri_str); - - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("access_token", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("sudo", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("token", value)]); - } - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("X-FORGEJO-OTP", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Authorization", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Sudo", value); - }; - if let Some(ref auth_conf) = configuration.basic_auth { - req_builder = req_builder.basic_auth(auth_conf.0.to_owned(), auth_conf.1.to_owned()); - }; - req_builder = req_builder.json(&p_body_body); - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - - if !status.is_client_error() && !status.is_server_error() { - Ok(()) - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -pub async fn delete_org_secret( - configuration: &configuration::Configuration, - org: &str, - secretname: &str, -) -> Result<(), Error> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_org = org; - let p_path_secretname = secretname; - - let uri_str = format!( - "{}/orgs/{org}/actions/secrets/{secretname}", - configuration.base_path, - org = crate::apis::urlencode(p_path_org), - secretname = crate::apis::urlencode(p_path_secretname) - ); - let mut req_builder = configuration - .client - .request(reqwest::Method::DELETE, &uri_str); - - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("access_token", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("sudo", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("token", value)]); - } - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("X-FORGEJO-OTP", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Authorization", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Sudo", value); - }; - if let Some(ref auth_conf) = configuration.basic_auth { - req_builder = req_builder.basic_auth(auth_conf.0.to_owned(), auth_conf.1.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - - if !status.is_client_error() && !status.is_server_error() { - Ok(()) - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -pub async fn delete_org_variable( - configuration: &configuration::Configuration, - org: &str, - variablename: &str, -) -> Result<(), Error> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_org = org; - let p_path_variablename = variablename; - - let uri_str = format!( - "{}/orgs/{org}/actions/variables/{variablename}", - configuration.base_path, - org = crate::apis::urlencode(p_path_org), - variablename = crate::apis::urlencode(p_path_variablename) - ); - let mut req_builder = configuration - .client - .request(reqwest::Method::DELETE, &uri_str); - - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("access_token", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("sudo", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("token", value)]); - } - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("X-FORGEJO-OTP", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Authorization", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Sudo", value); - }; - if let Some(ref auth_conf) = configuration.basic_auth { - req_builder = req_builder.basic_auth(auth_conf.0.to_owned(), auth_conf.1.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - - if !status.is_client_error() && !status.is_server_error() { - Ok(()) - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -pub async fn get_org_variable( - configuration: &configuration::Configuration, - org: &str, - variablename: &str, -) -> Result> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_org = org; - let p_path_variablename = variablename; - - let uri_str = format!( - "{}/orgs/{org}/actions/variables/{variablename}", - configuration.base_path, - org = crate::apis::urlencode(p_path_org), - variablename = crate::apis::urlencode(p_path_variablename) - ); - let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); - - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("access_token", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("sudo", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("token", value)]); - } - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("X-FORGEJO-OTP", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Authorization", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Sudo", value); - }; - if let Some(ref auth_conf) = configuration.basic_auth { - req_builder = req_builder.basic_auth(auth_conf.0.to_owned(), auth_conf.1.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::ActionVariable`"))), - ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::ActionVariable`")))), - } - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -pub async fn get_org_variables_list( - configuration: &configuration::Configuration, - org: &str, - page: Option, - limit: Option, -) -> Result, Error> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_org = org; - let p_query_page = page; - let p_query_limit = limit; - - let uri_str = format!( - "{}/orgs/{org}/actions/variables", - configuration.base_path, - org = crate::apis::urlencode(p_path_org) - ); - let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); - - if let Some(ref param_value) = p_query_page { - req_builder = req_builder.query(&[("page", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_limit { - req_builder = req_builder.query(&[("limit", ¶m_value.to_string())]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("access_token", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("sudo", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("token", value)]); - } - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("X-FORGEJO-OTP", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Authorization", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Sudo", value); - }; - if let Some(ref auth_conf) = configuration.basic_auth { - req_builder = req_builder.basic_auth(auth_conf.0.to_owned(), auth_conf.1.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `Vec<models::ActionVariable>`"))), - ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `Vec<models::ActionVariable>`")))), - } - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -pub async fn org_add_team_member( - configuration: &configuration::Configuration, - id: i64, - username: &str, -) -> Result<(), Error> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_id = id; - let p_path_username = username; - - let uri_str = format!( - "{}/teams/{id}/members/{username}", - configuration.base_path, - id = p_path_id, - username = crate::apis::urlencode(p_path_username) - ); - let mut req_builder = configuration.client.request(reqwest::Method::PUT, &uri_str); - - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("access_token", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("sudo", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("token", value)]); - } - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("X-FORGEJO-OTP", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Authorization", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Sudo", value); - }; - if let Some(ref auth_conf) = configuration.basic_auth { - req_builder = req_builder.basic_auth(auth_conf.0.to_owned(), auth_conf.1.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - - if !status.is_client_error() && !status.is_server_error() { - Ok(()) - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -pub async fn org_add_team_repository( - configuration: &configuration::Configuration, - id: i64, - org: &str, - repo: &str, -) -> Result<(), Error> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_id = id; - let p_path_org = org; - let p_path_repo = repo; - - let uri_str = format!( - "{}/teams/{id}/repos/{org}/{repo}", - configuration.base_path, - id = p_path_id, - org = crate::apis::urlencode(p_path_org), - repo = crate::apis::urlencode(p_path_repo) - ); - let mut req_builder = configuration.client.request(reqwest::Method::PUT, &uri_str); - - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("access_token", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("sudo", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("token", value)]); - } - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("X-FORGEJO-OTP", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Authorization", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Sudo", value); - }; - if let Some(ref auth_conf) = configuration.basic_auth { - req_builder = req_builder.basic_auth(auth_conf.0.to_owned(), auth_conf.1.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - - if !status.is_client_error() && !status.is_server_error() { - Ok(()) - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -pub async fn org_block_user( - configuration: &configuration::Configuration, - org: &str, - username: &str, -) -> Result<(), Error> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_org = org; - let p_path_username = username; - - let uri_str = format!( - "{}/orgs/{org}/block/{username}", - configuration.base_path, - org = crate::apis::urlencode(p_path_org), - username = crate::apis::urlencode(p_path_username) - ); - let mut req_builder = configuration.client.request(reqwest::Method::PUT, &uri_str); - - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("access_token", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("sudo", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("token", value)]); - } - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("X-FORGEJO-OTP", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Authorization", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Sudo", value); - }; - if let Some(ref auth_conf) = configuration.basic_auth { - req_builder = req_builder.basic_auth(auth_conf.0.to_owned(), auth_conf.1.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - - if !status.is_client_error() && !status.is_server_error() { - Ok(()) - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -pub async fn org_check_quota( - configuration: &configuration::Configuration, - org: &str, - subject: &str, -) -> Result> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_org = org; - let p_query_subject = subject; - - let uri_str = format!( - "{}/orgs/{org}/quota/check", - configuration.base_path, - org = crate::apis::urlencode(p_path_org) - ); - let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); - - req_builder = req_builder.query(&[("subject", &p_query_subject.to_string())]); - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("access_token", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("sudo", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("token", value)]); - } - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("X-FORGEJO-OTP", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Authorization", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Sudo", value); - }; - if let Some(ref auth_conf) = configuration.basic_auth { - req_builder = req_builder.basic_auth(auth_conf.0.to_owned(), auth_conf.1.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `bool`"))), - ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `bool`")))), - } - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -pub async fn org_conceal_member( - configuration: &configuration::Configuration, - org: &str, - username: &str, -) -> Result<(), Error> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_org = org; - let p_path_username = username; - - let uri_str = format!( - "{}/orgs/{org}/public_members/{username}", - configuration.base_path, - org = crate::apis::urlencode(p_path_org), - username = crate::apis::urlencode(p_path_username) - ); - let mut req_builder = configuration - .client - .request(reqwest::Method::DELETE, &uri_str); - - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("access_token", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("sudo", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("token", value)]); - } - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("X-FORGEJO-OTP", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Authorization", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Sudo", value); - }; - if let Some(ref auth_conf) = configuration.basic_auth { - req_builder = req_builder.basic_auth(auth_conf.0.to_owned(), auth_conf.1.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - - if !status.is_client_error() && !status.is_server_error() { - Ok(()) - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -pub async fn org_create( - configuration: &configuration::Configuration, - organization: models::CreateOrgOption, -) -> Result> { - // add a prefix to parameters to efficiently prevent name collisions - let p_body_organization = organization; - - let uri_str = format!("{}/orgs", configuration.base_path); - let mut req_builder = configuration - .client - .request(reqwest::Method::POST, &uri_str); - - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("access_token", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("sudo", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("token", value)]); - } - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("X-FORGEJO-OTP", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Authorization", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Sudo", value); - }; - if let Some(ref auth_conf) = configuration.basic_auth { - req_builder = req_builder.basic_auth(auth_conf.0.to_owned(), auth_conf.1.to_owned()); - }; - req_builder = req_builder.json(&p_body_organization); - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::Organization`"))), - ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::Organization`")))), - } - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -pub async fn org_create_hook( - configuration: &configuration::Configuration, - org: &str, - body: models::CreateHookOption, -) -> Result> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_org = org; - let p_body_body = body; - - let uri_str = format!( - "{}/orgs/{org}/hooks", - configuration.base_path, - org = crate::apis::urlencode(p_path_org) - ); - let mut req_builder = configuration - .client - .request(reqwest::Method::POST, &uri_str); - - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("access_token", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("sudo", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("token", value)]); - } - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("X-FORGEJO-OTP", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Authorization", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Sudo", value); - }; - if let Some(ref auth_conf) = configuration.basic_auth { - req_builder = req_builder.basic_auth(auth_conf.0.to_owned(), auth_conf.1.to_owned()); - }; - req_builder = req_builder.json(&p_body_body); - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::Hook`"))), - ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::Hook`")))), - } - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -pub async fn org_create_label( - configuration: &configuration::Configuration, - org: &str, - body: Option, -) -> Result> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_org = org; - let p_body_body = body; - - let uri_str = format!( - "{}/orgs/{org}/labels", - configuration.base_path, - org = crate::apis::urlencode(p_path_org) - ); - let mut req_builder = configuration - .client - .request(reqwest::Method::POST, &uri_str); - - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("access_token", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("sudo", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("token", value)]); - } - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("X-FORGEJO-OTP", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Authorization", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Sudo", value); - }; - if let Some(ref auth_conf) = configuration.basic_auth { - req_builder = req_builder.basic_auth(auth_conf.0.to_owned(), auth_conf.1.to_owned()); - }; - req_builder = req_builder.json(&p_body_body); - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::Label`"))), - ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::Label`")))), - } - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -pub async fn org_create_team( - configuration: &configuration::Configuration, - org: &str, - body: Option, -) -> Result> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_org = org; - let p_body_body = body; - - let uri_str = format!( - "{}/orgs/{org}/teams", - configuration.base_path, - org = crate::apis::urlencode(p_path_org) - ); - let mut req_builder = configuration - .client - .request(reqwest::Method::POST, &uri_str); - - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("access_token", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("sudo", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("token", value)]); - } - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("X-FORGEJO-OTP", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Authorization", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Sudo", value); - }; - if let Some(ref auth_conf) = configuration.basic_auth { - req_builder = req_builder.basic_auth(auth_conf.0.to_owned(), auth_conf.1.to_owned()); - }; - req_builder = req_builder.json(&p_body_body); - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::Team`"))), - ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::Team`")))), - } - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -pub async fn org_delete( - configuration: &configuration::Configuration, - org: &str, -) -> Result<(), Error> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_org = org; - - let uri_str = format!( - "{}/orgs/{org}", - configuration.base_path, - org = crate::apis::urlencode(p_path_org) - ); - let mut req_builder = configuration - .client - .request(reqwest::Method::DELETE, &uri_str); - - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("access_token", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("sudo", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("token", value)]); - } - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("X-FORGEJO-OTP", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Authorization", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Sudo", value); - }; - if let Some(ref auth_conf) = configuration.basic_auth { - req_builder = req_builder.basic_auth(auth_conf.0.to_owned(), auth_conf.1.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - - if !status.is_client_error() && !status.is_server_error() { - Ok(()) - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -pub async fn org_delete_avatar( - configuration: &configuration::Configuration, - org: &str, -) -> Result<(), Error> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_org = org; - - let uri_str = format!( - "{}/orgs/{org}/avatar", - configuration.base_path, - org = crate::apis::urlencode(p_path_org) - ); - let mut req_builder = configuration - .client - .request(reqwest::Method::DELETE, &uri_str); - - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("access_token", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("sudo", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("token", value)]); - } - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("X-FORGEJO-OTP", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Authorization", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Sudo", value); - }; - if let Some(ref auth_conf) = configuration.basic_auth { - req_builder = req_builder.basic_auth(auth_conf.0.to_owned(), auth_conf.1.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - - if !status.is_client_error() && !status.is_server_error() { - Ok(()) - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -pub async fn org_delete_hook( - configuration: &configuration::Configuration, - org: &str, - id: i64, -) -> Result<(), Error> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_org = org; - let p_path_id = id; - - let uri_str = format!( - "{}/orgs/{org}/hooks/{id}", - configuration.base_path, - org = crate::apis::urlencode(p_path_org), - id = p_path_id - ); - let mut req_builder = configuration - .client - .request(reqwest::Method::DELETE, &uri_str); - - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("access_token", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("sudo", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("token", value)]); - } - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("X-FORGEJO-OTP", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Authorization", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Sudo", value); - }; - if let Some(ref auth_conf) = configuration.basic_auth { - req_builder = req_builder.basic_auth(auth_conf.0.to_owned(), auth_conf.1.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - - if !status.is_client_error() && !status.is_server_error() { - Ok(()) - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -pub async fn org_delete_label( - configuration: &configuration::Configuration, - org: &str, - id: i64, -) -> Result<(), Error> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_org = org; - let p_path_id = id; - - let uri_str = format!( - "{}/orgs/{org}/labels/{id}", - configuration.base_path, - org = crate::apis::urlencode(p_path_org), - id = p_path_id - ); - let mut req_builder = configuration - .client - .request(reqwest::Method::DELETE, &uri_str); - - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("access_token", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("sudo", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("token", value)]); - } - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("X-FORGEJO-OTP", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Authorization", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Sudo", value); - }; - if let Some(ref auth_conf) = configuration.basic_auth { - req_builder = req_builder.basic_auth(auth_conf.0.to_owned(), auth_conf.1.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - - if !status.is_client_error() && !status.is_server_error() { - Ok(()) - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -pub async fn org_delete_member( - configuration: &configuration::Configuration, - org: &str, - username: &str, -) -> Result<(), Error> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_org = org; - let p_path_username = username; - - let uri_str = format!( - "{}/orgs/{org}/members/{username}", - configuration.base_path, - org = crate::apis::urlencode(p_path_org), - username = crate::apis::urlencode(p_path_username) - ); - let mut req_builder = configuration - .client - .request(reqwest::Method::DELETE, &uri_str); - - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("access_token", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("sudo", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("token", value)]); - } - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("X-FORGEJO-OTP", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Authorization", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Sudo", value); - }; - if let Some(ref auth_conf) = configuration.basic_auth { - req_builder = req_builder.basic_auth(auth_conf.0.to_owned(), auth_conf.1.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - - if !status.is_client_error() && !status.is_server_error() { - Ok(()) - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -pub async fn org_delete_team( - configuration: &configuration::Configuration, - id: i64, -) -> Result<(), Error> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_id = id; - - let uri_str = format!("{}/teams/{id}", configuration.base_path, id = p_path_id); - let mut req_builder = configuration - .client - .request(reqwest::Method::DELETE, &uri_str); - - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("access_token", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("sudo", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("token", value)]); - } - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("X-FORGEJO-OTP", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Authorization", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Sudo", value); - }; - if let Some(ref auth_conf) = configuration.basic_auth { - req_builder = req_builder.basic_auth(auth_conf.0.to_owned(), auth_conf.1.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - - if !status.is_client_error() && !status.is_server_error() { - Ok(()) - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -pub async fn org_edit( - configuration: &configuration::Configuration, - org: &str, - body: models::EditOrgOption, -) -> Result> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_org = org; - let p_body_body = body; - - let uri_str = format!( - "{}/orgs/{org}", - configuration.base_path, - org = crate::apis::urlencode(p_path_org) - ); - let mut req_builder = configuration - .client - .request(reqwest::Method::PATCH, &uri_str); - - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("access_token", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("sudo", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("token", value)]); - } - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("X-FORGEJO-OTP", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Authorization", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Sudo", value); - }; - if let Some(ref auth_conf) = configuration.basic_auth { - req_builder = req_builder.basic_auth(auth_conf.0.to_owned(), auth_conf.1.to_owned()); - }; - req_builder = req_builder.json(&p_body_body); - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::Organization`"))), - ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::Organization`")))), - } - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -pub async fn org_edit_hook( - configuration: &configuration::Configuration, - org: &str, - id: i64, - body: Option, -) -> Result> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_org = org; - let p_path_id = id; - let p_body_body = body; - - let uri_str = format!( - "{}/orgs/{org}/hooks/{id}", - configuration.base_path, - org = crate::apis::urlencode(p_path_org), - id = p_path_id - ); - let mut req_builder = configuration - .client - .request(reqwest::Method::PATCH, &uri_str); - - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("access_token", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("sudo", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("token", value)]); - } - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("X-FORGEJO-OTP", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Authorization", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Sudo", value); - }; - if let Some(ref auth_conf) = configuration.basic_auth { - req_builder = req_builder.basic_auth(auth_conf.0.to_owned(), auth_conf.1.to_owned()); - }; - req_builder = req_builder.json(&p_body_body); - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::Hook`"))), - ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::Hook`")))), - } - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -pub async fn org_edit_label( - configuration: &configuration::Configuration, - org: &str, - id: i64, - body: Option, -) -> Result> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_org = org; - let p_path_id = id; - let p_body_body = body; - - let uri_str = format!( - "{}/orgs/{org}/labels/{id}", - configuration.base_path, - org = crate::apis::urlencode(p_path_org), - id = p_path_id - ); - let mut req_builder = configuration - .client - .request(reqwest::Method::PATCH, &uri_str); - - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("access_token", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("sudo", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("token", value)]); - } - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("X-FORGEJO-OTP", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Authorization", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Sudo", value); - }; - if let Some(ref auth_conf) = configuration.basic_auth { - req_builder = req_builder.basic_auth(auth_conf.0.to_owned(), auth_conf.1.to_owned()); - }; - req_builder = req_builder.json(&p_body_body); - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::Label`"))), - ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::Label`")))), - } - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -pub async fn org_edit_team( - configuration: &configuration::Configuration, - id: i64, - body: Option, -) -> Result> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_id = id; - let p_body_body = body; - - let uri_str = format!("{}/teams/{id}", configuration.base_path, id = p_path_id); - let mut req_builder = configuration - .client - .request(reqwest::Method::PATCH, &uri_str); - - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("access_token", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("sudo", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("token", value)]); - } - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("X-FORGEJO-OTP", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Authorization", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Sudo", value); - }; - if let Some(ref auth_conf) = configuration.basic_auth { - req_builder = req_builder.basic_auth(auth_conf.0.to_owned(), auth_conf.1.to_owned()); - }; - req_builder = req_builder.json(&p_body_body); - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::Team`"))), - ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::Team`")))), - } - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -pub async fn org_get( - configuration: &configuration::Configuration, - org: &str, -) -> Result> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_org = org; - - let uri_str = format!( - "{}/orgs/{org}", - configuration.base_path, - org = crate::apis::urlencode(p_path_org) - ); - let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); - - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("access_token", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("sudo", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("token", value)]); - } - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("X-FORGEJO-OTP", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Authorization", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Sudo", value); - }; - if let Some(ref auth_conf) = configuration.basic_auth { - req_builder = req_builder.basic_auth(auth_conf.0.to_owned(), auth_conf.1.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::Organization`"))), - ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::Organization`")))), - } - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -pub async fn org_get_all( - configuration: &configuration::Configuration, - page: Option, - limit: Option, -) -> Result, Error> { - // add a prefix to parameters to efficiently prevent name collisions - let p_query_page = page; - let p_query_limit = limit; - - let uri_str = format!("{}/orgs", configuration.base_path); - let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); - - if let Some(ref param_value) = p_query_page { - req_builder = req_builder.query(&[("page", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_limit { - req_builder = req_builder.query(&[("limit", ¶m_value.to_string())]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("access_token", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("sudo", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("token", value)]); - } - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("X-FORGEJO-OTP", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Authorization", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Sudo", value); - }; - if let Some(ref auth_conf) = configuration.basic_auth { - req_builder = req_builder.basic_auth(auth_conf.0.to_owned(), auth_conf.1.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `Vec<models::Organization>`"))), - ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `Vec<models::Organization>`")))), - } - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -pub async fn org_get_hook( - configuration: &configuration::Configuration, - org: &str, - id: i64, -) -> Result> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_org = org; - let p_path_id = id; - - let uri_str = format!( - "{}/orgs/{org}/hooks/{id}", - configuration.base_path, - org = crate::apis::urlencode(p_path_org), - id = p_path_id - ); - let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); - - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("access_token", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("sudo", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("token", value)]); - } - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("X-FORGEJO-OTP", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Authorization", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Sudo", value); - }; - if let Some(ref auth_conf) = configuration.basic_auth { - req_builder = req_builder.basic_auth(auth_conf.0.to_owned(), auth_conf.1.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::Hook`"))), - ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::Hook`")))), - } - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -pub async fn org_get_label( - configuration: &configuration::Configuration, - org: &str, - id: i64, -) -> Result> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_org = org; - let p_path_id = id; - - let uri_str = format!( - "{}/orgs/{org}/labels/{id}", - configuration.base_path, - org = crate::apis::urlencode(p_path_org), - id = p_path_id - ); - let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); - - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("access_token", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("sudo", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("token", value)]); - } - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("X-FORGEJO-OTP", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Authorization", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Sudo", value); - }; - if let Some(ref auth_conf) = configuration.basic_auth { - req_builder = req_builder.basic_auth(auth_conf.0.to_owned(), auth_conf.1.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::Label`"))), - ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::Label`")))), - } - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -pub async fn org_get_quota( - configuration: &configuration::Configuration, - org: &str, -) -> Result> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_org = org; - - let uri_str = format!( - "{}/orgs/{org}/quota", - configuration.base_path, - org = crate::apis::urlencode(p_path_org) - ); - let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); - - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("access_token", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("sudo", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("token", value)]); - } - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("X-FORGEJO-OTP", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Authorization", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Sudo", value); - }; - if let Some(ref auth_conf) = configuration.basic_auth { - req_builder = req_builder.basic_auth(auth_conf.0.to_owned(), auth_conf.1.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::QuotaInfo`"))), - ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::QuotaInfo`")))), - } - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -pub async fn org_get_runner_registration_token( - configuration: &configuration::Configuration, - org: &str, -) -> Result> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_org = org; - - let uri_str = format!( - "{}/orgs/{org}/actions/runners/registration-token", - configuration.base_path, - org = crate::apis::urlencode(p_path_org) - ); - let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); - - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("access_token", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("sudo", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("token", value)]); - } - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("X-FORGEJO-OTP", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Authorization", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Sudo", value); - }; - if let Some(ref auth_conf) = configuration.basic_auth { - req_builder = req_builder.basic_auth(auth_conf.0.to_owned(), auth_conf.1.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::RegistrationToken`"))), - ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::RegistrationToken`")))), - } - } else { - let content = resp.text().await?; - let entity: Option = - serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -pub async fn org_get_team( - configuration: &configuration::Configuration, - id: i64, -) -> Result> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_id = id; - - let uri_str = format!("{}/teams/{id}", configuration.base_path, id = p_path_id); - let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); - - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("access_token", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("sudo", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("token", value)]); - } - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("X-FORGEJO-OTP", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Authorization", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Sudo", value); - }; - if let Some(ref auth_conf) = configuration.basic_auth { - req_builder = req_builder.basic_auth(auth_conf.0.to_owned(), auth_conf.1.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::Team`"))), - ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::Team`")))), - } - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -pub async fn org_get_user_permissions( - configuration: &configuration::Configuration, - username: &str, - org: &str, -) -> Result> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_username = username; - let p_path_org = org; - - let uri_str = format!( - "{}/users/{username}/orgs/{org}/permissions", - configuration.base_path, - username = crate::apis::urlencode(p_path_username), - org = crate::apis::urlencode(p_path_org) - ); - let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); - - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("access_token", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("sudo", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("token", value)]); - } - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("X-FORGEJO-OTP", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Authorization", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Sudo", value); - }; - if let Some(ref auth_conf) = configuration.basic_auth { - req_builder = req_builder.basic_auth(auth_conf.0.to_owned(), auth_conf.1.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::OrganizationPermissions`"))), - ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::OrganizationPermissions`")))), - } - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -pub async fn org_is_member( - configuration: &configuration::Configuration, - org: &str, - username: &str, -) -> Result<(), Error> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_org = org; - let p_path_username = username; - - let uri_str = format!( - "{}/orgs/{org}/members/{username}", - configuration.base_path, - org = crate::apis::urlencode(p_path_org), - username = crate::apis::urlencode(p_path_username) - ); - let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); - - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("access_token", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("sudo", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("token", value)]); - } - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("X-FORGEJO-OTP", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Authorization", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Sudo", value); - }; - if let Some(ref auth_conf) = configuration.basic_auth { - req_builder = req_builder.basic_auth(auth_conf.0.to_owned(), auth_conf.1.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - - if !status.is_client_error() && !status.is_server_error() { - Ok(()) - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -pub async fn org_is_public_member( - configuration: &configuration::Configuration, - org: &str, - username: &str, -) -> Result<(), Error> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_org = org; - let p_path_username = username; - - let uri_str = format!( - "{}/orgs/{org}/public_members/{username}", - configuration.base_path, - org = crate::apis::urlencode(p_path_org), - username = crate::apis::urlencode(p_path_username) - ); - let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); - - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("access_token", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("sudo", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("token", value)]); - } - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("X-FORGEJO-OTP", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Authorization", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Sudo", value); - }; - if let Some(ref auth_conf) = configuration.basic_auth { - req_builder = req_builder.basic_auth(auth_conf.0.to_owned(), auth_conf.1.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - - if !status.is_client_error() && !status.is_server_error() { - Ok(()) - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -pub async fn org_list_actions_secrets( - configuration: &configuration::Configuration, - org: &str, - page: Option, - limit: Option, -) -> Result, Error> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_org = org; - let p_query_page = page; - let p_query_limit = limit; - - let uri_str = format!( - "{}/orgs/{org}/actions/secrets", - configuration.base_path, - org = crate::apis::urlencode(p_path_org) - ); - let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); - - if let Some(ref param_value) = p_query_page { - req_builder = req_builder.query(&[("page", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_limit { - req_builder = req_builder.query(&[("limit", ¶m_value.to_string())]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("access_token", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("sudo", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("token", value)]); - } - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("X-FORGEJO-OTP", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Authorization", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Sudo", value); - }; - if let Some(ref auth_conf) = configuration.basic_auth { - req_builder = req_builder.basic_auth(auth_conf.0.to_owned(), auth_conf.1.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `Vec<models::Secret>`"))), - ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `Vec<models::Secret>`")))), - } - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -pub async fn org_list_activity_feeds( - configuration: &configuration::Configuration, - org: &str, - date: Option, - page: Option, - limit: Option, -) -> Result, Error> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_org = org; - let p_query_date = date; - let p_query_page = page; - let p_query_limit = limit; - - let uri_str = format!( - "{}/orgs/{org}/activities/feeds", - configuration.base_path, - org = crate::apis::urlencode(p_path_org) - ); - let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); - - if let Some(ref param_value) = p_query_date { - req_builder = req_builder.query(&[("date", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_page { - req_builder = req_builder.query(&[("page", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_limit { - req_builder = req_builder.query(&[("limit", ¶m_value.to_string())]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("access_token", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("sudo", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("token", value)]); - } - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("X-FORGEJO-OTP", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Authorization", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Sudo", value); - }; - if let Some(ref auth_conf) = configuration.basic_auth { - req_builder = req_builder.basic_auth(auth_conf.0.to_owned(), auth_conf.1.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `Vec<models::Activity>`"))), - ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `Vec<models::Activity>`")))), - } - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -pub async fn org_list_blocked_users( - configuration: &configuration::Configuration, - org: &str, - page: Option, - limit: Option, -) -> Result, Error> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_org = org; - let p_query_page = page; - let p_query_limit = limit; - - let uri_str = format!( - "{}/orgs/{org}/list_blocked", - configuration.base_path, - org = crate::apis::urlencode(p_path_org) - ); - let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); - - if let Some(ref param_value) = p_query_page { - req_builder = req_builder.query(&[("page", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_limit { - req_builder = req_builder.query(&[("limit", ¶m_value.to_string())]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("access_token", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("sudo", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("token", value)]); - } - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("X-FORGEJO-OTP", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Authorization", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Sudo", value); - }; - if let Some(ref auth_conf) = configuration.basic_auth { - req_builder = req_builder.basic_auth(auth_conf.0.to_owned(), auth_conf.1.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `Vec<models::BlockedUser>`"))), - ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `Vec<models::BlockedUser>`")))), - } - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -pub async fn org_list_current_user_orgs( - configuration: &configuration::Configuration, - page: Option, - limit: Option, -) -> Result, Error> { - // add a prefix to parameters to efficiently prevent name collisions - let p_query_page = page; - let p_query_limit = limit; - - let uri_str = format!("{}/user/orgs", configuration.base_path); - let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); - - if let Some(ref param_value) = p_query_page { - req_builder = req_builder.query(&[("page", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_limit { - req_builder = req_builder.query(&[("limit", ¶m_value.to_string())]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("access_token", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("sudo", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("token", value)]); - } - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("X-FORGEJO-OTP", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Authorization", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Sudo", value); - }; - if let Some(ref auth_conf) = configuration.basic_auth { - req_builder = req_builder.basic_auth(auth_conf.0.to_owned(), auth_conf.1.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `Vec<models::Organization>`"))), - ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `Vec<models::Organization>`")))), - } - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -pub async fn org_list_hooks( - configuration: &configuration::Configuration, - org: &str, - page: Option, - limit: Option, -) -> Result, Error> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_org = org; - let p_query_page = page; - let p_query_limit = limit; - - let uri_str = format!( - "{}/orgs/{org}/hooks", - configuration.base_path, - org = crate::apis::urlencode(p_path_org) - ); - let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); - - if let Some(ref param_value) = p_query_page { - req_builder = req_builder.query(&[("page", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_limit { - req_builder = req_builder.query(&[("limit", ¶m_value.to_string())]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("access_token", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("sudo", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("token", value)]); - } - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("X-FORGEJO-OTP", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Authorization", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Sudo", value); - }; - if let Some(ref auth_conf) = configuration.basic_auth { - req_builder = req_builder.basic_auth(auth_conf.0.to_owned(), auth_conf.1.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `Vec<models::Hook>`"))), - ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `Vec<models::Hook>`")))), - } - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -pub async fn org_list_labels( - configuration: &configuration::Configuration, - org: &str, - sort: Option<&str>, - page: Option, - limit: Option, -) -> Result, Error> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_org = org; - let p_query_sort = sort; - let p_query_page = page; - let p_query_limit = limit; - - let uri_str = format!( - "{}/orgs/{org}/labels", - configuration.base_path, - org = crate::apis::urlencode(p_path_org) - ); - let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); - - if let Some(ref param_value) = p_query_sort { - req_builder = req_builder.query(&[("sort", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_page { - req_builder = req_builder.query(&[("page", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_limit { - req_builder = req_builder.query(&[("limit", ¶m_value.to_string())]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("access_token", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("sudo", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("token", value)]); - } - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("X-FORGEJO-OTP", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Authorization", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Sudo", value); - }; - if let Some(ref auth_conf) = configuration.basic_auth { - req_builder = req_builder.basic_auth(auth_conf.0.to_owned(), auth_conf.1.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `Vec<models::Label>`"))), - ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `Vec<models::Label>`")))), - } - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -pub async fn org_list_members( - configuration: &configuration::Configuration, - org: &str, - page: Option, - limit: Option, -) -> Result, Error> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_org = org; - let p_query_page = page; - let p_query_limit = limit; - - let uri_str = format!( - "{}/orgs/{org}/members", - configuration.base_path, - org = crate::apis::urlencode(p_path_org) - ); - let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); - - if let Some(ref param_value) = p_query_page { - req_builder = req_builder.query(&[("page", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_limit { - req_builder = req_builder.query(&[("limit", ¶m_value.to_string())]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("access_token", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("sudo", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("token", value)]); - } - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("X-FORGEJO-OTP", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Authorization", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Sudo", value); - }; - if let Some(ref auth_conf) = configuration.basic_auth { - req_builder = req_builder.basic_auth(auth_conf.0.to_owned(), auth_conf.1.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `Vec<models::User>`"))), - ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `Vec<models::User>`")))), - } - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -pub async fn org_list_public_members( - configuration: &configuration::Configuration, - org: &str, - page: Option, - limit: Option, -) -> Result, Error> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_org = org; - let p_query_page = page; - let p_query_limit = limit; - - let uri_str = format!( - "{}/orgs/{org}/public_members", - configuration.base_path, - org = crate::apis::urlencode(p_path_org) - ); - let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); - - if let Some(ref param_value) = p_query_page { - req_builder = req_builder.query(&[("page", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_limit { - req_builder = req_builder.query(&[("limit", ¶m_value.to_string())]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("access_token", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("sudo", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("token", value)]); - } - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("X-FORGEJO-OTP", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Authorization", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Sudo", value); - }; - if let Some(ref auth_conf) = configuration.basic_auth { - req_builder = req_builder.basic_auth(auth_conf.0.to_owned(), auth_conf.1.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `Vec<models::User>`"))), - ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `Vec<models::User>`")))), - } - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -pub async fn org_list_quota_artifacts( - configuration: &configuration::Configuration, - org: &str, - page: Option, - limit: Option, -) -> Result, Error> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_org = org; - let p_query_page = page; - let p_query_limit = limit; - - let uri_str = format!( - "{}/orgs/{org}/quota/artifacts", - configuration.base_path, - org = crate::apis::urlencode(p_path_org) - ); - let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); - - if let Some(ref param_value) = p_query_page { - req_builder = req_builder.query(&[("page", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_limit { - req_builder = req_builder.query(&[("limit", ¶m_value.to_string())]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("access_token", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("sudo", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("token", value)]); - } - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("X-FORGEJO-OTP", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Authorization", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Sudo", value); - }; - if let Some(ref auth_conf) = configuration.basic_auth { - req_builder = req_builder.basic_auth(auth_conf.0.to_owned(), auth_conf.1.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `Vec<models::QuotaUsedArtifact>`"))), - ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `Vec<models::QuotaUsedArtifact>`")))), - } - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -pub async fn org_list_quota_attachments( - configuration: &configuration::Configuration, - org: &str, - page: Option, - limit: Option, -) -> Result, Error> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_org = org; - let p_query_page = page; - let p_query_limit = limit; - - let uri_str = format!( - "{}/orgs/{org}/quota/attachments", - configuration.base_path, - org = crate::apis::urlencode(p_path_org) - ); - let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); - - if let Some(ref param_value) = p_query_page { - req_builder = req_builder.query(&[("page", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_limit { - req_builder = req_builder.query(&[("limit", ¶m_value.to_string())]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("access_token", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("sudo", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("token", value)]); - } - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("X-FORGEJO-OTP", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Authorization", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Sudo", value); - }; - if let Some(ref auth_conf) = configuration.basic_auth { - req_builder = req_builder.basic_auth(auth_conf.0.to_owned(), auth_conf.1.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `Vec<models::QuotaUsedAttachment>`"))), - ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `Vec<models::QuotaUsedAttachment>`")))), - } - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -pub async fn org_list_quota_packages( - configuration: &configuration::Configuration, - org: &str, - page: Option, - limit: Option, -) -> Result, Error> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_org = org; - let p_query_page = page; - let p_query_limit = limit; - - let uri_str = format!( - "{}/orgs/{org}/quota/packages", - configuration.base_path, - org = crate::apis::urlencode(p_path_org) - ); - let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); - - if let Some(ref param_value) = p_query_page { - req_builder = req_builder.query(&[("page", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_limit { - req_builder = req_builder.query(&[("limit", ¶m_value.to_string())]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("access_token", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("sudo", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("token", value)]); - } - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("X-FORGEJO-OTP", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Authorization", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Sudo", value); - }; - if let Some(ref auth_conf) = configuration.basic_auth { - req_builder = req_builder.basic_auth(auth_conf.0.to_owned(), auth_conf.1.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `Vec<models::QuotaUsedPackage>`"))), - ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `Vec<models::QuotaUsedPackage>`")))), - } - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -pub async fn org_list_repos( - configuration: &configuration::Configuration, - org: &str, - page: Option, - limit: Option, -) -> Result, Error> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_org = org; - let p_query_page = page; - let p_query_limit = limit; - - let uri_str = format!( - "{}/orgs/{org}/repos", - configuration.base_path, - org = crate::apis::urlencode(p_path_org) - ); - let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); - - if let Some(ref param_value) = p_query_page { - req_builder = req_builder.query(&[("page", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_limit { - req_builder = req_builder.query(&[("limit", ¶m_value.to_string())]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("access_token", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("sudo", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("token", value)]); - } - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("X-FORGEJO-OTP", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Authorization", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Sudo", value); - }; - if let Some(ref auth_conf) = configuration.basic_auth { - req_builder = req_builder.basic_auth(auth_conf.0.to_owned(), auth_conf.1.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `Vec<models::Repository>`"))), - ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `Vec<models::Repository>`")))), - } - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -pub async fn org_list_team_activity_feeds( - configuration: &configuration::Configuration, - id: i64, - date: Option, - page: Option, - limit: Option, -) -> Result, Error> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_id = id; - let p_query_date = date; - let p_query_page = page; - let p_query_limit = limit; - - let uri_str = format!( - "{}/teams/{id}/activities/feeds", - configuration.base_path, - id = p_path_id - ); - let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); - - if let Some(ref param_value) = p_query_date { - req_builder = req_builder.query(&[("date", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_page { - req_builder = req_builder.query(&[("page", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_limit { - req_builder = req_builder.query(&[("limit", ¶m_value.to_string())]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("access_token", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("sudo", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("token", value)]); - } - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("X-FORGEJO-OTP", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Authorization", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Sudo", value); - }; - if let Some(ref auth_conf) = configuration.basic_auth { - req_builder = req_builder.basic_auth(auth_conf.0.to_owned(), auth_conf.1.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `Vec<models::Activity>`"))), - ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `Vec<models::Activity>`")))), - } - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -pub async fn org_list_team_member( - configuration: &configuration::Configuration, - id: i64, - username: &str, -) -> Result> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_id = id; - let p_path_username = username; - - let uri_str = format!( - "{}/teams/{id}/members/{username}", - configuration.base_path, - id = p_path_id, - username = crate::apis::urlencode(p_path_username) - ); - let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); - - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("access_token", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("sudo", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("token", value)]); - } - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("X-FORGEJO-OTP", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Authorization", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Sudo", value); - }; - if let Some(ref auth_conf) = configuration.basic_auth { - req_builder = req_builder.basic_auth(auth_conf.0.to_owned(), auth_conf.1.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::User`"))), - ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::User`")))), - } - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -pub async fn org_list_team_members( - configuration: &configuration::Configuration, - id: i64, - page: Option, - limit: Option, -) -> Result, Error> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_id = id; - let p_query_page = page; - let p_query_limit = limit; - - let uri_str = format!( - "{}/teams/{id}/members", - configuration.base_path, - id = p_path_id - ); - let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); - - if let Some(ref param_value) = p_query_page { - req_builder = req_builder.query(&[("page", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_limit { - req_builder = req_builder.query(&[("limit", ¶m_value.to_string())]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("access_token", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("sudo", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("token", value)]); - } - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("X-FORGEJO-OTP", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Authorization", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Sudo", value); - }; - if let Some(ref auth_conf) = configuration.basic_auth { - req_builder = req_builder.basic_auth(auth_conf.0.to_owned(), auth_conf.1.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `Vec<models::User>`"))), - ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `Vec<models::User>`")))), - } - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -pub async fn org_list_team_repo( - configuration: &configuration::Configuration, - id: i64, - org: &str, - repo: &str, -) -> Result> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_id = id; - let p_path_org = org; - let p_path_repo = repo; - - let uri_str = format!( - "{}/teams/{id}/repos/{org}/{repo}", - configuration.base_path, - id = p_path_id, - org = crate::apis::urlencode(p_path_org), - repo = crate::apis::urlencode(p_path_repo) - ); - let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); - - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("access_token", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("sudo", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("token", value)]); - } - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("X-FORGEJO-OTP", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Authorization", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Sudo", value); - }; - if let Some(ref auth_conf) = configuration.basic_auth { - req_builder = req_builder.basic_auth(auth_conf.0.to_owned(), auth_conf.1.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::Repository`"))), - ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::Repository`")))), - } - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -pub async fn org_list_team_repos( - configuration: &configuration::Configuration, - id: i64, - page: Option, - limit: Option, -) -> Result, Error> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_id = id; - let p_query_page = page; - let p_query_limit = limit; - - let uri_str = format!( - "{}/teams/{id}/repos", - configuration.base_path, - id = p_path_id - ); - let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); - - if let Some(ref param_value) = p_query_page { - req_builder = req_builder.query(&[("page", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_limit { - req_builder = req_builder.query(&[("limit", ¶m_value.to_string())]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("access_token", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("sudo", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("token", value)]); - } - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("X-FORGEJO-OTP", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Authorization", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Sudo", value); - }; - if let Some(ref auth_conf) = configuration.basic_auth { - req_builder = req_builder.basic_auth(auth_conf.0.to_owned(), auth_conf.1.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `Vec<models::Repository>`"))), - ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `Vec<models::Repository>`")))), - } - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -pub async fn org_list_teams( - configuration: &configuration::Configuration, - org: &str, - page: Option, - limit: Option, -) -> Result, Error> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_org = org; - let p_query_page = page; - let p_query_limit = limit; - - let uri_str = format!( - "{}/orgs/{org}/teams", - configuration.base_path, - org = crate::apis::urlencode(p_path_org) - ); - let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); - - if let Some(ref param_value) = p_query_page { - req_builder = req_builder.query(&[("page", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_limit { - req_builder = req_builder.query(&[("limit", ¶m_value.to_string())]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("access_token", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("sudo", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("token", value)]); - } - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("X-FORGEJO-OTP", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Authorization", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Sudo", value); - }; - if let Some(ref auth_conf) = configuration.basic_auth { - req_builder = req_builder.basic_auth(auth_conf.0.to_owned(), auth_conf.1.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `Vec<models::Team>`"))), - ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `Vec<models::Team>`")))), - } - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -pub async fn org_list_user_orgs( - configuration: &configuration::Configuration, - username: &str, - page: Option, - limit: Option, -) -> Result, Error> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_username = username; - let p_query_page = page; - let p_query_limit = limit; - - let uri_str = format!( - "{}/users/{username}/orgs", - configuration.base_path, - username = crate::apis::urlencode(p_path_username) - ); - let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); - - if let Some(ref param_value) = p_query_page { - req_builder = req_builder.query(&[("page", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_limit { - req_builder = req_builder.query(&[("limit", ¶m_value.to_string())]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("access_token", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("sudo", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("token", value)]); - } - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("X-FORGEJO-OTP", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Authorization", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Sudo", value); - }; - if let Some(ref auth_conf) = configuration.basic_auth { - req_builder = req_builder.basic_auth(auth_conf.0.to_owned(), auth_conf.1.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `Vec<models::Organization>`"))), - ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `Vec<models::Organization>`")))), - } - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -pub async fn org_publicize_member( - configuration: &configuration::Configuration, - org: &str, - username: &str, -) -> Result<(), Error> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_org = org; - let p_path_username = username; - - let uri_str = format!( - "{}/orgs/{org}/public_members/{username}", - configuration.base_path, - org = crate::apis::urlencode(p_path_org), - username = crate::apis::urlencode(p_path_username) - ); - let mut req_builder = configuration.client.request(reqwest::Method::PUT, &uri_str); - - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("access_token", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("sudo", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("token", value)]); - } - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("X-FORGEJO-OTP", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Authorization", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Sudo", value); - }; - if let Some(ref auth_conf) = configuration.basic_auth { - req_builder = req_builder.basic_auth(auth_conf.0.to_owned(), auth_conf.1.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - - if !status.is_client_error() && !status.is_server_error() { - Ok(()) - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -pub async fn org_remove_team_member( - configuration: &configuration::Configuration, - id: i64, - username: &str, -) -> Result<(), Error> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_id = id; - let p_path_username = username; - - let uri_str = format!( - "{}/teams/{id}/members/{username}", - configuration.base_path, - id = p_path_id, - username = crate::apis::urlencode(p_path_username) - ); - let mut req_builder = configuration - .client - .request(reqwest::Method::DELETE, &uri_str); - - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("access_token", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("sudo", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("token", value)]); - } - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("X-FORGEJO-OTP", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Authorization", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Sudo", value); - }; - if let Some(ref auth_conf) = configuration.basic_auth { - req_builder = req_builder.basic_auth(auth_conf.0.to_owned(), auth_conf.1.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - - if !status.is_client_error() && !status.is_server_error() { - Ok(()) - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// 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> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_id = id; - let p_path_org = org; - let p_path_repo = repo; - - let uri_str = format!( - "{}/teams/{id}/repos/{org}/{repo}", - configuration.base_path, - id = p_path_id, - org = crate::apis::urlencode(p_path_org), - repo = crate::apis::urlencode(p_path_repo) - ); - let mut req_builder = configuration - .client - .request(reqwest::Method::DELETE, &uri_str); - - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("access_token", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("sudo", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("token", value)]); - } - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("X-FORGEJO-OTP", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Authorization", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Sudo", value); - }; - if let Some(ref auth_conf) = configuration.basic_auth { - req_builder = req_builder.basic_auth(auth_conf.0.to_owned(), auth_conf.1.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - - if !status.is_client_error() && !status.is_server_error() { - Ok(()) - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -pub async fn org_search_run_jobs( - configuration: &configuration::Configuration, - org: &str, - labels: Option<&str>, -) -> Result, Error> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_org = org; - let p_query_labels = labels; - - let uri_str = format!( - "{}/orgs/{org}/actions/runners/jobs", - configuration.base_path, - org = crate::apis::urlencode(p_path_org) - ); - let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); - - if let Some(ref param_value) = p_query_labels { - req_builder = req_builder.query(&[("labels", ¶m_value.to_string())]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("access_token", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("sudo", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("token", value)]); - } - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("X-FORGEJO-OTP", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Authorization", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Sudo", value); - }; - if let Some(ref auth_conf) = configuration.basic_auth { - req_builder = req_builder.basic_auth(auth_conf.0.to_owned(), auth_conf.1.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `Vec<models::ActionRunJob>`"))), - ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `Vec<models::ActionRunJob>`")))), - } - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -pub async fn org_unblock_user( - configuration: &configuration::Configuration, - org: &str, - username: &str, -) -> Result<(), Error> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_org = org; - let p_path_username = username; - - let uri_str = format!( - "{}/orgs/{org}/unblock/{username}", - configuration.base_path, - org = crate::apis::urlencode(p_path_org), - username = crate::apis::urlencode(p_path_username) - ); - let mut req_builder = configuration.client.request(reqwest::Method::PUT, &uri_str); - - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("access_token", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("sudo", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("token", value)]); - } - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("X-FORGEJO-OTP", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Authorization", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Sudo", value); - }; - if let Some(ref auth_conf) = configuration.basic_auth { - req_builder = req_builder.basic_auth(auth_conf.0.to_owned(), auth_conf.1.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - - if !status.is_client_error() && !status.is_server_error() { - Ok(()) - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -pub async fn org_update_avatar( - configuration: &configuration::Configuration, - org: &str, - body: Option, -) -> Result<(), Error> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_org = org; - let p_body_body = body; - - let uri_str = format!( - "{}/orgs/{org}/avatar", - configuration.base_path, - org = crate::apis::urlencode(p_path_org) - ); - let mut req_builder = configuration - .client - .request(reqwest::Method::POST, &uri_str); - - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("access_token", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("sudo", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("token", value)]); - } - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("X-FORGEJO-OTP", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Authorization", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Sudo", value); - }; - if let Some(ref auth_conf) = configuration.basic_auth { - req_builder = req_builder.basic_auth(auth_conf.0.to_owned(), auth_conf.1.to_owned()); - }; - req_builder = req_builder.json(&p_body_body); - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - - if !status.is_client_error() && !status.is_server_error() { - Ok(()) - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -pub async fn rename_org( - configuration: &configuration::Configuration, - org: &str, - body: models::RenameOrgOption, -) -> Result<(), Error> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_org = org; - let p_body_body = body; - - let uri_str = format!( - "{}/orgs/{org}/rename", - configuration.base_path, - org = crate::apis::urlencode(p_path_org) - ); - let mut req_builder = configuration - .client - .request(reqwest::Method::POST, &uri_str); - - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("access_token", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("sudo", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("token", value)]); - } - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("X-FORGEJO-OTP", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Authorization", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Sudo", value); - }; - if let Some(ref auth_conf) = configuration.basic_auth { - req_builder = req_builder.basic_auth(auth_conf.0.to_owned(), auth_conf.1.to_owned()); - }; - req_builder = req_builder.json(&p_body_body); - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - - if !status.is_client_error() && !status.is_server_error() { - Ok(()) - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -pub async fn team_search( - configuration: &configuration::Configuration, - org: &str, - q: Option<&str>, - include_desc: Option, - page: Option, - limit: Option, -) -> Result> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_org = org; - let p_query_q = q; - let p_query_include_desc = include_desc; - let p_query_page = page; - let p_query_limit = limit; - - let uri_str = format!( - "{}/orgs/{org}/teams/search", - configuration.base_path, - org = crate::apis::urlencode(p_path_org) - ); - let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); - - if let Some(ref param_value) = p_query_q { - req_builder = req_builder.query(&[("q", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_include_desc { - req_builder = req_builder.query(&[("include_desc", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_page { - req_builder = req_builder.query(&[("page", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_limit { - req_builder = req_builder.query(&[("limit", ¶m_value.to_string())]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("access_token", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("sudo", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("token", value)]); - } - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("X-FORGEJO-OTP", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Authorization", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Sudo", value); - }; - if let Some(ref auth_conf) = configuration.basic_auth { - req_builder = req_builder.basic_auth(auth_conf.0.to_owned(), auth_conf.1.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::TeamSearchResults`"))), - ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::TeamSearchResults`")))), - } - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -pub async fn update_org_secret( - configuration: &configuration::Configuration, - org: &str, - secretname: &str, - body: Option, -) -> Result<(), Error> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_org = org; - let p_path_secretname = secretname; - let p_body_body = body; - - let uri_str = format!( - "{}/orgs/{org}/actions/secrets/{secretname}", - configuration.base_path, - org = crate::apis::urlencode(p_path_org), - secretname = crate::apis::urlencode(p_path_secretname) - ); - let mut req_builder = configuration.client.request(reqwest::Method::PUT, &uri_str); - - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("access_token", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("sudo", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("token", value)]); - } - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("X-FORGEJO-OTP", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Authorization", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Sudo", value); - }; - if let Some(ref auth_conf) = configuration.basic_auth { - req_builder = req_builder.basic_auth(auth_conf.0.to_owned(), auth_conf.1.to_owned()); - }; - req_builder = req_builder.json(&p_body_body); - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - - if !status.is_client_error() && !status.is_server_error() { - Ok(()) - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -pub async fn update_org_variable( - configuration: &configuration::Configuration, - org: &str, - variablename: &str, - body: Option, -) -> Result<(), Error> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_org = org; - let p_path_variablename = variablename; - let p_body_body = body; - - let uri_str = format!( - "{}/orgs/{org}/actions/variables/{variablename}", - configuration.base_path, - org = crate::apis::urlencode(p_path_org), - variablename = crate::apis::urlencode(p_path_variablename) - ); - let mut req_builder = configuration.client.request(reqwest::Method::PUT, &uri_str); - - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("access_token", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("sudo", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("token", value)]); - } - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("X-FORGEJO-OTP", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Authorization", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Sudo", value); - }; - if let Some(ref auth_conf) = configuration.basic_auth { - req_builder = req_builder.basic_auth(auth_conf.0.to_owned(), auth_conf.1.to_owned()); - }; - req_builder = req_builder.json(&p_body_body); - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - - if !status.is_client_error() && !status.is_server_error() { - Ok(()) - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} diff --git a/src/apis/package_api.rs b/src/apis/package_api.rs deleted file mode 100644 index e79cba7..0000000 --- a/src/apis/package_api.rs +++ /dev/null @@ -1,651 +0,0 @@ -/* - * Forgejo API - * - * This documentation describes the Forgejo API. - * - * The version of the OpenAPI document: 14.0.2-2-84240ce3a2+gitea-1.22.0 - * - * Generated by: https://openapi-generator.tech - */ - -use super::{configuration, ContentType, Error}; -use crate::{apis::ResponseContent, models}; -use reqwest; -use serde::{de::Error as _, Deserialize, Serialize}; - -/// struct for typed errors of method [`delete_package`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum DeletePackageError { - Status404(models::ApiNotFound), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`get_package`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum GetPackageError { - Status404(models::ApiNotFound), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`link_package`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum LinkPackageError { - Status404(models::ApiNotFound), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`list_package_files`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum ListPackageFilesError { - Status404(models::ApiNotFound), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`list_packages`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum ListPackagesError { - Status404(models::ApiNotFound), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`unlink_package`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum UnlinkPackageError { - Status404(models::ApiNotFound), - UnknownValue(serde_json::Value), -} - -pub async fn delete_package( - configuration: &configuration::Configuration, - owner: &str, - r#type: &str, - name: &str, - version: &str, -) -> Result<(), Error> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_owner = owner; - let p_path_type = r#type; - let p_path_name = name; - let p_path_version = version; - - let uri_str = format!("{}/packages/{owner}/{type}/{name}/{version}", configuration.base_path, owner=crate::apis::urlencode(p_path_owner), type=crate::apis::urlencode(p_path_type), name=crate::apis::urlencode(p_path_name), version=crate::apis::urlencode(p_path_version)); - let mut req_builder = configuration - .client - .request(reqwest::Method::DELETE, &uri_str); - - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("access_token", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("sudo", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("token", value)]); - } - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("X-FORGEJO-OTP", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Authorization", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Sudo", value); - }; - if let Some(ref auth_conf) = configuration.basic_auth { - req_builder = req_builder.basic_auth(auth_conf.0.to_owned(), auth_conf.1.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - - if !status.is_client_error() && !status.is_server_error() { - Ok(()) - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -pub async fn get_package( - configuration: &configuration::Configuration, - owner: &str, - r#type: &str, - name: &str, - version: &str, -) -> Result> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_owner = owner; - let p_path_type = r#type; - let p_path_name = name; - let p_path_version = version; - - let uri_str = format!("{}/packages/{owner}/{type}/{name}/{version}", configuration.base_path, owner=crate::apis::urlencode(p_path_owner), type=crate::apis::urlencode(p_path_type), name=crate::apis::urlencode(p_path_name), version=crate::apis::urlencode(p_path_version)); - let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); - - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("access_token", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("sudo", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("token", value)]); - } - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("X-FORGEJO-OTP", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Authorization", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Sudo", value); - }; - if let Some(ref auth_conf) = configuration.basic_auth { - req_builder = req_builder.basic_auth(auth_conf.0.to_owned(), auth_conf.1.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::Package`"))), - ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::Package`")))), - } - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -pub async fn link_package( - configuration: &configuration::Configuration, - owner: &str, - r#type: &str, - name: &str, - repo_name: &str, -) -> Result<(), Error> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_owner = owner; - let p_path_type = r#type; - let p_path_name = name; - let p_path_repo_name = repo_name; - - let uri_str = format!("{}/packages/{owner}/{type}/{name}/-/link/{repo_name}", configuration.base_path, owner=crate::apis::urlencode(p_path_owner), type=crate::apis::urlencode(p_path_type), name=crate::apis::urlencode(p_path_name), repo_name=crate::apis::urlencode(p_path_repo_name)); - let mut req_builder = configuration - .client - .request(reqwest::Method::POST, &uri_str); - - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("access_token", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("sudo", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("token", value)]); - } - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("X-FORGEJO-OTP", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Authorization", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Sudo", value); - }; - if let Some(ref auth_conf) = configuration.basic_auth { - req_builder = req_builder.basic_auth(auth_conf.0.to_owned(), auth_conf.1.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - - if !status.is_client_error() && !status.is_server_error() { - Ok(()) - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -pub async fn list_package_files( - configuration: &configuration::Configuration, - owner: &str, - r#type: &str, - name: &str, - version: &str, -) -> Result, Error> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_owner = owner; - let p_path_type = r#type; - let p_path_name = name; - let p_path_version = version; - - let uri_str = format!("{}/packages/{owner}/{type}/{name}/{version}/files", configuration.base_path, owner=crate::apis::urlencode(p_path_owner), type=crate::apis::urlencode(p_path_type), name=crate::apis::urlencode(p_path_name), version=crate::apis::urlencode(p_path_version)); - let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); - - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("access_token", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("sudo", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("token", value)]); - } - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("X-FORGEJO-OTP", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Authorization", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Sudo", value); - }; - if let Some(ref auth_conf) = configuration.basic_auth { - req_builder = req_builder.basic_auth(auth_conf.0.to_owned(), auth_conf.1.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `Vec<models::PackageFile>`"))), - ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `Vec<models::PackageFile>`")))), - } - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -pub async fn list_packages( - configuration: &configuration::Configuration, - owner: &str, - page: Option, - limit: Option, - r#type: Option<&str>, - q: Option<&str>, -) -> Result, Error> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_owner = owner; - let p_query_page = page; - let p_query_limit = limit; - let p_query_type = r#type; - let p_query_q = q; - - let uri_str = format!( - "{}/packages/{owner}", - configuration.base_path, - owner = crate::apis::urlencode(p_path_owner) - ); - let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); - - if let Some(ref param_value) = p_query_page { - req_builder = req_builder.query(&[("page", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_limit { - req_builder = req_builder.query(&[("limit", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_type { - req_builder = req_builder.query(&[("type", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_q { - req_builder = req_builder.query(&[("q", ¶m_value.to_string())]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("access_token", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("sudo", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("token", value)]); - } - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("X-FORGEJO-OTP", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Authorization", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Sudo", value); - }; - if let Some(ref auth_conf) = configuration.basic_auth { - req_builder = req_builder.basic_auth(auth_conf.0.to_owned(), auth_conf.1.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `Vec<models::Package>`"))), - ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `Vec<models::Package>`")))), - } - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -pub async fn unlink_package( - configuration: &configuration::Configuration, - owner: &str, - r#type: &str, - name: &str, -) -> Result<(), Error> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_owner = owner; - let p_path_type = r#type; - let p_path_name = name; - - let uri_str = format!("{}/packages/{owner}/{type}/{name}/-/unlink", configuration.base_path, owner=crate::apis::urlencode(p_path_owner), type=crate::apis::urlencode(p_path_type), name=crate::apis::urlencode(p_path_name)); - let mut req_builder = configuration - .client - .request(reqwest::Method::POST, &uri_str); - - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("access_token", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("sudo", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("token", value)]); - } - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("X-FORGEJO-OTP", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Authorization", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Sudo", value); - }; - if let Some(ref auth_conf) = configuration.basic_auth { - req_builder = req_builder.basic_auth(auth_conf.0.to_owned(), auth_conf.1.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - - if !status.is_client_error() && !status.is_server_error() { - Ok(()) - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} diff --git a/src/apis/repository_api.rs b/src/apis/repository_api.rs deleted file mode 100644 index 4d65795..0000000 --- a/src/apis/repository_api.rs +++ /dev/null @@ -1,20995 +0,0 @@ -/* - * Forgejo API - * - * This documentation describes the Forgejo API. - * - * The version of the OpenAPI document: 14.0.2-2-84240ce3a2+gitea-1.22.0 - * - * Generated by: https://openapi-generator.tech - */ - -use super::{configuration, ContentType, Error}; -use crate::{apis::ResponseContent, models}; -use reqwest; -use serde::{de::Error as _, Deserialize, Serialize}; -use tokio::fs::File as TokioFile; -use tokio_util::codec::{BytesCodec, FramedRead}; - -/// struct for typed errors of method [`accept_repo_transfer`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum AcceptRepoTransferError { - Status403(models::ApiForbiddenError), - Status404(models::ApiNotFound), - Status413(), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`action_run`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum ActionRunError { - Status400(models::ApiError), - Status403(models::ApiForbiddenError), - Status404(models::ApiNotFound), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`create_current_user_repo`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum CreateCurrentUserRepoError { - Status400(models::ApiError), - Status401(models::ApiUnauthorizedError), - Status403(models::ApiForbiddenError), - Status409(), - Status413(), - Status422(models::ApiValidationError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`create_fork`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum CreateForkError { - Status403(models::ApiForbiddenError), - Status404(models::ApiNotFound), - Status409(), - Status413(), - Status422(models::ApiValidationError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`create_repo_variable`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum CreateRepoVariableError { - Status400(models::ApiError), - Status404(models::ApiNotFound), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`delete_repo_secret`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum DeleteRepoSecretError { - Status400(models::ApiError), - Status404(models::ApiNotFound), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`delete_repo_variable`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum DeleteRepoVariableError { - Status400(models::ApiError), - Status404(models::ApiNotFound), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`dispatch_workflow`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum DispatchWorkflowError { - Status404(models::ApiNotFound), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`generate_repo`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum GenerateRepoError { - Status403(models::ApiForbiddenError), - Status404(models::ApiNotFound), - Status409(), - Status413(), - Status422(models::ApiValidationError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`get_annotated_tag`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum GetAnnotatedTagError { - Status400(models::ApiError), - Status404(models::ApiNotFound), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`get_blob`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum GetBlobError { - Status400(models::ApiError), - Status404(models::ApiNotFound), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`get_blobs`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum GetBlobsError { - Status400(models::ApiError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`get_repo_variable`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum GetRepoVariableError { - Status400(models::ApiError), - Status404(models::ApiNotFound), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`get_repo_variables_list`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum GetRepoVariablesListError { - Status400(models::ApiError), - Status404(models::ApiNotFound), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`get_tree`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum GetTreeError { - Status400(models::ApiError), - Status404(models::ApiNotFound), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`list_action_runs`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum ListActionRunsError { - Status400(models::ApiError), - Status403(models::ApiForbiddenError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`list_action_tasks`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum ListActionTasksError { - Status400(models::ApiError), - Status403(models::ApiForbiddenError), - Status404(models::ApiNotFound), - Status409(), - Status422(models::ApiValidationError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`list_forks`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum ListForksError { - Status404(models::ApiNotFound), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`reject_repo_transfer`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum RejectRepoTransferError { - Status403(models::ApiForbiddenError), - Status404(models::ApiNotFound), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`repo_add_collaborator`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum RepoAddCollaboratorError { - Status403(models::ApiForbiddenError), - Status404(models::ApiNotFound), - Status422(models::ApiValidationError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`repo_add_flag`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum RepoAddFlagError { - Status403(models::ApiForbiddenError), - Status404(models::ApiNotFound), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`repo_add_push_mirror`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum RepoAddPushMirrorError { - Status400(models::ApiError), - Status403(models::ApiForbiddenError), - Status404(models::ApiNotFound), - Status413(), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`repo_add_team`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum RepoAddTeamError { - Status404(models::ApiNotFound), - Status405(models::ApiError), - Status422(models::ApiValidationError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`repo_add_topic`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum RepoAddTopicError { - Status404(models::ApiNotFound), - Status422(models::ApiInvalidTopicsError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`repo_apply_diff_patch`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum RepoApplyDiffPatchError { - Status404(models::ApiNotFound), - Status413(), - Status423(models::ApiRepoArchivedError), - 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(models::ApiForbiddenError), - Status404(models::ApiNotFound), - Status423(models::ApiRepoArchivedError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`repo_change_files`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum RepoChangeFilesError { - Status403(models::ApiError), - Status404(models::ApiNotFound), - Status409(), - Status413(), - Status422(models::ApiError), - Status423(models::ApiRepoArchivedError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`repo_check_collaborator`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum RepoCheckCollaboratorError { - Status404(models::ApiNotFound), - Status422(models::ApiValidationError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`repo_check_flag`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum RepoCheckFlagError { - Status403(models::ApiForbiddenError), - Status404(models::ApiNotFound), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`repo_check_team`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum RepoCheckTeamError { - Status404(models::ApiNotFound), - Status405(models::ApiError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`repo_compare_diff`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum RepoCompareDiffError { - Status404(models::ApiNotFound), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`repo_convert`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum RepoConvertError { - Status403(models::ApiForbiddenError), - Status404(models::ApiNotFound), - Status422(models::ApiValidationError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`repo_create_branch`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum RepoCreateBranchError { - Status403(), - Status404(), - Status409(), - Status413(), - Status423(models::ApiRepoArchivedError), - 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(models::ApiForbiddenError), - Status404(models::ApiNotFound), - Status422(models::ApiValidationError), - Status423(models::ApiRepoArchivedError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`repo_create_file`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum RepoCreateFileError { - Status403(models::ApiError), - Status404(models::ApiNotFound), - Status409(), - Status413(), - Status422(models::ApiError), - Status423(models::ApiRepoArchivedError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`repo_create_hook`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum RepoCreateHookError { - Status404(models::ApiNotFound), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`repo_create_key`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum RepoCreateKeyError { - Status404(models::ApiNotFound), - Status422(models::ApiValidationError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`repo_create_pull_request`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum RepoCreatePullRequestError { - Status404(models::ApiNotFound), - Status409(models::ApiError), - Status413(), - Status422(models::ApiValidationError), - Status423(models::ApiRepoArchivedError), - 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(models::ApiNotFound), - Status422(models::ApiValidationError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`repo_create_pull_review_comment`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum RepoCreatePullReviewCommentError { - Status404(models::ApiNotFound), - Status422(models::ApiValidationError), - 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(models::ApiNotFound), - Status422(models::ApiValidationError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`repo_create_release`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum RepoCreateReleaseError { - Status404(models::ApiNotFound), - Status409(models::ApiError), - Status422(models::ApiValidationError), - 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(models::ApiError), - Status404(models::ApiNotFound), - Status413(), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`repo_create_status`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum RepoCreateStatusError { - Status400(models::ApiError), - Status404(models::ApiNotFound), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`repo_create_tag`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum RepoCreateTagError { - Status404(models::ApiNotFound), - Status405(), - Status409(), - Status413(), - Status422(models::ApiValidationError), - Status423(models::ApiRepoArchivedError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`repo_create_tag_protection`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum RepoCreateTagProtectionError { - Status403(models::ApiForbiddenError), - Status404(models::ApiNotFound), - Status422(models::ApiValidationError), - Status423(models::ApiRepoArchivedError), - 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(models::ApiError), - Status403(models::ApiForbiddenError), - Status404(models::ApiNotFound), - Status413(), - Status423(models::ApiRepoArchivedError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`repo_delete`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum RepoDeleteError { - Status403(models::ApiForbiddenError), - Status404(models::ApiNotFound), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`repo_delete_all_flags`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum RepoDeleteAllFlagsError { - Status403(models::ApiForbiddenError), - Status404(models::ApiNotFound), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`repo_delete_avatar`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum RepoDeleteAvatarError { - Status404(models::ApiNotFound), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`repo_delete_branch`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum RepoDeleteBranchError { - Status403(models::ApiError), - Status404(models::ApiNotFound), - Status423(models::ApiRepoArchivedError), - 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(models::ApiNotFound), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`repo_delete_collaborator`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum RepoDeleteCollaboratorError { - Status404(models::ApiNotFound), - Status422(models::ApiValidationError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`repo_delete_file`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum RepoDeleteFileError { - Status400(models::ApiError), - Status403(models::ApiError), - Status404(models::ApiError), - Status413(), - Status423(models::ApiRepoArchivedError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`repo_delete_flag`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum RepoDeleteFlagError { - Status403(models::ApiForbiddenError), - Status404(models::ApiNotFound), - 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(models::ApiNotFound), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`repo_delete_hook`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum RepoDeleteHookError { - Status404(models::ApiNotFound), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`repo_delete_key`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum RepoDeleteKeyError { - Status403(models::ApiForbiddenError), - Status404(models::ApiNotFound), - 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(models::ApiForbiddenError), - Status404(models::ApiNotFound), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`repo_delete_pull_review_comment`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum RepoDeletePullReviewCommentError { - Status403(models::ApiForbiddenError), - Status404(models::ApiNotFound), - 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 { - Status403(models::ApiForbiddenError), - Status404(models::ApiNotFound), - Status422(models::ApiValidationError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`repo_delete_push_mirror`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum RepoDeletePushMirrorError { - Status400(models::ApiError), - Status404(models::ApiNotFound), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`repo_delete_release`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum RepoDeleteReleaseError { - Status404(models::ApiNotFound), - Status422(models::ApiValidationError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`repo_delete_release_attachment`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum RepoDeleteReleaseAttachmentError { - Status404(models::ApiNotFound), - 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(models::ApiNotFound), - Status422(models::ApiValidationError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`repo_delete_tag`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum RepoDeleteTagError { - Status404(models::ApiNotFound), - Status405(), - Status409(), - Status422(models::ApiValidationError), - Status423(models::ApiRepoArchivedError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`repo_delete_tag_protection`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum RepoDeleteTagProtectionError { - Status404(models::ApiNotFound), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`repo_delete_team`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum RepoDeleteTeamError { - Status404(models::ApiNotFound), - Status405(models::ApiError), - Status422(models::ApiValidationError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`repo_delete_topic`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum RepoDeleteTopicError { - Status404(models::ApiNotFound), - Status422(models::ApiInvalidTopicsError), - 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(models::ApiForbiddenError), - Status404(models::ApiNotFound), - Status423(models::ApiRepoArchivedError), - 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(models::ApiForbiddenError), - Status404(models::ApiNotFound), - Status422(models::ApiValidationError), - 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(models::ApiNotFound), - 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(models::ApiNotFound), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`repo_edit`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum RepoEditError { - Status403(models::ApiForbiddenError), - Status404(models::ApiNotFound), - Status422(models::ApiValidationError), - 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(models::ApiNotFound), - Status422(models::ApiValidationError), - Status423(models::ApiRepoArchivedError), - 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(models::ApiNotFound), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`repo_edit_hook`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum RepoEditHookError { - Status404(models::ApiNotFound), - 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(models::ApiForbiddenError), - Status404(models::ApiNotFound), - Status409(models::ApiError), - Status412(models::ApiError), - Status422(models::ApiValidationError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`repo_edit_release`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum RepoEditReleaseError { - Status404(models::ApiNotFound), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`repo_edit_release_attachment`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum RepoEditReleaseAttachmentError { - Status404(models::ApiNotFound), - Status413(), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`repo_edit_tag_protection`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum RepoEditTagProtectionError { - Status404(models::ApiNotFound), - Status422(models::ApiValidationError), - Status423(models::ApiRepoArchivedError), - 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(models::ApiError), - Status403(models::ApiForbiddenError), - Status404(models::ApiNotFound), - Status413(), - Status423(models::ApiRepoArchivedError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`repo_get`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum RepoGetError { - Status404(models::ApiNotFound), - 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(models::ApiNotFound), - Status409(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(models::ApiNotFound), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`repo_get_assignees`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum RepoGetAssigneesError { - Status404(models::ApiNotFound), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`repo_get_branch`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum RepoGetBranchError { - Status404(models::ApiNotFound), - 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(models::ApiNotFound), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`repo_get_by_id`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum RepoGetByIdError { - Status404(models::ApiNotFound), - 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(models::ApiError), - Status404(models::ApiNotFound), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`repo_get_commit_pull_request`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum RepoGetCommitPullRequestError { - Status404(models::ApiNotFound), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`repo_get_contents`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum RepoGetContentsError { - Status404(models::ApiNotFound), - 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(models::ApiNotFound), - 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(models::ApiNotFound), - 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(models::ApiNotFound), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`repo_get_hook`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum RepoGetHookError { - Status404(models::ApiNotFound), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`repo_get_issue_config`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum RepoGetIssueConfigError { - Status404(models::ApiNotFound), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`repo_get_issue_templates`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum RepoGetIssueTemplatesError { - Status404(models::ApiNotFound), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`repo_get_key`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum RepoGetKeyError { - Status404(models::ApiNotFound), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`repo_get_languages`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum RepoGetLanguagesError { - Status404(models::ApiNotFound), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`repo_get_latest_release`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum RepoGetLatestReleaseError { - Status404(models::ApiNotFound), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`repo_get_note`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum RepoGetNoteError { - Status404(models::ApiNotFound), - Status422(models::ApiValidationError), - 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(models::ApiNotFound), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`repo_get_pull_request_by_base_head`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum RepoGetPullRequestByBaseHeadError { - Status404(models::ApiNotFound), - 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(models::ApiNotFound), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`repo_get_pull_request_files`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum RepoGetPullRequestFilesError { - Status404(models::ApiNotFound), - 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(models::ApiNotFound), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`repo_get_pull_review_comment`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum RepoGetPullReviewCommentError { - Status403(models::ApiForbiddenError), - Status404(models::ApiNotFound), - 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(models::ApiNotFound), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`repo_get_push_mirror_by_remote_name`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum RepoGetPushMirrorByRemoteNameError { - Status400(models::ApiError), - Status403(models::ApiForbiddenError), - Status404(models::ApiNotFound), - 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(models::ApiNotFound), - 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(models::ApiNotFound), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`repo_get_release`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum RepoGetReleaseError { - Status404(models::ApiNotFound), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`repo_get_release_attachment`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum RepoGetReleaseAttachmentError { - Status404(models::ApiNotFound), - 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(models::ApiNotFound), - 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(models::ApiForbiddenError), - Status404(models::ApiNotFound), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`repo_get_reviewers`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum RepoGetReviewersError { - Status404(models::ApiNotFound), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`repo_get_runner_registration_token`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum RepoGetRunnerRegistrationTokenError { - 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(models::ApiNotFound), - Status422(models::ApiValidationError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`repo_get_tag`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum RepoGetTagError { - Status404(models::ApiNotFound), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`repo_get_tag_protection`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum RepoGetTagProtectionError { - Status404(models::ApiNotFound), - 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(models::ApiNotFound), - 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(models::ApiNotFound), - 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(models::ApiNotFound), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`repo_list_actions_secrets`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum RepoListActionsSecretsError { - Status404(models::ApiNotFound), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`repo_list_activity_feeds`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum RepoListActivityFeedsError { - Status404(models::ApiNotFound), - 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(models::ApiNotFound), - 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 { - Status404(models::ApiNotFound), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`repo_list_flags`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum RepoListFlagsError { - Status403(models::ApiForbiddenError), - Status404(models::ApiNotFound), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`repo_list_git_hooks`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum RepoListGitHooksError { - Status404(models::ApiNotFound), - 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(models::ApiNotFound), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`repo_list_hooks`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum RepoListHooksError { - Status404(models::ApiNotFound), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`repo_list_keys`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum RepoListKeysError { - Status404(models::ApiNotFound), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`repo_list_pinned_issues`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum RepoListPinnedIssuesError { - Status404(models::ApiNotFound), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`repo_list_pinned_pull_requests`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum RepoListPinnedPullRequestsError { - Status404(models::ApiNotFound), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`repo_list_pull_requests`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum RepoListPullRequestsError { - Status404(models::ApiNotFound), - Status500(models::ApiError), - 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(models::ApiNotFound), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`repo_list_push_mirrors`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum RepoListPushMirrorsError { - Status400(models::ApiError), - Status403(models::ApiForbiddenError), - Status404(models::ApiNotFound), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`repo_list_release_attachments`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum RepoListReleaseAttachmentsError { - Status404(models::ApiNotFound), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`repo_list_releases`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum RepoListReleasesError { - Status404(models::ApiNotFound), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`repo_list_stargazers`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum RepoListStargazersError { - Status404(models::ApiNotFound), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`repo_list_statuses`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum RepoListStatusesError { - Status400(models::ApiError), - Status404(models::ApiNotFound), - 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(models::ApiError), - Status404(models::ApiNotFound), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`repo_list_subscribers`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum RepoListSubscribersError { - Status404(models::ApiNotFound), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`repo_list_tag_protection`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum RepoListTagProtectionError { - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`repo_list_tags`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum RepoListTagsError { - Status404(models::ApiNotFound), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`repo_list_teams`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum RepoListTeamsError { - Status404(models::ApiNotFound), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`repo_list_topics`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum RepoListTopicsError { - Status404(models::ApiNotFound), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`repo_merge_pull_request`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum RepoMergePullRequestError { - Status404(models::ApiNotFound), - Status405(), - Status409(models::ApiError), - Status413(), - Status423(models::ApiRepoArchivedError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`repo_migrate`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum RepoMigrateError { - Status403(models::ApiForbiddenError), - Status409(), - Status413(), - Status422(models::ApiValidationError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`repo_mirror_sync`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum RepoMirrorSyncError { - Status403(models::ApiForbiddenError), - Status404(models::ApiNotFound), - Status413(), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`repo_new_pin_allowed`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum RepoNewPinAllowedError { - Status404(models::ApiNotFound), - 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_push_mirror_sync`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum RepoPushMirrorSyncError { - Status400(models::ApiError), - Status403(models::ApiForbiddenError), - Status404(models::ApiNotFound), - Status413(), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`repo_remove_note`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum RepoRemoveNoteError { - Status404(models::ApiNotFound), - Status422(models::ApiValidationError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`repo_replace_all_flags`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum RepoReplaceAllFlagsError { - Status403(models::ApiForbiddenError), - Status404(models::ApiNotFound), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`repo_search`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum RepoSearchError { - Status422(models::ApiValidationError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`repo_search_run_jobs`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum RepoSearchRunJobsError { - Status403(models::ApiForbiddenError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`repo_set_note`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum RepoSetNoteError { - Status404(models::ApiNotFound), - Status422(models::ApiValidationError), - 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(models::ApiNotFound), - Status422(models::ApiValidationError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`repo_sync_fork_branch`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum RepoSyncForkBranchError { - Status400(models::ApiError), - Status404(models::ApiNotFound), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`repo_sync_fork_branch_info`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum RepoSyncForkBranchInfoError { - Status400(models::ApiError), - Status404(models::ApiNotFound), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`repo_sync_fork_default`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum RepoSyncForkDefaultError { - Status400(models::ApiError), - Status404(models::ApiNotFound), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`repo_sync_fork_default_info`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum RepoSyncForkDefaultInfoError { - Status400(models::ApiError), - Status404(models::ApiNotFound), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`repo_test_hook`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum RepoTestHookError { - Status404(models::ApiNotFound), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`repo_tracked_times`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum RepoTrackedTimesError { - Status400(models::ApiError), - Status403(models::ApiForbiddenError), - Status404(models::ApiNotFound), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`repo_transfer`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum RepoTransferError { - Status403(models::ApiForbiddenError), - Status404(models::ApiNotFound), - Status413(), - Status422(models::ApiValidationError), - 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(models::ApiForbiddenError), - Status404(models::ApiNotFound), - Status422(models::ApiValidationError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`repo_update_avatar`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum RepoUpdateAvatarError { - Status404(models::ApiNotFound), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`repo_update_branch`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum RepoUpdateBranchError { - Status403(models::ApiForbiddenError), - Status404(models::ApiNotFound), - Status422(models::ApiValidationError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`repo_update_file`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum RepoUpdateFileError { - Status403(models::ApiError), - Status404(models::ApiNotFound), - Status409(), - Status413(), - Status422(models::ApiError), - Status423(models::ApiRepoArchivedError), - 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(models::ApiForbiddenError), - Status404(models::ApiNotFound), - Status409(models::ApiError), - Status413(), - Status422(models::ApiValidationError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`repo_update_topics`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum RepoUpdateTopicsError { - Status404(models::ApiNotFound), - Status422(models::ApiInvalidTopicsError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`repo_validate_issue_config`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum RepoValidateIssueConfigError { - Status404(models::ApiNotFound), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`topic_search`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum TopicSearchError { - Status403(models::ApiForbiddenError), - Status404(models::ApiNotFound), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`update_repo_secret`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum UpdateRepoSecretError { - Status400(models::ApiError), - Status404(models::ApiNotFound), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`update_repo_variable`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum UpdateRepoVariableError { - Status400(models::ApiError), - Status404(models::ApiNotFound), - 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 { - Status404(models::ApiNotFound), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`user_current_put_subscription`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum UserCurrentPutSubscriptionError { - Status404(models::ApiNotFound), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`user_tracked_times`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum UserTrackedTimesError { - Status400(models::ApiError), - Status403(models::ApiForbiddenError), - Status404(models::ApiNotFound), - UnknownValue(serde_json::Value), -} - -pub async fn accept_repo_transfer( - configuration: &configuration::Configuration, - owner: &str, - repo: &str, -) -> Result> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_owner = owner; - let p_path_repo = repo; - - let uri_str = format!( - "{}/repos/{owner}/{repo}/transfer/accept", - configuration.base_path, - owner = crate::apis::urlencode(p_path_owner), - repo = crate::apis::urlencode(p_path_repo) - ); - let mut req_builder = configuration - .client - .request(reqwest::Method::POST, &uri_str); - - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("access_token", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("sudo", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("token", value)]); - } - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("X-FORGEJO-OTP", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Authorization", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Sudo", value); - }; - if let Some(ref auth_conf) = configuration.basic_auth { - req_builder = req_builder.basic_auth(auth_conf.0.to_owned(), auth_conf.1.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::Repository`"))), - ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::Repository`")))), - } - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -pub async fn action_run( - configuration: &configuration::Configuration, - owner: &str, - repo: &str, - run_id: i64, -) -> Result> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_owner = owner; - let p_path_repo = repo; - let p_path_run_id = run_id; - - let uri_str = format!( - "{}/repos/{owner}/{repo}/actions/runs/{run_id}", - configuration.base_path, - owner = crate::apis::urlencode(p_path_owner), - repo = crate::apis::urlencode(p_path_repo), - run_id = p_path_run_id - ); - let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); - - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("access_token", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("sudo", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("token", value)]); - } - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("X-FORGEJO-OTP", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Authorization", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Sudo", value); - }; - if let Some(ref auth_conf) = configuration.basic_auth { - req_builder = req_builder.basic_auth(auth_conf.0.to_owned(), auth_conf.1.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::ActionRun`"))), - ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::ActionRun`")))), - } - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -pub async fn create_current_user_repo( - configuration: &configuration::Configuration, - body: Option, -) -> Result> { - // add a prefix to parameters to efficiently prevent name collisions - let p_body_body = body; - - let uri_str = format!("{}/user/repos", configuration.base_path); - let mut req_builder = configuration - .client - .request(reqwest::Method::POST, &uri_str); - - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("access_token", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("sudo", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("token", value)]); - } - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("X-FORGEJO-OTP", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Authorization", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Sudo", value); - }; - if let Some(ref auth_conf) = configuration.basic_auth { - req_builder = req_builder.basic_auth(auth_conf.0.to_owned(), auth_conf.1.to_owned()); - }; - req_builder = req_builder.json(&p_body_body); - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::Repository`"))), - ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::Repository`")))), - } - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -pub async fn create_fork( - configuration: &configuration::Configuration, - owner: &str, - repo: &str, - body: Option, -) -> Result> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_owner = owner; - let p_path_repo = repo; - let p_body_body = body; - - let uri_str = format!( - "{}/repos/{owner}/{repo}/forks", - configuration.base_path, - owner = crate::apis::urlencode(p_path_owner), - repo = crate::apis::urlencode(p_path_repo) - ); - let mut req_builder = configuration - .client - .request(reqwest::Method::POST, &uri_str); - - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("access_token", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("sudo", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("token", value)]); - } - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("X-FORGEJO-OTP", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Authorization", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Sudo", value); - }; - if let Some(ref auth_conf) = configuration.basic_auth { - req_builder = req_builder.basic_auth(auth_conf.0.to_owned(), auth_conf.1.to_owned()); - }; - req_builder = req_builder.json(&p_body_body); - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::Repository`"))), - ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::Repository`")))), - } - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -pub async fn create_repo_variable( - configuration: &configuration::Configuration, - owner: &str, - repo: &str, - variablename: &str, - body: Option, -) -> Result<(), Error> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_owner = owner; - let p_path_repo = repo; - let p_path_variablename = variablename; - let p_body_body = body; - - let uri_str = format!( - "{}/repos/{owner}/{repo}/actions/variables/{variablename}", - configuration.base_path, - owner = crate::apis::urlencode(p_path_owner), - repo = crate::apis::urlencode(p_path_repo), - variablename = crate::apis::urlencode(p_path_variablename) - ); - let mut req_builder = configuration - .client - .request(reqwest::Method::POST, &uri_str); - - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("access_token", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("sudo", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("token", value)]); - } - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("X-FORGEJO-OTP", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Authorization", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Sudo", value); - }; - if let Some(ref auth_conf) = configuration.basic_auth { - req_builder = req_builder.basic_auth(auth_conf.0.to_owned(), auth_conf.1.to_owned()); - }; - req_builder = req_builder.json(&p_body_body); - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - - if !status.is_client_error() && !status.is_server_error() { - Ok(()) - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -pub async fn delete_repo_secret( - configuration: &configuration::Configuration, - owner: &str, - repo: &str, - secretname: &str, -) -> Result<(), Error> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_owner = owner; - let p_path_repo = repo; - let p_path_secretname = secretname; - - let uri_str = format!( - "{}/repos/{owner}/{repo}/actions/secrets/{secretname}", - configuration.base_path, - owner = crate::apis::urlencode(p_path_owner), - repo = crate::apis::urlencode(p_path_repo), - secretname = crate::apis::urlencode(p_path_secretname) - ); - let mut req_builder = configuration - .client - .request(reqwest::Method::DELETE, &uri_str); - - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("access_token", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("sudo", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("token", value)]); - } - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("X-FORGEJO-OTP", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Authorization", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Sudo", value); - }; - if let Some(ref auth_conf) = configuration.basic_auth { - req_builder = req_builder.basic_auth(auth_conf.0.to_owned(), auth_conf.1.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - - if !status.is_client_error() && !status.is_server_error() { - Ok(()) - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -pub async fn delete_repo_variable( - configuration: &configuration::Configuration, - owner: &str, - repo: &str, - variablename: &str, -) -> Result<(), Error> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_owner = owner; - let p_path_repo = repo; - let p_path_variablename = variablename; - - let uri_str = format!( - "{}/repos/{owner}/{repo}/actions/variables/{variablename}", - configuration.base_path, - owner = crate::apis::urlencode(p_path_owner), - repo = crate::apis::urlencode(p_path_repo), - variablename = crate::apis::urlencode(p_path_variablename) - ); - let mut req_builder = configuration - .client - .request(reqwest::Method::DELETE, &uri_str); - - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("access_token", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("sudo", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("token", value)]); - } - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("X-FORGEJO-OTP", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Authorization", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Sudo", value); - }; - if let Some(ref auth_conf) = configuration.basic_auth { - req_builder = req_builder.basic_auth(auth_conf.0.to_owned(), auth_conf.1.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - - if !status.is_client_error() && !status.is_server_error() { - Ok(()) - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -pub async fn dispatch_workflow( - configuration: &configuration::Configuration, - owner: &str, - repo: &str, - workflowfilename: &str, - body: Option, -) -> Result> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_owner = owner; - let p_path_repo = repo; - let p_path_workflowfilename = workflowfilename; - let p_body_body = body; - - let uri_str = format!( - "{}/repos/{owner}/{repo}/actions/workflows/{workflowfilename}/dispatches", - configuration.base_path, - owner = crate::apis::urlencode(p_path_owner), - repo = crate::apis::urlencode(p_path_repo), - workflowfilename = crate::apis::urlencode(p_path_workflowfilename) - ); - let mut req_builder = configuration - .client - .request(reqwest::Method::POST, &uri_str); - - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("access_token", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("sudo", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("token", value)]); - } - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("X-FORGEJO-OTP", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Authorization", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Sudo", value); - }; - if let Some(ref auth_conf) = configuration.basic_auth { - req_builder = req_builder.basic_auth(auth_conf.0.to_owned(), auth_conf.1.to_owned()); - }; - req_builder = req_builder.json(&p_body_body); - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::DispatchWorkflowRun`"))), - ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::DispatchWorkflowRun`")))), - } - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -pub async fn generate_repo( - configuration: &configuration::Configuration, - template_owner: &str, - template_repo: &str, - body: Option, -) -> Result> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_template_owner = template_owner; - let p_path_template_repo = template_repo; - let p_body_body = body; - - let uri_str = format!( - "{}/repos/{template_owner}/{template_repo}/generate", - configuration.base_path, - template_owner = crate::apis::urlencode(p_path_template_owner), - template_repo = crate::apis::urlencode(p_path_template_repo) - ); - let mut req_builder = configuration - .client - .request(reqwest::Method::POST, &uri_str); - - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("access_token", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("sudo", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("token", value)]); - } - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("X-FORGEJO-OTP", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Authorization", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Sudo", value); - }; - if let Some(ref auth_conf) = configuration.basic_auth { - req_builder = req_builder.basic_auth(auth_conf.0.to_owned(), auth_conf.1.to_owned()); - }; - req_builder = req_builder.json(&p_body_body); - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::Repository`"))), - ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::Repository`")))), - } - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -pub async fn get_annotated_tag( - configuration: &configuration::Configuration, - owner: &str, - repo: &str, - sha: &str, -) -> Result> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_owner = owner; - let p_path_repo = repo; - let p_path_sha = sha; - - let uri_str = format!( - "{}/repos/{owner}/{repo}/git/tags/{sha}", - configuration.base_path, - owner = crate::apis::urlencode(p_path_owner), - repo = crate::apis::urlencode(p_path_repo), - sha = crate::apis::urlencode(p_path_sha) - ); - let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); - - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("access_token", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("sudo", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("token", value)]); - } - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("X-FORGEJO-OTP", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Authorization", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Sudo", value); - }; - if let Some(ref auth_conf) = configuration.basic_auth { - req_builder = req_builder.basic_auth(auth_conf.0.to_owned(), auth_conf.1.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::AnnotatedTag`"))), - ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::AnnotatedTag`")))), - } - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -pub async fn get_blob( - configuration: &configuration::Configuration, - owner: &str, - repo: &str, - sha: &str, -) -> Result> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_owner = owner; - let p_path_repo = repo; - let p_path_sha = sha; - - let uri_str = format!( - "{}/repos/{owner}/{repo}/git/blobs/{sha}", - configuration.base_path, - owner = crate::apis::urlencode(p_path_owner), - repo = crate::apis::urlencode(p_path_repo), - sha = crate::apis::urlencode(p_path_sha) - ); - let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); - - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("access_token", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("sudo", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("token", value)]); - } - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("X-FORGEJO-OTP", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Authorization", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Sudo", value); - }; - if let Some(ref auth_conf) = configuration.basic_auth { - req_builder = req_builder.basic_auth(auth_conf.0.to_owned(), auth_conf.1.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::GitBlob`"))), - ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::GitBlob`")))), - } - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -pub async fn get_blobs( - configuration: &configuration::Configuration, - owner: &str, - repo: &str, - shas: &str, -) -> Result, Error> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_owner = owner; - let p_path_repo = repo; - let p_query_shas = shas; - - let uri_str = format!( - "{}/repos/{owner}/{repo}/git/blobs", - configuration.base_path, - owner = crate::apis::urlencode(p_path_owner), - repo = crate::apis::urlencode(p_path_repo) - ); - let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); - - req_builder = req_builder.query(&[("shas", &p_query_shas.to_string())]); - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("access_token", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("sudo", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("token", value)]); - } - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("X-FORGEJO-OTP", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Authorization", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Sudo", value); - }; - if let Some(ref auth_conf) = configuration.basic_auth { - req_builder = req_builder.basic_auth(auth_conf.0.to_owned(), auth_conf.1.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `Vec<models::GitBlob>`"))), - ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `Vec<models::GitBlob>`")))), - } - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -pub async fn get_repo_variable( - configuration: &configuration::Configuration, - owner: &str, - repo: &str, - variablename: &str, -) -> Result> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_owner = owner; - let p_path_repo = repo; - let p_path_variablename = variablename; - - let uri_str = format!( - "{}/repos/{owner}/{repo}/actions/variables/{variablename}", - configuration.base_path, - owner = crate::apis::urlencode(p_path_owner), - repo = crate::apis::urlencode(p_path_repo), - variablename = crate::apis::urlencode(p_path_variablename) - ); - let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); - - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("access_token", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("sudo", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("token", value)]); - } - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("X-FORGEJO-OTP", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Authorization", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Sudo", value); - }; - if let Some(ref auth_conf) = configuration.basic_auth { - req_builder = req_builder.basic_auth(auth_conf.0.to_owned(), auth_conf.1.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::ActionVariable`"))), - ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::ActionVariable`")))), - } - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -pub async fn get_repo_variables_list( - configuration: &configuration::Configuration, - owner: &str, - repo: &str, - page: Option, - limit: Option, -) -> Result, Error> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_owner = owner; - let p_path_repo = repo; - let p_query_page = page; - let p_query_limit = limit; - - let uri_str = format!( - "{}/repos/{owner}/{repo}/actions/variables", - configuration.base_path, - owner = crate::apis::urlencode(p_path_owner), - repo = crate::apis::urlencode(p_path_repo) - ); - let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); - - if let Some(ref param_value) = p_query_page { - req_builder = req_builder.query(&[("page", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_limit { - req_builder = req_builder.query(&[("limit", ¶m_value.to_string())]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("access_token", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("sudo", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("token", value)]); - } - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("X-FORGEJO-OTP", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Authorization", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Sudo", value); - }; - if let Some(ref auth_conf) = configuration.basic_auth { - req_builder = req_builder.basic_auth(auth_conf.0.to_owned(), auth_conf.1.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `Vec<models::ActionVariable>`"))), - ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `Vec<models::ActionVariable>`")))), - } - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -pub async fn get_tree( - configuration: &configuration::Configuration, - owner: &str, - repo: &str, - sha: &str, - recursive: Option, - page: Option, - per_page: Option, -) -> Result> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_owner = owner; - let p_path_repo = repo; - let p_path_sha = sha; - let p_query_recursive = recursive; - let p_query_page = page; - let p_query_per_page = per_page; - - let uri_str = format!( - "{}/repos/{owner}/{repo}/git/trees/{sha}", - configuration.base_path, - owner = crate::apis::urlencode(p_path_owner), - repo = crate::apis::urlencode(p_path_repo), - sha = crate::apis::urlencode(p_path_sha) - ); - let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); - - if let Some(ref param_value) = p_query_recursive { - req_builder = req_builder.query(&[("recursive", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_page { - req_builder = req_builder.query(&[("page", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_per_page { - req_builder = req_builder.query(&[("per_page", ¶m_value.to_string())]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("access_token", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("sudo", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("token", value)]); - } - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("X-FORGEJO-OTP", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Authorization", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Sudo", value); - }; - if let Some(ref auth_conf) = configuration.basic_auth { - req_builder = req_builder.basic_auth(auth_conf.0.to_owned(), auth_conf.1.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::GitTreeResponse`"))), - ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::GitTreeResponse`")))), - } - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -pub async fn list_action_runs( - configuration: &configuration::Configuration, - owner: &str, - repo: &str, - page: Option, - limit: Option, - event: Option>, - status: Option>, - run_number: Option, - head_sha: Option<&str>, -) -> Result> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_owner = owner; - let p_path_repo = repo; - let p_query_page = page; - let p_query_limit = limit; - let p_query_event = event; - let p_query_status = status; - let p_query_run_number = run_number; - let p_query_head_sha = head_sha; - - let uri_str = format!( - "{}/repos/{owner}/{repo}/actions/runs", - configuration.base_path, - owner = crate::apis::urlencode(p_path_owner), - repo = crate::apis::urlencode(p_path_repo) - ); - let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); - - if let Some(ref param_value) = p_query_page { - req_builder = req_builder.query(&[("page", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_limit { - req_builder = req_builder.query(&[("limit", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_event { - req_builder = match "csv" { - "multi" => req_builder.query( - ¶m_value - .into_iter() - .map(|p| ("event".to_owned(), p.to_string())) - .collect::>(), - ), - _ => req_builder.query(&[( - "event", - ¶m_value - .into_iter() - .map(|p| p.to_string()) - .collect::>() - .join(",") - .to_string(), - )]), - }; - } - if let Some(ref param_value) = p_query_status { - req_builder = match "csv" { - "multi" => req_builder.query( - ¶m_value - .into_iter() - .map(|p| ("status".to_owned(), p.to_string())) - .collect::>(), - ), - _ => req_builder.query(&[( - "status", - ¶m_value - .into_iter() - .map(|p| p.to_string()) - .collect::>() - .join(",") - .to_string(), - )]), - }; - } - if let Some(ref param_value) = p_query_run_number { - req_builder = req_builder.query(&[("run_number", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_head_sha { - req_builder = req_builder.query(&[("head_sha", ¶m_value.to_string())]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("access_token", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("sudo", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("token", value)]); - } - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("X-FORGEJO-OTP", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Authorization", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Sudo", value); - }; - if let Some(ref auth_conf) = configuration.basic_auth { - req_builder = req_builder.basic_auth(auth_conf.0.to_owned(), auth_conf.1.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::ListActionRunResponse`"))), - ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::ListActionRunResponse`")))), - } - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -pub async fn list_action_tasks( - configuration: &configuration::Configuration, - owner: &str, - repo: &str, - page: Option, - limit: Option, -) -> Result> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_owner = owner; - let p_path_repo = repo; - let p_query_page = page; - let p_query_limit = limit; - - let uri_str = format!( - "{}/repos/{owner}/{repo}/actions/tasks", - configuration.base_path, - owner = crate::apis::urlencode(p_path_owner), - repo = crate::apis::urlencode(p_path_repo) - ); - let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); - - if let Some(ref param_value) = p_query_page { - req_builder = req_builder.query(&[("page", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_limit { - req_builder = req_builder.query(&[("limit", ¶m_value.to_string())]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("access_token", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("sudo", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("token", value)]); - } - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("X-FORGEJO-OTP", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Authorization", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Sudo", value); - }; - if let Some(ref auth_conf) = configuration.basic_auth { - req_builder = req_builder.basic_auth(auth_conf.0.to_owned(), auth_conf.1.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::ActionTaskResponse`"))), - ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::ActionTaskResponse`")))), - } - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -pub async fn list_forks( - configuration: &configuration::Configuration, - owner: &str, - repo: &str, - page: Option, - limit: Option, -) -> Result, Error> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_owner = owner; - let p_path_repo = repo; - let p_query_page = page; - let p_query_limit = limit; - - let uri_str = format!( - "{}/repos/{owner}/{repo}/forks", - configuration.base_path, - owner = crate::apis::urlencode(p_path_owner), - repo = crate::apis::urlencode(p_path_repo) - ); - let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); - - if let Some(ref param_value) = p_query_page { - req_builder = req_builder.query(&[("page", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_limit { - req_builder = req_builder.query(&[("limit", ¶m_value.to_string())]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("access_token", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("sudo", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("token", value)]); - } - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("X-FORGEJO-OTP", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Authorization", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Sudo", value); - }; - if let Some(ref auth_conf) = configuration.basic_auth { - req_builder = req_builder.basic_auth(auth_conf.0.to_owned(), auth_conf.1.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `Vec<models::Repository>`"))), - ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `Vec<models::Repository>`")))), - } - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -pub async fn reject_repo_transfer( - configuration: &configuration::Configuration, - owner: &str, - repo: &str, -) -> Result> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_owner = owner; - let p_path_repo = repo; - - let uri_str = format!( - "{}/repos/{owner}/{repo}/transfer/reject", - configuration.base_path, - owner = crate::apis::urlencode(p_path_owner), - repo = crate::apis::urlencode(p_path_repo) - ); - let mut req_builder = configuration - .client - .request(reqwest::Method::POST, &uri_str); - - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("access_token", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("sudo", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("token", value)]); - } - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("X-FORGEJO-OTP", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Authorization", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Sudo", value); - }; - if let Some(ref auth_conf) = configuration.basic_auth { - req_builder = req_builder.basic_auth(auth_conf.0.to_owned(), auth_conf.1.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::Repository`"))), - ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::Repository`")))), - } - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -pub async fn repo_add_collaborator( - configuration: &configuration::Configuration, - owner: &str, - repo: &str, - collaborator: &str, - body: Option, -) -> Result<(), Error> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_owner = owner; - let p_path_repo = repo; - let p_path_collaborator = collaborator; - let p_body_body = body; - - let uri_str = format!( - "{}/repos/{owner}/{repo}/collaborators/{collaborator}", - configuration.base_path, - owner = crate::apis::urlencode(p_path_owner), - repo = crate::apis::urlencode(p_path_repo), - collaborator = crate::apis::urlencode(p_path_collaborator) - ); - let mut req_builder = configuration.client.request(reqwest::Method::PUT, &uri_str); - - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("access_token", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("sudo", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("token", value)]); - } - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("X-FORGEJO-OTP", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Authorization", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Sudo", value); - }; - if let Some(ref auth_conf) = configuration.basic_auth { - req_builder = req_builder.basic_auth(auth_conf.0.to_owned(), auth_conf.1.to_owned()); - }; - req_builder = req_builder.json(&p_body_body); - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - - if !status.is_client_error() && !status.is_server_error() { - Ok(()) - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -pub async fn repo_add_flag( - configuration: &configuration::Configuration, - owner: &str, - repo: &str, - flag: &str, -) -> Result<(), Error> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_owner = owner; - let p_path_repo = repo; - let p_path_flag = flag; - - let uri_str = format!( - "{}/repos/{owner}/{repo}/flags/{flag}", - configuration.base_path, - owner = crate::apis::urlencode(p_path_owner), - repo = crate::apis::urlencode(p_path_repo), - flag = crate::apis::urlencode(p_path_flag) - ); - let mut req_builder = configuration.client.request(reqwest::Method::PUT, &uri_str); - - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("access_token", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("sudo", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("token", value)]); - } - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("X-FORGEJO-OTP", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Authorization", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Sudo", value); - }; - if let Some(ref auth_conf) = configuration.basic_auth { - req_builder = req_builder.basic_auth(auth_conf.0.to_owned(), auth_conf.1.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - - if !status.is_client_error() && !status.is_server_error() { - Ok(()) - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -pub async fn repo_add_push_mirror( - configuration: &configuration::Configuration, - owner: &str, - repo: &str, - body: Option, -) -> Result> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_owner = owner; - let p_path_repo = repo; - let p_body_body = body; - - let uri_str = format!( - "{}/repos/{owner}/{repo}/push_mirrors", - configuration.base_path, - owner = crate::apis::urlencode(p_path_owner), - repo = crate::apis::urlencode(p_path_repo) - ); - let mut req_builder = configuration - .client - .request(reqwest::Method::POST, &uri_str); - - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("access_token", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("sudo", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("token", value)]); - } - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("X-FORGEJO-OTP", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Authorization", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Sudo", value); - }; - if let Some(ref auth_conf) = configuration.basic_auth { - req_builder = req_builder.basic_auth(auth_conf.0.to_owned(), auth_conf.1.to_owned()); - }; - req_builder = req_builder.json(&p_body_body); - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::PushMirror`"))), - ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::PushMirror`")))), - } - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -pub async fn repo_add_team( - configuration: &configuration::Configuration, - owner: &str, - repo: &str, - team: &str, -) -> Result<(), Error> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_owner = owner; - let p_path_repo = repo; - let p_path_team = team; - - let uri_str = format!( - "{}/repos/{owner}/{repo}/teams/{team}", - configuration.base_path, - owner = crate::apis::urlencode(p_path_owner), - repo = crate::apis::urlencode(p_path_repo), - team = crate::apis::urlencode(p_path_team) - ); - let mut req_builder = configuration.client.request(reqwest::Method::PUT, &uri_str); - - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("access_token", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("sudo", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("token", value)]); - } - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("X-FORGEJO-OTP", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Authorization", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Sudo", value); - }; - if let Some(ref auth_conf) = configuration.basic_auth { - req_builder = req_builder.basic_auth(auth_conf.0.to_owned(), auth_conf.1.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - - if !status.is_client_error() && !status.is_server_error() { - Ok(()) - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -pub async fn repo_add_topic( - configuration: &configuration::Configuration, - owner: &str, - repo: &str, - topic: &str, -) -> Result<(), Error> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_owner = owner; - let p_path_repo = repo; - let p_path_topic = topic; - - let uri_str = format!( - "{}/repos/{owner}/{repo}/topics/{topic}", - configuration.base_path, - owner = crate::apis::urlencode(p_path_owner), - repo = crate::apis::urlencode(p_path_repo), - topic = crate::apis::urlencode(p_path_topic) - ); - let mut req_builder = configuration.client.request(reqwest::Method::PUT, &uri_str); - - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("access_token", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("sudo", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("token", value)]); - } - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("X-FORGEJO-OTP", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Authorization", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Sudo", value); - }; - if let Some(ref auth_conf) = configuration.basic_auth { - req_builder = req_builder.basic_auth(auth_conf.0.to_owned(), auth_conf.1.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - - if !status.is_client_error() && !status.is_server_error() { - Ok(()) - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -pub async fn repo_apply_diff_patch( - configuration: &configuration::Configuration, - owner: &str, - repo: &str, - body: models::UpdateFileOptions, -) -> Result> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_owner = owner; - let p_path_repo = repo; - let p_body_body = body; - - let uri_str = format!( - "{}/repos/{owner}/{repo}/diffpatch", - configuration.base_path, - owner = crate::apis::urlencode(p_path_owner), - repo = crate::apis::urlencode(p_path_repo) - ); - let mut req_builder = configuration - .client - .request(reqwest::Method::POST, &uri_str); - - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("access_token", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("sudo", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("token", value)]); - } - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("X-FORGEJO-OTP", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Authorization", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Sudo", value); - }; - if let Some(ref auth_conf) = configuration.basic_auth { - req_builder = req_builder.basic_auth(auth_conf.0.to_owned(), auth_conf.1.to_owned()); - }; - req_builder = req_builder.json(&p_body_body); - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::FileResponse`"))), - ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::FileResponse`")))), - } - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -pub async fn repo_cancel_scheduled_auto_merge( - configuration: &configuration::Configuration, - owner: &str, - repo: &str, - index: i64, -) -> Result<(), Error> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_owner = owner; - let p_path_repo = repo; - let p_path_index = index; - - let uri_str = format!( - "{}/repos/{owner}/{repo}/pulls/{index}/merge", - configuration.base_path, - owner = crate::apis::urlencode(p_path_owner), - repo = crate::apis::urlencode(p_path_repo), - index = p_path_index - ); - let mut req_builder = configuration - .client - .request(reqwest::Method::DELETE, &uri_str); - - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("access_token", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("sudo", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("token", value)]); - } - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("X-FORGEJO-OTP", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Authorization", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Sudo", value); - }; - if let Some(ref auth_conf) = configuration.basic_auth { - req_builder = req_builder.basic_auth(auth_conf.0.to_owned(), auth_conf.1.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - - if !status.is_client_error() && !status.is_server_error() { - Ok(()) - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -pub async fn repo_change_files( - configuration: &configuration::Configuration, - owner: &str, - repo: &str, - body: models::ChangeFilesOptions, -) -> Result> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_owner = owner; - let p_path_repo = repo; - let p_body_body = body; - - let uri_str = format!( - "{}/repos/{owner}/{repo}/contents", - configuration.base_path, - owner = crate::apis::urlencode(p_path_owner), - repo = crate::apis::urlencode(p_path_repo) - ); - let mut req_builder = configuration - .client - .request(reqwest::Method::POST, &uri_str); - - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("access_token", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("sudo", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("token", value)]); - } - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("X-FORGEJO-OTP", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Authorization", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Sudo", value); - }; - if let Some(ref auth_conf) = configuration.basic_auth { - req_builder = req_builder.basic_auth(auth_conf.0.to_owned(), auth_conf.1.to_owned()); - }; - req_builder = req_builder.json(&p_body_body); - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::FilesResponse`"))), - ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::FilesResponse`")))), - } - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// If the user is a collaborator, return 204. If the user is not a collaborator, return 404. -pub async fn repo_check_collaborator( - configuration: &configuration::Configuration, - owner: &str, - repo: &str, - collaborator: &str, -) -> Result<(), Error> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_owner = owner; - let p_path_repo = repo; - let p_path_collaborator = collaborator; - - let uri_str = format!( - "{}/repos/{owner}/{repo}/collaborators/{collaborator}", - configuration.base_path, - owner = crate::apis::urlencode(p_path_owner), - repo = crate::apis::urlencode(p_path_repo), - collaborator = crate::apis::urlencode(p_path_collaborator) - ); - let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); - - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("access_token", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("sudo", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("token", value)]); - } - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("X-FORGEJO-OTP", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Authorization", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Sudo", value); - }; - if let Some(ref auth_conf) = configuration.basic_auth { - req_builder = req_builder.basic_auth(auth_conf.0.to_owned(), auth_conf.1.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - - if !status.is_client_error() && !status.is_server_error() { - Ok(()) - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -pub async fn repo_check_flag( - configuration: &configuration::Configuration, - owner: &str, - repo: &str, - flag: &str, -) -> Result<(), Error> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_owner = owner; - let p_path_repo = repo; - let p_path_flag = flag; - - let uri_str = format!( - "{}/repos/{owner}/{repo}/flags/{flag}", - configuration.base_path, - owner = crate::apis::urlencode(p_path_owner), - repo = crate::apis::urlencode(p_path_repo), - flag = crate::apis::urlencode(p_path_flag) - ); - let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); - - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("access_token", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("sudo", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("token", value)]); - } - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("X-FORGEJO-OTP", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Authorization", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Sudo", value); - }; - if let Some(ref auth_conf) = configuration.basic_auth { - req_builder = req_builder.basic_auth(auth_conf.0.to_owned(), auth_conf.1.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - - if !status.is_client_error() && !status.is_server_error() { - Ok(()) - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -pub async fn repo_check_team( - configuration: &configuration::Configuration, - owner: &str, - repo: &str, - team: &str, -) -> Result> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_owner = owner; - let p_path_repo = repo; - let p_path_team = team; - - let uri_str = format!( - "{}/repos/{owner}/{repo}/teams/{team}", - configuration.base_path, - owner = crate::apis::urlencode(p_path_owner), - repo = crate::apis::urlencode(p_path_repo), - team = crate::apis::urlencode(p_path_team) - ); - let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); - - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("access_token", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("sudo", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("token", value)]); - } - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("X-FORGEJO-OTP", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Authorization", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Sudo", value); - }; - if let Some(ref auth_conf) = configuration.basic_auth { - req_builder = req_builder.basic_auth(auth_conf.0.to_owned(), auth_conf.1.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::Team`"))), - ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::Team`")))), - } - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -pub async fn repo_compare_diff( - configuration: &configuration::Configuration, - owner: &str, - repo: &str, - basehead: &str, -) -> Result> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_owner = owner; - let p_path_repo = repo; - let p_path_basehead = basehead; - - let uri_str = format!( - "{}/repos/{owner}/{repo}/compare/{basehead}", - configuration.base_path, - owner = crate::apis::urlencode(p_path_owner), - repo = crate::apis::urlencode(p_path_repo), - basehead = crate::apis::urlencode(p_path_basehead) - ); - let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); - - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("access_token", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("sudo", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("token", value)]); - } - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("X-FORGEJO-OTP", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Authorization", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Sudo", value); - }; - if let Some(ref auth_conf) = configuration.basic_auth { - req_builder = req_builder.basic_auth(auth_conf.0.to_owned(), auth_conf.1.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::Compare`"))), - ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::Compare`")))), - } - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -pub async fn repo_convert( - configuration: &configuration::Configuration, - owner: &str, - repo: &str, -) -> Result> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_owner = owner; - let p_path_repo = repo; - - let uri_str = format!( - "{}/repos/{owner}/{repo}/convert", - configuration.base_path, - owner = crate::apis::urlencode(p_path_owner), - repo = crate::apis::urlencode(p_path_repo) - ); - let mut req_builder = configuration - .client - .request(reqwest::Method::POST, &uri_str); - - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("access_token", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("sudo", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("token", value)]); - } - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("X-FORGEJO-OTP", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Authorization", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Sudo", value); - }; - if let Some(ref auth_conf) = configuration.basic_auth { - req_builder = req_builder.basic_auth(auth_conf.0.to_owned(), auth_conf.1.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::Repository`"))), - ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::Repository`")))), - } - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -pub async fn repo_create_branch( - configuration: &configuration::Configuration, - owner: &str, - repo: &str, - body: Option, -) -> Result> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_owner = owner; - let p_path_repo = repo; - let p_body_body = body; - - let uri_str = format!( - "{}/repos/{owner}/{repo}/branches", - configuration.base_path, - owner = crate::apis::urlencode(p_path_owner), - repo = crate::apis::urlencode(p_path_repo) - ); - let mut req_builder = configuration - .client - .request(reqwest::Method::POST, &uri_str); - - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("access_token", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("sudo", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("token", value)]); - } - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("X-FORGEJO-OTP", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Authorization", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Sudo", value); - }; - if let Some(ref auth_conf) = configuration.basic_auth { - req_builder = req_builder.basic_auth(auth_conf.0.to_owned(), auth_conf.1.to_owned()); - }; - req_builder = req_builder.json(&p_body_body); - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::Branch`"))), - ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::Branch`")))), - } - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -pub async fn repo_create_branch_protection( - configuration: &configuration::Configuration, - owner: &str, - repo: &str, - body: Option, -) -> Result> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_owner = owner; - let p_path_repo = repo; - let p_body_body = body; - - let uri_str = format!( - "{}/repos/{owner}/{repo}/branch_protections", - configuration.base_path, - owner = crate::apis::urlencode(p_path_owner), - repo = crate::apis::urlencode(p_path_repo) - ); - let mut req_builder = configuration - .client - .request(reqwest::Method::POST, &uri_str); - - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("access_token", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("sudo", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("token", value)]); - } - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("X-FORGEJO-OTP", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Authorization", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Sudo", value); - }; - if let Some(ref auth_conf) = configuration.basic_auth { - req_builder = req_builder.basic_auth(auth_conf.0.to_owned(), auth_conf.1.to_owned()); - }; - req_builder = req_builder.json(&p_body_body); - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::BranchProtection`"))), - ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::BranchProtection`")))), - } - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -pub async fn repo_create_file( - configuration: &configuration::Configuration, - owner: &str, - repo: &str, - filepath: &str, - body: models::CreateFileOptions, -) -> Result> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_owner = owner; - let p_path_repo = repo; - let p_path_filepath = filepath; - let p_body_body = body; - - let uri_str = format!( - "{}/repos/{owner}/{repo}/contents/{filepath}", - configuration.base_path, - owner = crate::apis::urlencode(p_path_owner), - repo = crate::apis::urlencode(p_path_repo), - filepath = crate::apis::urlencode(p_path_filepath) - ); - let mut req_builder = configuration - .client - .request(reqwest::Method::POST, &uri_str); - - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("access_token", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("sudo", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("token", value)]); - } - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("X-FORGEJO-OTP", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Authorization", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Sudo", value); - }; - if let Some(ref auth_conf) = configuration.basic_auth { - req_builder = req_builder.basic_auth(auth_conf.0.to_owned(), auth_conf.1.to_owned()); - }; - req_builder = req_builder.json(&p_body_body); - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::FileResponse`"))), - ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::FileResponse`")))), - } - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -pub async fn repo_create_hook( - configuration: &configuration::Configuration, - owner: &str, - repo: &str, - body: Option, -) -> Result> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_owner = owner; - let p_path_repo = repo; - let p_body_body = body; - - let uri_str = format!( - "{}/repos/{owner}/{repo}/hooks", - configuration.base_path, - owner = crate::apis::urlencode(p_path_owner), - repo = crate::apis::urlencode(p_path_repo) - ); - let mut req_builder = configuration - .client - .request(reqwest::Method::POST, &uri_str); - - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("access_token", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("sudo", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("token", value)]); - } - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("X-FORGEJO-OTP", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Authorization", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Sudo", value); - }; - if let Some(ref auth_conf) = configuration.basic_auth { - req_builder = req_builder.basic_auth(auth_conf.0.to_owned(), auth_conf.1.to_owned()); - }; - req_builder = req_builder.json(&p_body_body); - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::Hook`"))), - ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::Hook`")))), - } - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -pub async fn repo_create_key( - configuration: &configuration::Configuration, - owner: &str, - repo: &str, - body: Option, -) -> Result> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_owner = owner; - let p_path_repo = repo; - let p_body_body = body; - - let uri_str = format!( - "{}/repos/{owner}/{repo}/keys", - configuration.base_path, - owner = crate::apis::urlencode(p_path_owner), - repo = crate::apis::urlencode(p_path_repo) - ); - let mut req_builder = configuration - .client - .request(reqwest::Method::POST, &uri_str); - - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("access_token", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("sudo", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("token", value)]); - } - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("X-FORGEJO-OTP", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Authorization", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Sudo", value); - }; - if let Some(ref auth_conf) = configuration.basic_auth { - req_builder = req_builder.basic_auth(auth_conf.0.to_owned(), auth_conf.1.to_owned()); - }; - req_builder = req_builder.json(&p_body_body); - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::DeployKey`"))), - ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::DeployKey`")))), - } - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -pub async fn repo_create_pull_request( - configuration: &configuration::Configuration, - owner: &str, - repo: &str, - body: Option, -) -> Result> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_owner = owner; - let p_path_repo = repo; - let p_body_body = body; - - let uri_str = format!( - "{}/repos/{owner}/{repo}/pulls", - configuration.base_path, - owner = crate::apis::urlencode(p_path_owner), - repo = crate::apis::urlencode(p_path_repo) - ); - let mut req_builder = configuration - .client - .request(reqwest::Method::POST, &uri_str); - - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("access_token", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("sudo", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("token", value)]); - } - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("X-FORGEJO-OTP", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Authorization", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Sudo", value); - }; - if let Some(ref auth_conf) = configuration.basic_auth { - req_builder = req_builder.basic_auth(auth_conf.0.to_owned(), auth_conf.1.to_owned()); - }; - req_builder = req_builder.json(&p_body_body); - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::PullRequest`"))), - ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::PullRequest`")))), - } - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -pub async fn repo_create_pull_review( - configuration: &configuration::Configuration, - owner: &str, - repo: &str, - index: i64, - body: models::CreatePullReviewOptions, -) -> Result> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_owner = owner; - let p_path_repo = repo; - let p_path_index = index; - let p_body_body = body; - - let uri_str = format!( - "{}/repos/{owner}/{repo}/pulls/{index}/reviews", - configuration.base_path, - owner = crate::apis::urlencode(p_path_owner), - repo = crate::apis::urlencode(p_path_repo), - index = p_path_index - ); - let mut req_builder = configuration - .client - .request(reqwest::Method::POST, &uri_str); - - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("access_token", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("sudo", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("token", value)]); - } - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("X-FORGEJO-OTP", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Authorization", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Sudo", value); - }; - if let Some(ref auth_conf) = configuration.basic_auth { - req_builder = req_builder.basic_auth(auth_conf.0.to_owned(), auth_conf.1.to_owned()); - }; - req_builder = req_builder.json(&p_body_body); - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::PullReview`"))), - ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::PullReview`")))), - } - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -pub async fn repo_create_pull_review_comment( - configuration: &configuration::Configuration, - owner: &str, - repo: &str, - index: i64, - id: i64, - body: models::CreatePullReviewComment, -) -> Result> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_owner = owner; - let p_path_repo = repo; - let p_path_index = index; - let p_path_id = id; - let p_body_body = body; - - let uri_str = format!( - "{}/repos/{owner}/{repo}/pulls/{index}/reviews/{id}/comments", - configuration.base_path, - owner = crate::apis::urlencode(p_path_owner), - repo = crate::apis::urlencode(p_path_repo), - index = p_path_index, - id = p_path_id - ); - let mut req_builder = configuration - .client - .request(reqwest::Method::POST, &uri_str); - - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("access_token", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("sudo", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("token", value)]); - } - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("X-FORGEJO-OTP", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Authorization", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Sudo", value); - }; - if let Some(ref auth_conf) = configuration.basic_auth { - req_builder = req_builder.basic_auth(auth_conf.0.to_owned(), auth_conf.1.to_owned()); - }; - req_builder = req_builder.json(&p_body_body); - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::PullReviewComment`"))), - ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::PullReviewComment`")))), - } - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -pub async fn repo_create_pull_review_requests( - configuration: &configuration::Configuration, - owner: &str, - repo: &str, - index: i64, - body: models::PullReviewRequestOptions, -) -> Result, Error> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_owner = owner; - let p_path_repo = repo; - let p_path_index = index; - let p_body_body = body; - - let uri_str = format!( - "{}/repos/{owner}/{repo}/pulls/{index}/requested_reviewers", - configuration.base_path, - owner = crate::apis::urlencode(p_path_owner), - repo = crate::apis::urlencode(p_path_repo), - index = p_path_index - ); - let mut req_builder = configuration - .client - .request(reqwest::Method::POST, &uri_str); - - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("access_token", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("sudo", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("token", value)]); - } - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("X-FORGEJO-OTP", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Authorization", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Sudo", value); - }; - if let Some(ref auth_conf) = configuration.basic_auth { - req_builder = req_builder.basic_auth(auth_conf.0.to_owned(), auth_conf.1.to_owned()); - }; - req_builder = req_builder.json(&p_body_body); - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `Vec<models::PullReview>`"))), - ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `Vec<models::PullReview>`")))), - } - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -pub async fn repo_create_release( - configuration: &configuration::Configuration, - owner: &str, - repo: &str, - body: Option, -) -> Result> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_owner = owner; - let p_path_repo = repo; - let p_body_body = body; - - let uri_str = format!( - "{}/repos/{owner}/{repo}/releases", - configuration.base_path, - owner = crate::apis::urlencode(p_path_owner), - repo = crate::apis::urlencode(p_path_repo) - ); - let mut req_builder = configuration - .client - .request(reqwest::Method::POST, &uri_str); - - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("access_token", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("sudo", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("token", value)]); - } - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("X-FORGEJO-OTP", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Authorization", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Sudo", value); - }; - if let Some(ref auth_conf) = configuration.basic_auth { - req_builder = req_builder.basic_auth(auth_conf.0.to_owned(), auth_conf.1.to_owned()); - }; - req_builder = req_builder.json(&p_body_body); - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::Release`"))), - ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::Release`")))), - } - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -pub async fn repo_create_release_attachment( - configuration: &configuration::Configuration, - owner: &str, - repo: &str, - id: i64, - name: Option<&str>, - attachment: Option, - external_url: Option<&str>, -) -> Result> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_owner = owner; - let p_path_repo = repo; - let p_path_id = id; - let p_query_name = name; - let p_form_attachment = attachment; - let p_form_external_url = external_url; - - let uri_str = format!( - "{}/repos/{owner}/{repo}/releases/{id}/assets", - configuration.base_path, - owner = crate::apis::urlencode(p_path_owner), - repo = crate::apis::urlencode(p_path_repo), - id = p_path_id - ); - let mut req_builder = configuration - .client - .request(reqwest::Method::POST, &uri_str); - - if let Some(ref param_value) = p_query_name { - req_builder = req_builder.query(&[("name", ¶m_value.to_string())]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("access_token", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("sudo", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("token", value)]); - } - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("X-FORGEJO-OTP", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Authorization", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Sudo", value); - }; - if let Some(ref auth_conf) = configuration.basic_auth { - req_builder = req_builder.basic_auth(auth_conf.0.to_owned(), auth_conf.1.to_owned()); - }; - let mut multipart_form = reqwest::multipart::Form::new(); - if let Some(ref param_value) = p_form_attachment { - let file = TokioFile::open(param_value).await?; - let stream = FramedRead::new(file, BytesCodec::new()); - let file_name = param_value - .file_name() - .map(|n| n.to_string_lossy().to_string()) - .unwrap_or_default(); - let file_part = reqwest::multipart::Part::stream(reqwest::Body::wrap_stream(stream)) - .file_name(file_name); - multipart_form = multipart_form.part("attachment", file_part); - } - if let Some(param_value) = p_form_external_url { - multipart_form = multipart_form.text("external_url", param_value.to_string()); - } - req_builder = req_builder.multipart(multipart_form); - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::Attachment`"))), - ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::Attachment`")))), - } - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -pub async fn repo_create_status( - configuration: &configuration::Configuration, - owner: &str, - repo: &str, - sha: &str, - body: Option, -) -> Result> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_owner = owner; - let p_path_repo = repo; - let p_path_sha = sha; - let p_body_body = body; - - let uri_str = format!( - "{}/repos/{owner}/{repo}/statuses/{sha}", - configuration.base_path, - owner = crate::apis::urlencode(p_path_owner), - repo = crate::apis::urlencode(p_path_repo), - sha = crate::apis::urlencode(p_path_sha) - ); - let mut req_builder = configuration - .client - .request(reqwest::Method::POST, &uri_str); - - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("access_token", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("sudo", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("token", value)]); - } - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("X-FORGEJO-OTP", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Authorization", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Sudo", value); - }; - if let Some(ref auth_conf) = configuration.basic_auth { - req_builder = req_builder.basic_auth(auth_conf.0.to_owned(), auth_conf.1.to_owned()); - }; - req_builder = req_builder.json(&p_body_body); - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::CommitStatus`"))), - ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::CommitStatus`")))), - } - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -pub async fn repo_create_tag( - configuration: &configuration::Configuration, - owner: &str, - repo: &str, - body: Option, -) -> Result> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_owner = owner; - let p_path_repo = repo; - let p_body_body = body; - - let uri_str = format!( - "{}/repos/{owner}/{repo}/tags", - configuration.base_path, - owner = crate::apis::urlencode(p_path_owner), - repo = crate::apis::urlencode(p_path_repo) - ); - let mut req_builder = configuration - .client - .request(reqwest::Method::POST, &uri_str); - - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("access_token", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("sudo", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("token", value)]); - } - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("X-FORGEJO-OTP", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Authorization", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Sudo", value); - }; - if let Some(ref auth_conf) = configuration.basic_auth { - req_builder = req_builder.basic_auth(auth_conf.0.to_owned(), auth_conf.1.to_owned()); - }; - req_builder = req_builder.json(&p_body_body); - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::Tag`"))), - ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::Tag`")))), - } - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -pub async fn repo_create_tag_protection( - configuration: &configuration::Configuration, - owner: &str, - repo: &str, - body: Option, -) -> Result> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_owner = owner; - let p_path_repo = repo; - let p_body_body = body; - - let uri_str = format!( - "{}/repos/{owner}/{repo}/tag_protections", - configuration.base_path, - owner = crate::apis::urlencode(p_path_owner), - repo = crate::apis::urlencode(p_path_repo) - ); - let mut req_builder = configuration - .client - .request(reqwest::Method::POST, &uri_str); - - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("access_token", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("sudo", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("token", value)]); - } - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("X-FORGEJO-OTP", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Authorization", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Sudo", value); - }; - if let Some(ref auth_conf) = configuration.basic_auth { - req_builder = req_builder.basic_auth(auth_conf.0.to_owned(), auth_conf.1.to_owned()); - }; - req_builder = req_builder.json(&p_body_body); - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::TagProtection`"))), - ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::TagProtection`")))), - } - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -pub async fn repo_create_wiki_page( - configuration: &configuration::Configuration, - owner: &str, - repo: &str, - body: Option, -) -> Result> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_owner = owner; - let p_path_repo = repo; - let p_body_body = body; - - let uri_str = format!( - "{}/repos/{owner}/{repo}/wiki/new", - configuration.base_path, - owner = crate::apis::urlencode(p_path_owner), - repo = crate::apis::urlencode(p_path_repo) - ); - let mut req_builder = configuration - .client - .request(reqwest::Method::POST, &uri_str); - - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("access_token", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("sudo", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("token", value)]); - } - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("X-FORGEJO-OTP", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Authorization", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Sudo", value); - }; - if let Some(ref auth_conf) = configuration.basic_auth { - req_builder = req_builder.basic_auth(auth_conf.0.to_owned(), auth_conf.1.to_owned()); - }; - req_builder = req_builder.json(&p_body_body); - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::WikiPage`"))), - ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::WikiPage`")))), - } - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -pub async fn repo_delete( - configuration: &configuration::Configuration, - owner: &str, - repo: &str, -) -> Result<(), Error> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_owner = owner; - let p_path_repo = repo; - - let uri_str = format!( - "{}/repos/{owner}/{repo}", - configuration.base_path, - owner = crate::apis::urlencode(p_path_owner), - repo = crate::apis::urlencode(p_path_repo) - ); - let mut req_builder = configuration - .client - .request(reqwest::Method::DELETE, &uri_str); - - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("access_token", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("sudo", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("token", value)]); - } - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("X-FORGEJO-OTP", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Authorization", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Sudo", value); - }; - if let Some(ref auth_conf) = configuration.basic_auth { - req_builder = req_builder.basic_auth(auth_conf.0.to_owned(), auth_conf.1.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - - if !status.is_client_error() && !status.is_server_error() { - Ok(()) - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -pub async fn repo_delete_all_flags( - configuration: &configuration::Configuration, - owner: &str, - repo: &str, -) -> Result<(), Error> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_owner = owner; - let p_path_repo = repo; - - let uri_str = format!( - "{}/repos/{owner}/{repo}/flags", - configuration.base_path, - owner = crate::apis::urlencode(p_path_owner), - repo = crate::apis::urlencode(p_path_repo) - ); - let mut req_builder = configuration - .client - .request(reqwest::Method::DELETE, &uri_str); - - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("access_token", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("sudo", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("token", value)]); - } - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("X-FORGEJO-OTP", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Authorization", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Sudo", value); - }; - if let Some(ref auth_conf) = configuration.basic_auth { - req_builder = req_builder.basic_auth(auth_conf.0.to_owned(), auth_conf.1.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - - if !status.is_client_error() && !status.is_server_error() { - Ok(()) - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -pub async fn repo_delete_avatar( - configuration: &configuration::Configuration, - owner: &str, - repo: &str, -) -> Result<(), Error> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_owner = owner; - let p_path_repo = repo; - - let uri_str = format!( - "{}/repos/{owner}/{repo}/avatar", - configuration.base_path, - owner = crate::apis::urlencode(p_path_owner), - repo = crate::apis::urlencode(p_path_repo) - ); - let mut req_builder = configuration - .client - .request(reqwest::Method::DELETE, &uri_str); - - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("access_token", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("sudo", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("token", value)]); - } - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("X-FORGEJO-OTP", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Authorization", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Sudo", value); - }; - if let Some(ref auth_conf) = configuration.basic_auth { - req_builder = req_builder.basic_auth(auth_conf.0.to_owned(), auth_conf.1.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - - if !status.is_client_error() && !status.is_server_error() { - Ok(()) - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -pub async fn repo_delete_branch( - configuration: &configuration::Configuration, - owner: &str, - repo: &str, - branch: &str, -) -> Result<(), Error> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_owner = owner; - let p_path_repo = repo; - let p_path_branch = branch; - - let uri_str = format!( - "{}/repos/{owner}/{repo}/branches/{branch}", - configuration.base_path, - owner = crate::apis::urlencode(p_path_owner), - repo = crate::apis::urlencode(p_path_repo), - branch = crate::apis::urlencode(p_path_branch) - ); - let mut req_builder = configuration - .client - .request(reqwest::Method::DELETE, &uri_str); - - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("access_token", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("sudo", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("token", value)]); - } - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("X-FORGEJO-OTP", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Authorization", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Sudo", value); - }; - if let Some(ref auth_conf) = configuration.basic_auth { - req_builder = req_builder.basic_auth(auth_conf.0.to_owned(), auth_conf.1.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - - if !status.is_client_error() && !status.is_server_error() { - Ok(()) - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -pub async fn repo_delete_branch_protection( - configuration: &configuration::Configuration, - owner: &str, - repo: &str, - name: &str, -) -> Result<(), Error> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_owner = owner; - let p_path_repo = repo; - let p_path_name = name; - - let uri_str = format!( - "{}/repos/{owner}/{repo}/branch_protections/{name}", - configuration.base_path, - owner = crate::apis::urlencode(p_path_owner), - repo = crate::apis::urlencode(p_path_repo), - name = crate::apis::urlencode(p_path_name) - ); - let mut req_builder = configuration - .client - .request(reqwest::Method::DELETE, &uri_str); - - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("access_token", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("sudo", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("token", value)]); - } - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("X-FORGEJO-OTP", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Authorization", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Sudo", value); - }; - if let Some(ref auth_conf) = configuration.basic_auth { - req_builder = req_builder.basic_auth(auth_conf.0.to_owned(), auth_conf.1.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - - if !status.is_client_error() && !status.is_server_error() { - Ok(()) - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -pub async fn repo_delete_collaborator( - configuration: &configuration::Configuration, - owner: &str, - repo: &str, - collaborator: &str, -) -> Result<(), Error> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_owner = owner; - let p_path_repo = repo; - let p_path_collaborator = collaborator; - - let uri_str = format!( - "{}/repos/{owner}/{repo}/collaborators/{collaborator}", - configuration.base_path, - owner = crate::apis::urlencode(p_path_owner), - repo = crate::apis::urlencode(p_path_repo), - collaborator = crate::apis::urlencode(p_path_collaborator) - ); - let mut req_builder = configuration - .client - .request(reqwest::Method::DELETE, &uri_str); - - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("access_token", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("sudo", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("token", value)]); - } - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("X-FORGEJO-OTP", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Authorization", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Sudo", value); - }; - if let Some(ref auth_conf) = configuration.basic_auth { - req_builder = req_builder.basic_auth(auth_conf.0.to_owned(), auth_conf.1.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - - if !status.is_client_error() && !status.is_server_error() { - Ok(()) - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -pub async fn repo_delete_file( - configuration: &configuration::Configuration, - owner: &str, - repo: &str, - filepath: &str, - body: models::DeleteFileOptions, -) -> Result> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_owner = owner; - let p_path_repo = repo; - let p_path_filepath = filepath; - let p_body_body = body; - - let uri_str = format!( - "{}/repos/{owner}/{repo}/contents/{filepath}", - configuration.base_path, - owner = crate::apis::urlencode(p_path_owner), - repo = crate::apis::urlencode(p_path_repo), - filepath = crate::apis::urlencode(p_path_filepath) - ); - let mut req_builder = configuration - .client - .request(reqwest::Method::DELETE, &uri_str); - - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("access_token", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("sudo", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("token", value)]); - } - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("X-FORGEJO-OTP", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Authorization", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Sudo", value); - }; - if let Some(ref auth_conf) = configuration.basic_auth { - req_builder = req_builder.basic_auth(auth_conf.0.to_owned(), auth_conf.1.to_owned()); - }; - req_builder = req_builder.json(&p_body_body); - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::FileDeleteResponse`"))), - ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::FileDeleteResponse`")))), - } - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -pub async fn repo_delete_flag( - configuration: &configuration::Configuration, - owner: &str, - repo: &str, - flag: &str, -) -> Result<(), Error> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_owner = owner; - let p_path_repo = repo; - let p_path_flag = flag; - - let uri_str = format!( - "{}/repos/{owner}/{repo}/flags/{flag}", - configuration.base_path, - owner = crate::apis::urlencode(p_path_owner), - repo = crate::apis::urlencode(p_path_repo), - flag = crate::apis::urlencode(p_path_flag) - ); - let mut req_builder = configuration - .client - .request(reqwest::Method::DELETE, &uri_str); - - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("access_token", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("sudo", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("token", value)]); - } - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("X-FORGEJO-OTP", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Authorization", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Sudo", value); - }; - if let Some(ref auth_conf) = configuration.basic_auth { - req_builder = req_builder.basic_auth(auth_conf.0.to_owned(), auth_conf.1.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - - if !status.is_client_error() && !status.is_server_error() { - Ok(()) - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -pub async fn repo_delete_git_hook( - configuration: &configuration::Configuration, - owner: &str, - repo: &str, - id: &str, -) -> Result<(), Error> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_owner = owner; - let p_path_repo = repo; - let p_path_id = id; - - let uri_str = format!( - "{}/repos/{owner}/{repo}/hooks/git/{id}", - configuration.base_path, - owner = crate::apis::urlencode(p_path_owner), - repo = crate::apis::urlencode(p_path_repo), - id = crate::apis::urlencode(p_path_id) - ); - let mut req_builder = configuration - .client - .request(reqwest::Method::DELETE, &uri_str); - - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("access_token", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("sudo", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("token", value)]); - } - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("X-FORGEJO-OTP", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Authorization", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Sudo", value); - }; - if let Some(ref auth_conf) = configuration.basic_auth { - req_builder = req_builder.basic_auth(auth_conf.0.to_owned(), auth_conf.1.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - - if !status.is_client_error() && !status.is_server_error() { - Ok(()) - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -pub async fn repo_delete_hook( - configuration: &configuration::Configuration, - owner: &str, - repo: &str, - id: i64, -) -> Result<(), Error> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_owner = owner; - let p_path_repo = repo; - let p_path_id = id; - - let uri_str = format!( - "{}/repos/{owner}/{repo}/hooks/{id}", - configuration.base_path, - owner = crate::apis::urlencode(p_path_owner), - repo = crate::apis::urlencode(p_path_repo), - id = p_path_id - ); - let mut req_builder = configuration - .client - .request(reqwest::Method::DELETE, &uri_str); - - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("access_token", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("sudo", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("token", value)]); - } - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("X-FORGEJO-OTP", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Authorization", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Sudo", value); - }; - if let Some(ref auth_conf) = configuration.basic_auth { - req_builder = req_builder.basic_auth(auth_conf.0.to_owned(), auth_conf.1.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - - if !status.is_client_error() && !status.is_server_error() { - Ok(()) - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -pub async fn repo_delete_key( - configuration: &configuration::Configuration, - owner: &str, - repo: &str, - id: i64, -) -> Result<(), Error> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_owner = owner; - let p_path_repo = repo; - let p_path_id = id; - - let uri_str = format!( - "{}/repos/{owner}/{repo}/keys/{id}", - configuration.base_path, - owner = crate::apis::urlencode(p_path_owner), - repo = crate::apis::urlencode(p_path_repo), - id = p_path_id - ); - let mut req_builder = configuration - .client - .request(reqwest::Method::DELETE, &uri_str); - - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("access_token", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("sudo", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("token", value)]); - } - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("X-FORGEJO-OTP", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Authorization", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Sudo", value); - }; - if let Some(ref auth_conf) = configuration.basic_auth { - req_builder = req_builder.basic_auth(auth_conf.0.to_owned(), auth_conf.1.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - - if !status.is_client_error() && !status.is_server_error() { - Ok(()) - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -pub async fn repo_delete_pull_review( - configuration: &configuration::Configuration, - owner: &str, - repo: &str, - index: i64, - id: i64, -) -> Result<(), Error> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_owner = owner; - let p_path_repo = repo; - let p_path_index = index; - let p_path_id = id; - - let uri_str = format!( - "{}/repos/{owner}/{repo}/pulls/{index}/reviews/{id}", - configuration.base_path, - owner = crate::apis::urlencode(p_path_owner), - repo = crate::apis::urlencode(p_path_repo), - index = p_path_index, - id = p_path_id - ); - let mut req_builder = configuration - .client - .request(reqwest::Method::DELETE, &uri_str); - - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("access_token", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("sudo", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("token", value)]); - } - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("X-FORGEJO-OTP", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Authorization", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Sudo", value); - }; - if let Some(ref auth_conf) = configuration.basic_auth { - req_builder = req_builder.basic_auth(auth_conf.0.to_owned(), auth_conf.1.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - - if !status.is_client_error() && !status.is_server_error() { - Ok(()) - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -pub async fn repo_delete_pull_review_comment( - configuration: &configuration::Configuration, - owner: &str, - repo: &str, - index: i64, - id: i64, - comment: i64, -) -> Result<(), Error> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_owner = owner; - let p_path_repo = repo; - let p_path_index = index; - let p_path_id = id; - let p_path_comment = comment; - - let uri_str = format!( - "{}/repos/{owner}/{repo}/pulls/{index}/reviews/{id}/comments/{comment}", - configuration.base_path, - owner = crate::apis::urlencode(p_path_owner), - repo = crate::apis::urlencode(p_path_repo), - index = p_path_index, - id = p_path_id, - comment = p_path_comment - ); - let mut req_builder = configuration - .client - .request(reqwest::Method::DELETE, &uri_str); - - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("access_token", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("sudo", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("token", value)]); - } - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("X-FORGEJO-OTP", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Authorization", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Sudo", value); - }; - if let Some(ref auth_conf) = configuration.basic_auth { - req_builder = req_builder.basic_auth(auth_conf.0.to_owned(), auth_conf.1.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - - if !status.is_client_error() && !status.is_server_error() { - Ok(()) - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -pub async fn repo_delete_pull_review_requests( - configuration: &configuration::Configuration, - owner: &str, - repo: &str, - index: i64, - body: models::PullReviewRequestOptions, -) -> Result<(), Error> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_owner = owner; - let p_path_repo = repo; - let p_path_index = index; - let p_body_body = body; - - let uri_str = format!( - "{}/repos/{owner}/{repo}/pulls/{index}/requested_reviewers", - configuration.base_path, - owner = crate::apis::urlencode(p_path_owner), - repo = crate::apis::urlencode(p_path_repo), - index = p_path_index - ); - let mut req_builder = configuration - .client - .request(reqwest::Method::DELETE, &uri_str); - - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("access_token", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("sudo", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("token", value)]); - } - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("X-FORGEJO-OTP", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Authorization", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Sudo", value); - }; - if let Some(ref auth_conf) = configuration.basic_auth { - req_builder = req_builder.basic_auth(auth_conf.0.to_owned(), auth_conf.1.to_owned()); - }; - req_builder = req_builder.json(&p_body_body); - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - - if !status.is_client_error() && !status.is_server_error() { - Ok(()) - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -pub async fn repo_delete_push_mirror( - configuration: &configuration::Configuration, - owner: &str, - repo: &str, - name: &str, -) -> Result<(), Error> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_owner = owner; - let p_path_repo = repo; - let p_path_name = name; - - let uri_str = format!( - "{}/repos/{owner}/{repo}/push_mirrors/{name}", - configuration.base_path, - owner = crate::apis::urlencode(p_path_owner), - repo = crate::apis::urlencode(p_path_repo), - name = crate::apis::urlencode(p_path_name) - ); - let mut req_builder = configuration - .client - .request(reqwest::Method::DELETE, &uri_str); - - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("access_token", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("sudo", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("token", value)]); - } - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("X-FORGEJO-OTP", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Authorization", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Sudo", value); - }; - if let Some(ref auth_conf) = configuration.basic_auth { - req_builder = req_builder.basic_auth(auth_conf.0.to_owned(), auth_conf.1.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - - if !status.is_client_error() && !status.is_server_error() { - Ok(()) - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -pub async fn repo_delete_release( - configuration: &configuration::Configuration, - owner: &str, - repo: &str, - id: i64, -) -> Result<(), Error> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_owner = owner; - let p_path_repo = repo; - let p_path_id = id; - - let uri_str = format!( - "{}/repos/{owner}/{repo}/releases/{id}", - configuration.base_path, - owner = crate::apis::urlencode(p_path_owner), - repo = crate::apis::urlencode(p_path_repo), - id = p_path_id - ); - let mut req_builder = configuration - .client - .request(reqwest::Method::DELETE, &uri_str); - - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("access_token", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("sudo", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("token", value)]); - } - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("X-FORGEJO-OTP", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Authorization", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Sudo", value); - }; - if let Some(ref auth_conf) = configuration.basic_auth { - req_builder = req_builder.basic_auth(auth_conf.0.to_owned(), auth_conf.1.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - - if !status.is_client_error() && !status.is_server_error() { - Ok(()) - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -pub async fn repo_delete_release_attachment( - configuration: &configuration::Configuration, - owner: &str, - repo: &str, - id: i64, - attachment_id: i64, -) -> Result<(), Error> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_owner = owner; - let p_path_repo = repo; - let p_path_id = id; - let p_path_attachment_id = attachment_id; - - let uri_str = format!( - "{}/repos/{owner}/{repo}/releases/{id}/assets/{attachment_id}", - configuration.base_path, - owner = crate::apis::urlencode(p_path_owner), - repo = crate::apis::urlencode(p_path_repo), - id = p_path_id, - attachment_id = p_path_attachment_id - ); - let mut req_builder = configuration - .client - .request(reqwest::Method::DELETE, &uri_str); - - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("access_token", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("sudo", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("token", value)]); - } - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("X-FORGEJO-OTP", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Authorization", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Sudo", value); - }; - if let Some(ref auth_conf) = configuration.basic_auth { - req_builder = req_builder.basic_auth(auth_conf.0.to_owned(), auth_conf.1.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - - if !status.is_client_error() && !status.is_server_error() { - Ok(()) - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -pub async fn repo_delete_release_by_tag( - configuration: &configuration::Configuration, - owner: &str, - repo: &str, - tag: &str, -) -> Result<(), Error> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_owner = owner; - let p_path_repo = repo; - let p_path_tag = tag; - - let uri_str = format!( - "{}/repos/{owner}/{repo}/releases/tags/{tag}", - configuration.base_path, - owner = crate::apis::urlencode(p_path_owner), - repo = crate::apis::urlencode(p_path_repo), - tag = crate::apis::urlencode(p_path_tag) - ); - let mut req_builder = configuration - .client - .request(reqwest::Method::DELETE, &uri_str); - - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("access_token", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("sudo", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("token", value)]); - } - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("X-FORGEJO-OTP", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Authorization", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Sudo", value); - }; - if let Some(ref auth_conf) = configuration.basic_auth { - req_builder = req_builder.basic_auth(auth_conf.0.to_owned(), auth_conf.1.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - - if !status.is_client_error() && !status.is_server_error() { - Ok(()) - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -pub async fn repo_delete_tag( - configuration: &configuration::Configuration, - owner: &str, - repo: &str, - tag: &str, -) -> Result<(), Error> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_owner = owner; - let p_path_repo = repo; - let p_path_tag = tag; - - let uri_str = format!( - "{}/repos/{owner}/{repo}/tags/{tag}", - configuration.base_path, - owner = crate::apis::urlencode(p_path_owner), - repo = crate::apis::urlencode(p_path_repo), - tag = crate::apis::urlencode(p_path_tag) - ); - let mut req_builder = configuration - .client - .request(reqwest::Method::DELETE, &uri_str); - - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("access_token", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("sudo", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("token", value)]); - } - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("X-FORGEJO-OTP", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Authorization", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Sudo", value); - }; - if let Some(ref auth_conf) = configuration.basic_auth { - req_builder = req_builder.basic_auth(auth_conf.0.to_owned(), auth_conf.1.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - - if !status.is_client_error() && !status.is_server_error() { - Ok(()) - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -pub async fn repo_delete_tag_protection( - configuration: &configuration::Configuration, - owner: &str, - repo: &str, - id: i64, -) -> Result<(), Error> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_owner = owner; - let p_path_repo = repo; - let p_path_id = id; - - let uri_str = format!( - "{}/repos/{owner}/{repo}/tag_protections/{id}", - configuration.base_path, - owner = crate::apis::urlencode(p_path_owner), - repo = crate::apis::urlencode(p_path_repo), - id = p_path_id - ); - let mut req_builder = configuration - .client - .request(reqwest::Method::DELETE, &uri_str); - - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("access_token", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("sudo", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("token", value)]); - } - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("X-FORGEJO-OTP", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Authorization", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Sudo", value); - }; - if let Some(ref auth_conf) = configuration.basic_auth { - req_builder = req_builder.basic_auth(auth_conf.0.to_owned(), auth_conf.1.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - - if !status.is_client_error() && !status.is_server_error() { - Ok(()) - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -pub async fn repo_delete_team( - configuration: &configuration::Configuration, - owner: &str, - repo: &str, - team: &str, -) -> Result<(), Error> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_owner = owner; - let p_path_repo = repo; - let p_path_team = team; - - let uri_str = format!( - "{}/repos/{owner}/{repo}/teams/{team}", - configuration.base_path, - owner = crate::apis::urlencode(p_path_owner), - repo = crate::apis::urlencode(p_path_repo), - team = crate::apis::urlencode(p_path_team) - ); - let mut req_builder = configuration - .client - .request(reqwest::Method::DELETE, &uri_str); - - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("access_token", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("sudo", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("token", value)]); - } - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("X-FORGEJO-OTP", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Authorization", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Sudo", value); - }; - if let Some(ref auth_conf) = configuration.basic_auth { - req_builder = req_builder.basic_auth(auth_conf.0.to_owned(), auth_conf.1.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - - if !status.is_client_error() && !status.is_server_error() { - Ok(()) - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -pub async fn repo_delete_topic( - configuration: &configuration::Configuration, - owner: &str, - repo: &str, - topic: &str, -) -> Result<(), Error> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_owner = owner; - let p_path_repo = repo; - let p_path_topic = topic; - - let uri_str = format!( - "{}/repos/{owner}/{repo}/topics/{topic}", - configuration.base_path, - owner = crate::apis::urlencode(p_path_owner), - repo = crate::apis::urlencode(p_path_repo), - topic = crate::apis::urlencode(p_path_topic) - ); - let mut req_builder = configuration - .client - .request(reqwest::Method::DELETE, &uri_str); - - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("access_token", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("sudo", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("token", value)]); - } - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("X-FORGEJO-OTP", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Authorization", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Sudo", value); - }; - if let Some(ref auth_conf) = configuration.basic_auth { - req_builder = req_builder.basic_auth(auth_conf.0.to_owned(), auth_conf.1.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - - if !status.is_client_error() && !status.is_server_error() { - Ok(()) - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -pub async fn repo_delete_wiki_page( - configuration: &configuration::Configuration, - owner: &str, - repo: &str, - page_name: &str, -) -> Result<(), Error> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_owner = owner; - let p_path_repo = repo; - let p_path_page_name = page_name; - - let uri_str = format!( - "{}/repos/{owner}/{repo}/wiki/page/{pageName}", - configuration.base_path, - owner = crate::apis::urlencode(p_path_owner), - repo = crate::apis::urlencode(p_path_repo), - pageName = crate::apis::urlencode(p_path_page_name) - ); - let mut req_builder = configuration - .client - .request(reqwest::Method::DELETE, &uri_str); - - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("access_token", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("sudo", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("token", value)]); - } - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("X-FORGEJO-OTP", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Authorization", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Sudo", value); - }; - if let Some(ref auth_conf) = configuration.basic_auth { - req_builder = req_builder.basic_auth(auth_conf.0.to_owned(), auth_conf.1.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - - if !status.is_client_error() && !status.is_server_error() { - Ok(()) - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -pub async fn repo_dismiss_pull_review( - configuration: &configuration::Configuration, - owner: &str, - repo: &str, - index: i64, - id: i64, - body: models::DismissPullReviewOptions, -) -> Result> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_owner = owner; - let p_path_repo = repo; - let p_path_index = index; - let p_path_id = id; - let p_body_body = body; - - let uri_str = format!( - "{}/repos/{owner}/{repo}/pulls/{index}/reviews/{id}/dismissals", - configuration.base_path, - owner = crate::apis::urlencode(p_path_owner), - repo = crate::apis::urlencode(p_path_repo), - index = p_path_index, - id = p_path_id - ); - let mut req_builder = configuration - .client - .request(reqwest::Method::POST, &uri_str); - - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("access_token", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("sudo", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("token", value)]); - } - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("X-FORGEJO-OTP", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Authorization", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Sudo", value); - }; - if let Some(ref auth_conf) = configuration.basic_auth { - req_builder = req_builder.basic_auth(auth_conf.0.to_owned(), auth_conf.1.to_owned()); - }; - req_builder = req_builder.json(&p_body_body); - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::PullReview`"))), - ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::PullReview`")))), - } - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -pub async fn repo_download_commit_diff_or_patch( - configuration: &configuration::Configuration, - owner: &str, - repo: &str, - sha: &str, - diff_type: &str, -) -> Result> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_owner = owner; - let p_path_repo = repo; - let p_path_sha = sha; - let p_path_diff_type = diff_type; - - let uri_str = format!( - "{}/repos/{owner}/{repo}/git/commits/{sha}.{diffType}", - configuration.base_path, - owner = crate::apis::urlencode(p_path_owner), - repo = crate::apis::urlencode(p_path_repo), - sha = crate::apis::urlencode(p_path_sha), - diffType = crate::apis::urlencode(p_path_diff_type) - ); - let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); - - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("access_token", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("sudo", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("token", value)]); - } - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("X-FORGEJO-OTP", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Authorization", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Sudo", value); - }; - if let Some(ref auth_conf) = configuration.basic_auth { - req_builder = req_builder.basic_auth(auth_conf.0.to_owned(), auth_conf.1.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => return Ok(content), - ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `String`")))), - } - } else { - let content = resp.text().await?; - let entity: Option = - serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -pub async fn repo_download_pull_diff_or_patch( - configuration: &configuration::Configuration, - owner: &str, - repo: &str, - index: i64, - diff_type: &str, - binary: Option, -) -> Result> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_owner = owner; - let p_path_repo = repo; - let p_path_index = index; - let p_path_diff_type = diff_type; - let p_query_binary = binary; - - let uri_str = format!( - "{}/repos/{owner}/{repo}/pulls/{index}.{diffType}", - configuration.base_path, - owner = crate::apis::urlencode(p_path_owner), - repo = crate::apis::urlencode(p_path_repo), - index = p_path_index, - diffType = crate::apis::urlencode(p_path_diff_type) - ); - let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); - - if let Some(ref param_value) = p_query_binary { - req_builder = req_builder.query(&[("binary", ¶m_value.to_string())]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("access_token", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("sudo", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("token", value)]); - } - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("X-FORGEJO-OTP", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Authorization", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Sudo", value); - }; - if let Some(ref auth_conf) = configuration.basic_auth { - req_builder = req_builder.basic_auth(auth_conf.0.to_owned(), auth_conf.1.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => return Ok(content), - ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `String`")))), - } - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -pub async fn repo_edit( - configuration: &configuration::Configuration, - owner: &str, - repo: &str, - body: Option, -) -> Result> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_owner = owner; - let p_path_repo = repo; - let p_body_body = body; - - let uri_str = format!( - "{}/repos/{owner}/{repo}", - configuration.base_path, - owner = crate::apis::urlencode(p_path_owner), - repo = crate::apis::urlencode(p_path_repo) - ); - let mut req_builder = configuration - .client - .request(reqwest::Method::PATCH, &uri_str); - - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("access_token", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("sudo", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("token", value)]); - } - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("X-FORGEJO-OTP", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Authorization", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Sudo", value); - }; - if let Some(ref auth_conf) = configuration.basic_auth { - req_builder = req_builder.basic_auth(auth_conf.0.to_owned(), auth_conf.1.to_owned()); - }; - req_builder = req_builder.json(&p_body_body); - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::Repository`"))), - ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::Repository`")))), - } - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -pub async fn repo_edit_branch_protection( - configuration: &configuration::Configuration, - owner: &str, - repo: &str, - name: &str, - body: Option, -) -> Result> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_owner = owner; - let p_path_repo = repo; - let p_path_name = name; - let p_body_body = body; - - let uri_str = format!( - "{}/repos/{owner}/{repo}/branch_protections/{name}", - configuration.base_path, - owner = crate::apis::urlencode(p_path_owner), - repo = crate::apis::urlencode(p_path_repo), - name = crate::apis::urlencode(p_path_name) - ); - let mut req_builder = configuration - .client - .request(reqwest::Method::PATCH, &uri_str); - - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("access_token", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("sudo", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("token", value)]); - } - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("X-FORGEJO-OTP", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Authorization", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Sudo", value); - }; - if let Some(ref auth_conf) = configuration.basic_auth { - req_builder = req_builder.basic_auth(auth_conf.0.to_owned(), auth_conf.1.to_owned()); - }; - req_builder = req_builder.json(&p_body_body); - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::BranchProtection`"))), - ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::BranchProtection`")))), - } - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -pub async fn repo_edit_git_hook( - configuration: &configuration::Configuration, - owner: &str, - repo: &str, - id: &str, - body: Option, -) -> Result> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_owner = owner; - let p_path_repo = repo; - let p_path_id = id; - let p_body_body = body; - - let uri_str = format!( - "{}/repos/{owner}/{repo}/hooks/git/{id}", - configuration.base_path, - owner = crate::apis::urlencode(p_path_owner), - repo = crate::apis::urlencode(p_path_repo), - id = crate::apis::urlencode(p_path_id) - ); - let mut req_builder = configuration - .client - .request(reqwest::Method::PATCH, &uri_str); - - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("access_token", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("sudo", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("token", value)]); - } - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("X-FORGEJO-OTP", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Authorization", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Sudo", value); - }; - if let Some(ref auth_conf) = configuration.basic_auth { - req_builder = req_builder.basic_auth(auth_conf.0.to_owned(), auth_conf.1.to_owned()); - }; - req_builder = req_builder.json(&p_body_body); - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::GitHook`"))), - ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::GitHook`")))), - } - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -pub async fn repo_edit_hook( - configuration: &configuration::Configuration, - owner: &str, - repo: &str, - id: i64, - body: Option, -) -> Result> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_owner = owner; - let p_path_repo = repo; - let p_path_id = id; - let p_body_body = body; - - let uri_str = format!( - "{}/repos/{owner}/{repo}/hooks/{id}", - configuration.base_path, - owner = crate::apis::urlencode(p_path_owner), - repo = crate::apis::urlencode(p_path_repo), - id = p_path_id - ); - let mut req_builder = configuration - .client - .request(reqwest::Method::PATCH, &uri_str); - - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("access_token", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("sudo", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("token", value)]); - } - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("X-FORGEJO-OTP", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Authorization", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Sudo", value); - }; - if let Some(ref auth_conf) = configuration.basic_auth { - req_builder = req_builder.basic_auth(auth_conf.0.to_owned(), auth_conf.1.to_owned()); - }; - req_builder = req_builder.json(&p_body_body); - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::Hook`"))), - ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::Hook`")))), - } - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -pub async fn repo_edit_pull_request( - configuration: &configuration::Configuration, - owner: &str, - repo: &str, - index: i64, - body: Option, -) -> Result> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_owner = owner; - let p_path_repo = repo; - let p_path_index = index; - let p_body_body = body; - - let uri_str = format!( - "{}/repos/{owner}/{repo}/pulls/{index}", - configuration.base_path, - owner = crate::apis::urlencode(p_path_owner), - repo = crate::apis::urlencode(p_path_repo), - index = p_path_index - ); - let mut req_builder = configuration - .client - .request(reqwest::Method::PATCH, &uri_str); - - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("access_token", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("sudo", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("token", value)]); - } - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("X-FORGEJO-OTP", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Authorization", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Sudo", value); - }; - if let Some(ref auth_conf) = configuration.basic_auth { - req_builder = req_builder.basic_auth(auth_conf.0.to_owned(), auth_conf.1.to_owned()); - }; - req_builder = req_builder.json(&p_body_body); - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::PullRequest`"))), - ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::PullRequest`")))), - } - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -pub async fn repo_edit_release( - configuration: &configuration::Configuration, - owner: &str, - repo: &str, - id: i64, - body: Option, -) -> Result> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_owner = owner; - let p_path_repo = repo; - let p_path_id = id; - let p_body_body = body; - - let uri_str = format!( - "{}/repos/{owner}/{repo}/releases/{id}", - configuration.base_path, - owner = crate::apis::urlencode(p_path_owner), - repo = crate::apis::urlencode(p_path_repo), - id = p_path_id - ); - let mut req_builder = configuration - .client - .request(reqwest::Method::PATCH, &uri_str); - - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("access_token", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("sudo", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("token", value)]); - } - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("X-FORGEJO-OTP", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Authorization", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Sudo", value); - }; - if let Some(ref auth_conf) = configuration.basic_auth { - req_builder = req_builder.basic_auth(auth_conf.0.to_owned(), auth_conf.1.to_owned()); - }; - req_builder = req_builder.json(&p_body_body); - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::Release`"))), - ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::Release`")))), - } - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -pub async fn repo_edit_release_attachment( - configuration: &configuration::Configuration, - owner: &str, - repo: &str, - id: i64, - attachment_id: i64, - body: Option, -) -> Result> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_owner = owner; - let p_path_repo = repo; - let p_path_id = id; - let p_path_attachment_id = attachment_id; - let p_body_body = body; - - let uri_str = format!( - "{}/repos/{owner}/{repo}/releases/{id}/assets/{attachment_id}", - configuration.base_path, - owner = crate::apis::urlencode(p_path_owner), - repo = crate::apis::urlencode(p_path_repo), - id = p_path_id, - attachment_id = p_path_attachment_id - ); - let mut req_builder = configuration - .client - .request(reqwest::Method::PATCH, &uri_str); - - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("access_token", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("sudo", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("token", value)]); - } - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("X-FORGEJO-OTP", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Authorization", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Sudo", value); - }; - if let Some(ref auth_conf) = configuration.basic_auth { - req_builder = req_builder.basic_auth(auth_conf.0.to_owned(), auth_conf.1.to_owned()); - }; - req_builder = req_builder.json(&p_body_body); - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::Attachment`"))), - ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::Attachment`")))), - } - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -pub async fn repo_edit_tag_protection( - configuration: &configuration::Configuration, - owner: &str, - repo: &str, - id: i64, - body: Option, -) -> Result> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_owner = owner; - let p_path_repo = repo; - let p_path_id = id; - let p_body_body = body; - - let uri_str = format!( - "{}/repos/{owner}/{repo}/tag_protections/{id}", - configuration.base_path, - owner = crate::apis::urlencode(p_path_owner), - repo = crate::apis::urlencode(p_path_repo), - id = p_path_id - ); - let mut req_builder = configuration - .client - .request(reqwest::Method::PATCH, &uri_str); - - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("access_token", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("sudo", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("token", value)]); - } - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("X-FORGEJO-OTP", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Authorization", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Sudo", value); - }; - if let Some(ref auth_conf) = configuration.basic_auth { - req_builder = req_builder.basic_auth(auth_conf.0.to_owned(), auth_conf.1.to_owned()); - }; - req_builder = req_builder.json(&p_body_body); - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::TagProtection`"))), - ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::TagProtection`")))), - } - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -pub async fn repo_edit_wiki_page( - configuration: &configuration::Configuration, - owner: &str, - repo: &str, - page_name: &str, - body: Option, -) -> Result> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_owner = owner; - let p_path_repo = repo; - let p_path_page_name = page_name; - let p_body_body = body; - - let uri_str = format!( - "{}/repos/{owner}/{repo}/wiki/page/{pageName}", - configuration.base_path, - owner = crate::apis::urlencode(p_path_owner), - repo = crate::apis::urlencode(p_path_repo), - pageName = crate::apis::urlencode(p_path_page_name) - ); - let mut req_builder = configuration - .client - .request(reqwest::Method::PATCH, &uri_str); - - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("access_token", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("sudo", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("token", value)]); - } - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("X-FORGEJO-OTP", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Authorization", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Sudo", value); - }; - if let Some(ref auth_conf) = configuration.basic_auth { - req_builder = req_builder.basic_auth(auth_conf.0.to_owned(), auth_conf.1.to_owned()); - }; - req_builder = req_builder.json(&p_body_body); - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::WikiPage`"))), - ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::WikiPage`")))), - } - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -pub async fn repo_get( - configuration: &configuration::Configuration, - owner: &str, - repo: &str, -) -> Result> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_owner = owner; - let p_path_repo = repo; - - let uri_str = format!( - "{}/repos/{owner}/{repo}", - configuration.base_path, - owner = crate::apis::urlencode(p_path_owner), - repo = crate::apis::urlencode(p_path_repo) - ); - let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); - - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("access_token", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("sudo", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("token", value)]); - } - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("X-FORGEJO-OTP", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Authorization", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Sudo", value); - }; - if let Some(ref auth_conf) = configuration.basic_auth { - req_builder = req_builder.basic_auth(auth_conf.0.to_owned(), auth_conf.1.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::Repository`"))), - ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::Repository`")))), - } - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -pub async fn repo_get_all_commits( - configuration: &configuration::Configuration, - owner: &str, - repo: &str, - sha: Option<&str>, - path: Option<&str>, - stat: Option, - verification: Option, - files: Option, - page: Option, - limit: Option, - not: Option<&str>, -) -> Result, Error> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_owner = owner; - let p_path_repo = repo; - let p_query_sha = sha; - let p_query_path = path; - let p_query_stat = stat; - let p_query_verification = verification; - let p_query_files = files; - let p_query_page = page; - let p_query_limit = limit; - let p_query_not = not; - - let uri_str = format!( - "{}/repos/{owner}/{repo}/commits", - configuration.base_path, - owner = crate::apis::urlencode(p_path_owner), - repo = crate::apis::urlencode(p_path_repo) - ); - let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); - - if let Some(ref param_value) = p_query_sha { - req_builder = req_builder.query(&[("sha", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_path { - req_builder = req_builder.query(&[("path", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_stat { - req_builder = req_builder.query(&[("stat", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_verification { - req_builder = req_builder.query(&[("verification", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_files { - req_builder = req_builder.query(&[("files", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_page { - req_builder = req_builder.query(&[("page", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_limit { - req_builder = req_builder.query(&[("limit", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_not { - req_builder = req_builder.query(&[("not", ¶m_value.to_string())]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("access_token", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("sudo", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("token", value)]); - } - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("X-FORGEJO-OTP", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Authorization", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Sudo", value); - }; - if let Some(ref auth_conf) = configuration.basic_auth { - req_builder = req_builder.basic_auth(auth_conf.0.to_owned(), auth_conf.1.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `Vec<models::Commit>`"))), - ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `Vec<models::Commit>`")))), - } - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -pub async fn repo_get_archive( - configuration: &configuration::Configuration, - owner: &str, - repo: &str, - archive: &str, -) -> Result<(), Error> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_owner = owner; - let p_path_repo = repo; - let p_path_archive = archive; - - let uri_str = format!( - "{}/repos/{owner}/{repo}/archive/{archive}", - configuration.base_path, - owner = crate::apis::urlencode(p_path_owner), - repo = crate::apis::urlencode(p_path_repo), - archive = crate::apis::urlencode(p_path_archive) - ); - let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); - - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("access_token", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("sudo", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("token", value)]); - } - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("X-FORGEJO-OTP", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Authorization", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Sudo", value); - }; - if let Some(ref auth_conf) = configuration.basic_auth { - req_builder = req_builder.basic_auth(auth_conf.0.to_owned(), auth_conf.1.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - - if !status.is_client_error() && !status.is_server_error() { - Ok(()) - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -pub async fn repo_get_assignees( - configuration: &configuration::Configuration, - owner: &str, - repo: &str, -) -> Result, Error> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_owner = owner; - let p_path_repo = repo; - - let uri_str = format!( - "{}/repos/{owner}/{repo}/assignees", - configuration.base_path, - owner = crate::apis::urlencode(p_path_owner), - repo = crate::apis::urlencode(p_path_repo) - ); - let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); - - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("access_token", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("sudo", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("token", value)]); - } - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("X-FORGEJO-OTP", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Authorization", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Sudo", value); - }; - if let Some(ref auth_conf) = configuration.basic_auth { - req_builder = req_builder.basic_auth(auth_conf.0.to_owned(), auth_conf.1.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `Vec<models::User>`"))), - ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `Vec<models::User>`")))), - } - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -pub async fn repo_get_branch( - configuration: &configuration::Configuration, - owner: &str, - repo: &str, - branch: &str, -) -> Result> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_owner = owner; - let p_path_repo = repo; - let p_path_branch = branch; - - let uri_str = format!( - "{}/repos/{owner}/{repo}/branches/{branch}", - configuration.base_path, - owner = crate::apis::urlencode(p_path_owner), - repo = crate::apis::urlencode(p_path_repo), - branch = crate::apis::urlencode(p_path_branch) - ); - let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); - - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("access_token", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("sudo", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("token", value)]); - } - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("X-FORGEJO-OTP", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Authorization", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Sudo", value); - }; - if let Some(ref auth_conf) = configuration.basic_auth { - req_builder = req_builder.basic_auth(auth_conf.0.to_owned(), auth_conf.1.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::Branch`"))), - ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::Branch`")))), - } - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -pub async fn repo_get_branch_protection( - configuration: &configuration::Configuration, - owner: &str, - repo: &str, - name: &str, -) -> Result> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_owner = owner; - let p_path_repo = repo; - let p_path_name = name; - - let uri_str = format!( - "{}/repos/{owner}/{repo}/branch_protections/{name}", - configuration.base_path, - owner = crate::apis::urlencode(p_path_owner), - repo = crate::apis::urlencode(p_path_repo), - name = crate::apis::urlencode(p_path_name) - ); - let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); - - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("access_token", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("sudo", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("token", value)]); - } - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("X-FORGEJO-OTP", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Authorization", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Sudo", value); - }; - if let Some(ref auth_conf) = configuration.basic_auth { - req_builder = req_builder.basic_auth(auth_conf.0.to_owned(), auth_conf.1.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::BranchProtection`"))), - ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::BranchProtection`")))), - } - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -pub async fn repo_get_by_id( - configuration: &configuration::Configuration, - id: i64, -) -> Result> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_id = id; - - let uri_str = format!( - "{}/repositories/{id}", - configuration.base_path, - id = p_path_id - ); - let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); - - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("access_token", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("sudo", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("token", value)]); - } - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("X-FORGEJO-OTP", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Authorization", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Sudo", value); - }; - if let Some(ref auth_conf) = configuration.basic_auth { - req_builder = req_builder.basic_auth(auth_conf.0.to_owned(), auth_conf.1.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::Repository`"))), - ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::Repository`")))), - } - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -pub async fn repo_get_combined_status_by_ref( - configuration: &configuration::Configuration, - owner: &str, - repo: &str, - r#ref: &str, - page: Option, - limit: Option, -) -> Result> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_owner = owner; - let p_path_repo = repo; - let p_path_ref = r#ref; - let p_query_page = page; - let p_query_limit = limit; - - let uri_str = format!("{}/repos/{owner}/{repo}/commits/{ref}/status", configuration.base_path, owner=crate::apis::urlencode(p_path_owner), repo=crate::apis::urlencode(p_path_repo), ref=crate::apis::urlencode(p_path_ref)); - let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); - - if let Some(ref param_value) = p_query_page { - req_builder = req_builder.query(&[("page", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_limit { - req_builder = req_builder.query(&[("limit", ¶m_value.to_string())]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("access_token", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("sudo", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("token", value)]); - } - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("X-FORGEJO-OTP", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Authorization", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Sudo", value); - }; - if let Some(ref auth_conf) = configuration.basic_auth { - req_builder = req_builder.basic_auth(auth_conf.0.to_owned(), auth_conf.1.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::CombinedStatus`"))), - ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::CombinedStatus`")))), - } - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -pub async fn repo_get_commit_pull_request( - configuration: &configuration::Configuration, - owner: &str, - repo: &str, - sha: &str, -) -> Result> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_owner = owner; - let p_path_repo = repo; - let p_path_sha = sha; - - let uri_str = format!( - "{}/repos/{owner}/{repo}/commits/{sha}/pull", - configuration.base_path, - owner = crate::apis::urlencode(p_path_owner), - repo = crate::apis::urlencode(p_path_repo), - sha = crate::apis::urlencode(p_path_sha) - ); - let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); - - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("access_token", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("sudo", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("token", value)]); - } - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("X-FORGEJO-OTP", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Authorization", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Sudo", value); - }; - if let Some(ref auth_conf) = configuration.basic_auth { - req_builder = req_builder.basic_auth(auth_conf.0.to_owned(), auth_conf.1.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::PullRequest`"))), - ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::PullRequest`")))), - } - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -pub async fn repo_get_contents( - configuration: &configuration::Configuration, - owner: &str, - repo: &str, - filepath: &str, - r#ref: Option<&str>, -) -> Result> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_owner = owner; - let p_path_repo = repo; - let p_path_filepath = filepath; - let p_query_ref = r#ref; - - let uri_str = format!( - "{}/repos/{owner}/{repo}/contents/{filepath}", - configuration.base_path, - owner = crate::apis::urlencode(p_path_owner), - repo = crate::apis::urlencode(p_path_repo), - filepath = crate::apis::urlencode(p_path_filepath) - ); - let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); - - if let Some(ref param_value) = p_query_ref { - req_builder = req_builder.query(&[("ref", ¶m_value.to_string())]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("access_token", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("sudo", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("token", value)]); - } - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("X-FORGEJO-OTP", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Authorization", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Sudo", value); - }; - if let Some(ref auth_conf) = configuration.basic_auth { - req_builder = req_builder.basic_auth(auth_conf.0.to_owned(), auth_conf.1.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::ContentsResponse`"))), - ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::ContentsResponse`")))), - } - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -pub async fn repo_get_contents_list( - configuration: &configuration::Configuration, - owner: &str, - repo: &str, - r#ref: Option<&str>, -) -> Result, Error> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_owner = owner; - let p_path_repo = repo; - let p_query_ref = r#ref; - - let uri_str = format!( - "{}/repos/{owner}/{repo}/contents", - configuration.base_path, - owner = crate::apis::urlencode(p_path_owner), - repo = crate::apis::urlencode(p_path_repo) - ); - let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); - - if let Some(ref param_value) = p_query_ref { - req_builder = req_builder.query(&[("ref", ¶m_value.to_string())]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("access_token", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("sudo", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("token", value)]); - } - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("X-FORGEJO-OTP", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Authorization", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Sudo", value); - }; - if let Some(ref auth_conf) = configuration.basic_auth { - req_builder = req_builder.basic_auth(auth_conf.0.to_owned(), auth_conf.1.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `Vec<models::ContentsResponse>`"))), - ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `Vec<models::ContentsResponse>`")))), - } - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -pub async fn repo_get_editor_config( - configuration: &configuration::Configuration, - owner: &str, - repo: &str, - filepath: &str, - r#ref: Option<&str>, -) -> Result, Error> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_owner = owner; - let p_path_repo = repo; - let p_path_filepath = filepath; - let p_query_ref = r#ref; - - let uri_str = format!( - "{}/repos/{owner}/{repo}/editorconfig/{filepath}", - configuration.base_path, - owner = crate::apis::urlencode(p_path_owner), - repo = crate::apis::urlencode(p_path_repo), - filepath = crate::apis::urlencode(p_path_filepath) - ); - let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); - - if let Some(ref param_value) = p_query_ref { - req_builder = req_builder.query(&[("ref", ¶m_value.to_string())]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("access_token", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("sudo", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("token", value)]); - } - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("X-FORGEJO-OTP", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Authorization", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Sudo", value); - }; - if let Some(ref auth_conf) = configuration.basic_auth { - req_builder = req_builder.basic_auth(auth_conf.0.to_owned(), auth_conf.1.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `std::collections::HashMap<String, String>`"))), - ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `std::collections::HashMap<String, String>`")))), - } - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -pub async fn repo_get_git_hook( - configuration: &configuration::Configuration, - owner: &str, - repo: &str, - id: &str, -) -> Result> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_owner = owner; - let p_path_repo = repo; - let p_path_id = id; - - let uri_str = format!( - "{}/repos/{owner}/{repo}/hooks/git/{id}", - configuration.base_path, - owner = crate::apis::urlencode(p_path_owner), - repo = crate::apis::urlencode(p_path_repo), - id = crate::apis::urlencode(p_path_id) - ); - let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); - - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("access_token", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("sudo", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("token", value)]); - } - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("X-FORGEJO-OTP", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Authorization", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Sudo", value); - }; - if let Some(ref auth_conf) = configuration.basic_auth { - req_builder = req_builder.basic_auth(auth_conf.0.to_owned(), auth_conf.1.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::GitHook`"))), - ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::GitHook`")))), - } - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -pub async fn repo_get_hook( - configuration: &configuration::Configuration, - owner: &str, - repo: &str, - id: i64, -) -> Result> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_owner = owner; - let p_path_repo = repo; - let p_path_id = id; - - let uri_str = format!( - "{}/repos/{owner}/{repo}/hooks/{id}", - configuration.base_path, - owner = crate::apis::urlencode(p_path_owner), - repo = crate::apis::urlencode(p_path_repo), - id = p_path_id - ); - let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); - - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("access_token", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("sudo", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("token", value)]); - } - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("X-FORGEJO-OTP", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Authorization", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Sudo", value); - }; - if let Some(ref auth_conf) = configuration.basic_auth { - req_builder = req_builder.basic_auth(auth_conf.0.to_owned(), auth_conf.1.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::Hook`"))), - ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::Hook`")))), - } - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -pub async fn repo_get_issue_config( - configuration: &configuration::Configuration, - owner: &str, - repo: &str, -) -> Result> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_owner = owner; - let p_path_repo = repo; - - let uri_str = format!( - "{}/repos/{owner}/{repo}/issue_config", - configuration.base_path, - owner = crate::apis::urlencode(p_path_owner), - repo = crate::apis::urlencode(p_path_repo) - ); - let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); - - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("access_token", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("sudo", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("token", value)]); - } - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("X-FORGEJO-OTP", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Authorization", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Sudo", value); - }; - if let Some(ref auth_conf) = configuration.basic_auth { - req_builder = req_builder.basic_auth(auth_conf.0.to_owned(), auth_conf.1.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::IssueConfig`"))), - ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::IssueConfig`")))), - } - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -pub async fn repo_get_issue_templates( - configuration: &configuration::Configuration, - owner: &str, - repo: &str, -) -> Result, Error> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_owner = owner; - let p_path_repo = repo; - - let uri_str = format!( - "{}/repos/{owner}/{repo}/issue_templates", - configuration.base_path, - owner = crate::apis::urlencode(p_path_owner), - repo = crate::apis::urlencode(p_path_repo) - ); - let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); - - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("access_token", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("sudo", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("token", value)]); - } - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("X-FORGEJO-OTP", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Authorization", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Sudo", value); - }; - if let Some(ref auth_conf) = configuration.basic_auth { - req_builder = req_builder.basic_auth(auth_conf.0.to_owned(), auth_conf.1.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `Vec<models::IssueTemplate>`"))), - ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `Vec<models::IssueTemplate>`")))), - } - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -pub async fn repo_get_key( - configuration: &configuration::Configuration, - owner: &str, - repo: &str, - id: i64, -) -> Result> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_owner = owner; - let p_path_repo = repo; - let p_path_id = id; - - let uri_str = format!( - "{}/repos/{owner}/{repo}/keys/{id}", - configuration.base_path, - owner = crate::apis::urlencode(p_path_owner), - repo = crate::apis::urlencode(p_path_repo), - id = p_path_id - ); - let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); - - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("access_token", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("sudo", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("token", value)]); - } - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("X-FORGEJO-OTP", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Authorization", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Sudo", value); - }; - if let Some(ref auth_conf) = configuration.basic_auth { - req_builder = req_builder.basic_auth(auth_conf.0.to_owned(), auth_conf.1.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::DeployKey`"))), - ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::DeployKey`")))), - } - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -pub async fn repo_get_languages( - configuration: &configuration::Configuration, - owner: &str, - repo: &str, -) -> Result, Error> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_owner = owner; - let p_path_repo = repo; - - let uri_str = format!( - "{}/repos/{owner}/{repo}/languages", - configuration.base_path, - owner = crate::apis::urlencode(p_path_owner), - repo = crate::apis::urlencode(p_path_repo) - ); - let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); - - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("access_token", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("sudo", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("token", value)]); - } - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("X-FORGEJO-OTP", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Authorization", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Sudo", value); - }; - if let Some(ref auth_conf) = configuration.basic_auth { - req_builder = req_builder.basic_auth(auth_conf.0.to_owned(), auth_conf.1.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `std::collections::HashMap<String, i64>`"))), - ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `std::collections::HashMap<String, i64>`")))), - } - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -pub async fn repo_get_latest_release( - configuration: &configuration::Configuration, - owner: &str, - repo: &str, -) -> Result> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_owner = owner; - let p_path_repo = repo; - - let uri_str = format!( - "{}/repos/{owner}/{repo}/releases/latest", - configuration.base_path, - owner = crate::apis::urlencode(p_path_owner), - repo = crate::apis::urlencode(p_path_repo) - ); - let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); - - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("access_token", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("sudo", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("token", value)]); - } - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("X-FORGEJO-OTP", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Authorization", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Sudo", value); - }; - if let Some(ref auth_conf) = configuration.basic_auth { - req_builder = req_builder.basic_auth(auth_conf.0.to_owned(), auth_conf.1.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::Release`"))), - ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::Release`")))), - } - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -pub async fn repo_get_note( - configuration: &configuration::Configuration, - owner: &str, - repo: &str, - sha: &str, - verification: Option, - files: Option, -) -> Result> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_owner = owner; - let p_path_repo = repo; - let p_path_sha = sha; - let p_query_verification = verification; - let p_query_files = files; - - let uri_str = format!( - "{}/repos/{owner}/{repo}/git/notes/{sha}", - configuration.base_path, - owner = crate::apis::urlencode(p_path_owner), - repo = crate::apis::urlencode(p_path_repo), - sha = crate::apis::urlencode(p_path_sha) - ); - let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); - - if let Some(ref param_value) = p_query_verification { - req_builder = req_builder.query(&[("verification", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_files { - req_builder = req_builder.query(&[("files", ¶m_value.to_string())]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("access_token", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("sudo", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("token", value)]); - } - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("X-FORGEJO-OTP", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Authorization", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Sudo", value); - }; - if let Some(ref auth_conf) = configuration.basic_auth { - req_builder = req_builder.basic_auth(auth_conf.0.to_owned(), auth_conf.1.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::Note`"))), - ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::Note`")))), - } - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -pub async fn repo_get_pull_request( - configuration: &configuration::Configuration, - owner: &str, - repo: &str, - index: i64, -) -> Result> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_owner = owner; - let p_path_repo = repo; - let p_path_index = index; - - let uri_str = format!( - "{}/repos/{owner}/{repo}/pulls/{index}", - configuration.base_path, - owner = crate::apis::urlencode(p_path_owner), - repo = crate::apis::urlencode(p_path_repo), - index = p_path_index - ); - let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); - - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("access_token", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("sudo", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("token", value)]); - } - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("X-FORGEJO-OTP", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Authorization", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Sudo", value); - }; - if let Some(ref auth_conf) = configuration.basic_auth { - req_builder = req_builder.basic_auth(auth_conf.0.to_owned(), auth_conf.1.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::PullRequest`"))), - ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::PullRequest`")))), - } - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -pub async fn repo_get_pull_request_by_base_head( - configuration: &configuration::Configuration, - owner: &str, - repo: &str, - base: &str, - head: &str, -) -> Result> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_owner = owner; - let p_path_repo = repo; - let p_path_base = base; - let p_path_head = head; - - let uri_str = format!( - "{}/repos/{owner}/{repo}/pulls/{base}/{head}", - configuration.base_path, - owner = crate::apis::urlencode(p_path_owner), - repo = crate::apis::urlencode(p_path_repo), - base = crate::apis::urlencode(p_path_base), - head = crate::apis::urlencode(p_path_head) - ); - let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); - - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("access_token", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("sudo", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("token", value)]); - } - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("X-FORGEJO-OTP", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Authorization", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Sudo", value); - }; - if let Some(ref auth_conf) = configuration.basic_auth { - req_builder = req_builder.basic_auth(auth_conf.0.to_owned(), auth_conf.1.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::PullRequest`"))), - ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::PullRequest`")))), - } - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -pub async fn repo_get_pull_request_commits( - configuration: &configuration::Configuration, - owner: &str, - repo: &str, - index: i64, - page: Option, - limit: Option, - verification: Option, - files: Option, -) -> Result, Error> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_owner = owner; - let p_path_repo = repo; - let p_path_index = index; - let p_query_page = page; - let p_query_limit = limit; - let p_query_verification = verification; - let p_query_files = files; - - let uri_str = format!( - "{}/repos/{owner}/{repo}/pulls/{index}/commits", - configuration.base_path, - owner = crate::apis::urlencode(p_path_owner), - repo = crate::apis::urlencode(p_path_repo), - index = p_path_index - ); - let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); - - if let Some(ref param_value) = p_query_page { - req_builder = req_builder.query(&[("page", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_limit { - req_builder = req_builder.query(&[("limit", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_verification { - req_builder = req_builder.query(&[("verification", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_files { - req_builder = req_builder.query(&[("files", ¶m_value.to_string())]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("access_token", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("sudo", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("token", value)]); - } - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("X-FORGEJO-OTP", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Authorization", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Sudo", value); - }; - if let Some(ref auth_conf) = configuration.basic_auth { - req_builder = req_builder.basic_auth(auth_conf.0.to_owned(), auth_conf.1.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `Vec<models::Commit>`"))), - ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `Vec<models::Commit>`")))), - } - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -pub async fn repo_get_pull_request_files( - configuration: &configuration::Configuration, - owner: &str, - repo: &str, - index: i64, - skip_to: Option<&str>, - whitespace: Option<&str>, - page: Option, - limit: Option, -) -> Result, Error> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_owner = owner; - let p_path_repo = repo; - let p_path_index = index; - let p_query_skip_to = skip_to; - let p_query_whitespace = whitespace; - let p_query_page = page; - let p_query_limit = limit; - - let uri_str = format!( - "{}/repos/{owner}/{repo}/pulls/{index}/files", - configuration.base_path, - owner = crate::apis::urlencode(p_path_owner), - repo = crate::apis::urlencode(p_path_repo), - index = p_path_index - ); - let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); - - if let Some(ref param_value) = p_query_skip_to { - req_builder = req_builder.query(&[("skip-to", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_whitespace { - req_builder = req_builder.query(&[("whitespace", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_page { - req_builder = req_builder.query(&[("page", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_limit { - req_builder = req_builder.query(&[("limit", ¶m_value.to_string())]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("access_token", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("sudo", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("token", value)]); - } - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("X-FORGEJO-OTP", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Authorization", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Sudo", value); - }; - if let Some(ref auth_conf) = configuration.basic_auth { - req_builder = req_builder.basic_auth(auth_conf.0.to_owned(), auth_conf.1.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `Vec<models::ChangedFile>`"))), - ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `Vec<models::ChangedFile>`")))), - } - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -pub async fn repo_get_pull_review( - configuration: &configuration::Configuration, - owner: &str, - repo: &str, - index: i64, - id: i64, -) -> Result> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_owner = owner; - let p_path_repo = repo; - let p_path_index = index; - let p_path_id = id; - - let uri_str = format!( - "{}/repos/{owner}/{repo}/pulls/{index}/reviews/{id}", - configuration.base_path, - owner = crate::apis::urlencode(p_path_owner), - repo = crate::apis::urlencode(p_path_repo), - index = p_path_index, - id = p_path_id - ); - let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); - - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("access_token", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("sudo", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("token", value)]); - } - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("X-FORGEJO-OTP", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Authorization", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Sudo", value); - }; - if let Some(ref auth_conf) = configuration.basic_auth { - req_builder = req_builder.basic_auth(auth_conf.0.to_owned(), auth_conf.1.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::PullReview`"))), - ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::PullReview`")))), - } - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -pub async fn repo_get_pull_review_comment( - configuration: &configuration::Configuration, - owner: &str, - repo: &str, - index: i64, - id: i64, - comment: i64, -) -> Result> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_owner = owner; - let p_path_repo = repo; - let p_path_index = index; - let p_path_id = id; - let p_path_comment = comment; - - let uri_str = format!( - "{}/repos/{owner}/{repo}/pulls/{index}/reviews/{id}/comments/{comment}", - configuration.base_path, - owner = crate::apis::urlencode(p_path_owner), - repo = crate::apis::urlencode(p_path_repo), - index = p_path_index, - id = p_path_id, - comment = p_path_comment - ); - let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); - - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("access_token", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("sudo", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("token", value)]); - } - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("X-FORGEJO-OTP", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Authorization", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Sudo", value); - }; - if let Some(ref auth_conf) = configuration.basic_auth { - req_builder = req_builder.basic_auth(auth_conf.0.to_owned(), auth_conf.1.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::PullReviewComment`"))), - ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::PullReviewComment`")))), - } - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -pub async fn repo_get_pull_review_comments( - configuration: &configuration::Configuration, - owner: &str, - repo: &str, - index: i64, - id: i64, -) -> Result, Error> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_owner = owner; - let p_path_repo = repo; - let p_path_index = index; - let p_path_id = id; - - let uri_str = format!( - "{}/repos/{owner}/{repo}/pulls/{index}/reviews/{id}/comments", - configuration.base_path, - owner = crate::apis::urlencode(p_path_owner), - repo = crate::apis::urlencode(p_path_repo), - index = p_path_index, - id = p_path_id - ); - let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); - - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("access_token", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("sudo", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("token", value)]); - } - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("X-FORGEJO-OTP", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Authorization", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Sudo", value); - }; - if let Some(ref auth_conf) = configuration.basic_auth { - req_builder = req_builder.basic_auth(auth_conf.0.to_owned(), auth_conf.1.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `Vec<models::PullReviewComment>`"))), - ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `Vec<models::PullReviewComment>`")))), - } - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -pub async fn repo_get_push_mirror_by_remote_name( - configuration: &configuration::Configuration, - owner: &str, - repo: &str, - name: &str, -) -> Result> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_owner = owner; - let p_path_repo = repo; - let p_path_name = name; - - let uri_str = format!( - "{}/repos/{owner}/{repo}/push_mirrors/{name}", - configuration.base_path, - owner = crate::apis::urlencode(p_path_owner), - repo = crate::apis::urlencode(p_path_repo), - name = crate::apis::urlencode(p_path_name) - ); - let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); - - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("access_token", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("sudo", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("token", value)]); - } - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("X-FORGEJO-OTP", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Authorization", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Sudo", value); - }; - if let Some(ref auth_conf) = configuration.basic_auth { - req_builder = req_builder.basic_auth(auth_conf.0.to_owned(), auth_conf.1.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::PushMirror`"))), - ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::PushMirror`")))), - } - } else { - let content = resp.text().await?; - let entity: Option = - serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -pub async fn repo_get_raw_file( - configuration: &configuration::Configuration, - owner: &str, - repo: &str, - filepath: &str, - r#ref: Option<&str>, -) -> Result> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_owner = owner; - let p_path_repo = repo; - let p_path_filepath = filepath; - let p_query_ref = r#ref; - - let uri_str = format!( - "{}/repos/{owner}/{repo}/raw/{filepath}", - configuration.base_path, - owner = crate::apis::urlencode(p_path_owner), - repo = crate::apis::urlencode(p_path_repo), - filepath = crate::apis::urlencode(p_path_filepath) - ); - let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); - - if let Some(ref param_value) = p_query_ref { - req_builder = req_builder.query(&[("ref", ¶m_value.to_string())]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("access_token", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("sudo", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("token", value)]); - } - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("X-FORGEJO-OTP", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Authorization", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Sudo", value); - }; - if let Some(ref auth_conf) = configuration.basic_auth { - req_builder = req_builder.basic_auth(auth_conf.0.to_owned(), auth_conf.1.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - - if !status.is_client_error() && !status.is_server_error() { - Ok(resp) - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -pub async fn repo_get_raw_file_or_lfs( - configuration: &configuration::Configuration, - owner: &str, - repo: &str, - filepath: &str, - r#ref: Option<&str>, -) -> Result> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_owner = owner; - let p_path_repo = repo; - let p_path_filepath = filepath; - let p_query_ref = r#ref; - - let uri_str = format!( - "{}/repos/{owner}/{repo}/media/{filepath}", - configuration.base_path, - owner = crate::apis::urlencode(p_path_owner), - repo = crate::apis::urlencode(p_path_repo), - filepath = crate::apis::urlencode(p_path_filepath) - ); - let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); - - if let Some(ref param_value) = p_query_ref { - req_builder = req_builder.query(&[("ref", ¶m_value.to_string())]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("access_token", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("sudo", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("token", value)]); - } - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("X-FORGEJO-OTP", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Authorization", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Sudo", value); - }; - if let Some(ref auth_conf) = configuration.basic_auth { - req_builder = req_builder.basic_auth(auth_conf.0.to_owned(), auth_conf.1.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - - if !status.is_client_error() && !status.is_server_error() { - Ok(resp) - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -pub async fn repo_get_release( - configuration: &configuration::Configuration, - owner: &str, - repo: &str, - id: i64, -) -> Result> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_owner = owner; - let p_path_repo = repo; - let p_path_id = id; - - let uri_str = format!( - "{}/repos/{owner}/{repo}/releases/{id}", - configuration.base_path, - owner = crate::apis::urlencode(p_path_owner), - repo = crate::apis::urlencode(p_path_repo), - id = p_path_id - ); - let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); - - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("access_token", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("sudo", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("token", value)]); - } - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("X-FORGEJO-OTP", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Authorization", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Sudo", value); - }; - if let Some(ref auth_conf) = configuration.basic_auth { - req_builder = req_builder.basic_auth(auth_conf.0.to_owned(), auth_conf.1.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::Release`"))), - ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::Release`")))), - } - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -pub async fn repo_get_release_attachment( - configuration: &configuration::Configuration, - owner: &str, - repo: &str, - id: i64, - attachment_id: i64, -) -> Result> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_owner = owner; - let p_path_repo = repo; - let p_path_id = id; - let p_path_attachment_id = attachment_id; - - let uri_str = format!( - "{}/repos/{owner}/{repo}/releases/{id}/assets/{attachment_id}", - configuration.base_path, - owner = crate::apis::urlencode(p_path_owner), - repo = crate::apis::urlencode(p_path_repo), - id = p_path_id, - attachment_id = p_path_attachment_id - ); - let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); - - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("access_token", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("sudo", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("token", value)]); - } - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("X-FORGEJO-OTP", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Authorization", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Sudo", value); - }; - if let Some(ref auth_conf) = configuration.basic_auth { - req_builder = req_builder.basic_auth(auth_conf.0.to_owned(), auth_conf.1.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::Attachment`"))), - ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::Attachment`")))), - } - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -pub async fn repo_get_release_by_tag( - configuration: &configuration::Configuration, - owner: &str, - repo: &str, - tag: &str, -) -> Result> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_owner = owner; - let p_path_repo = repo; - let p_path_tag = tag; - - let uri_str = format!( - "{}/repos/{owner}/{repo}/releases/tags/{tag}", - configuration.base_path, - owner = crate::apis::urlencode(p_path_owner), - repo = crate::apis::urlencode(p_path_repo), - tag = crate::apis::urlencode(p_path_tag) - ); - let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); - - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("access_token", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("sudo", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("token", value)]); - } - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("X-FORGEJO-OTP", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Authorization", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Sudo", value); - }; - if let Some(ref auth_conf) = configuration.basic_auth { - req_builder = req_builder.basic_auth(auth_conf.0.to_owned(), auth_conf.1.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::Release`"))), - ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::Release`")))), - } - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -pub async fn repo_get_repo_permissions( - configuration: &configuration::Configuration, - owner: &str, - repo: &str, - collaborator: &str, -) -> Result> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_owner = owner; - let p_path_repo = repo; - let p_path_collaborator = collaborator; - - let uri_str = format!( - "{}/repos/{owner}/{repo}/collaborators/{collaborator}/permission", - configuration.base_path, - owner = crate::apis::urlencode(p_path_owner), - repo = crate::apis::urlencode(p_path_repo), - collaborator = crate::apis::urlencode(p_path_collaborator) - ); - let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); - - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("access_token", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("sudo", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("token", value)]); - } - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("X-FORGEJO-OTP", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Authorization", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Sudo", value); - }; - if let Some(ref auth_conf) = configuration.basic_auth { - req_builder = req_builder.basic_auth(auth_conf.0.to_owned(), auth_conf.1.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::RepoCollaboratorPermission`"))), - ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::RepoCollaboratorPermission`")))), - } - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -pub async fn repo_get_reviewers( - configuration: &configuration::Configuration, - owner: &str, - repo: &str, -) -> Result, Error> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_owner = owner; - let p_path_repo = repo; - - let uri_str = format!( - "{}/repos/{owner}/{repo}/reviewers", - configuration.base_path, - owner = crate::apis::urlencode(p_path_owner), - repo = crate::apis::urlencode(p_path_repo) - ); - let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); - - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("access_token", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("sudo", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("token", value)]); - } - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("X-FORGEJO-OTP", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Authorization", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Sudo", value); - }; - if let Some(ref auth_conf) = configuration.basic_auth { - req_builder = req_builder.basic_auth(auth_conf.0.to_owned(), auth_conf.1.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `Vec<models::User>`"))), - ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `Vec<models::User>`")))), - } - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -pub async fn repo_get_runner_registration_token( - configuration: &configuration::Configuration, - owner: &str, - repo: &str, -) -> Result> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_owner = owner; - let p_path_repo = repo; - - let uri_str = format!( - "{}/repos/{owner}/{repo}/actions/runners/registration-token", - configuration.base_path, - owner = crate::apis::urlencode(p_path_owner), - repo = crate::apis::urlencode(p_path_repo) - ); - let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); - - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("access_token", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("sudo", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("token", value)]); - } - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("X-FORGEJO-OTP", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Authorization", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Sudo", value); - }; - if let Some(ref auth_conf) = configuration.basic_auth { - req_builder = req_builder.basic_auth(auth_conf.0.to_owned(), auth_conf.1.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::RegistrationToken`"))), - ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::RegistrationToken`")))), - } - } else { - let content = resp.text().await?; - let entity: Option = - serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -pub async fn repo_get_single_commit( - configuration: &configuration::Configuration, - owner: &str, - repo: &str, - sha: &str, - stat: Option, - verification: Option, - files: Option, -) -> Result> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_owner = owner; - let p_path_repo = repo; - let p_path_sha = sha; - let p_query_stat = stat; - let p_query_verification = verification; - let p_query_files = files; - - let uri_str = format!( - "{}/repos/{owner}/{repo}/git/commits/{sha}", - configuration.base_path, - owner = crate::apis::urlencode(p_path_owner), - repo = crate::apis::urlencode(p_path_repo), - sha = crate::apis::urlencode(p_path_sha) - ); - let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); - - if let Some(ref param_value) = p_query_stat { - req_builder = req_builder.query(&[("stat", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_verification { - req_builder = req_builder.query(&[("verification", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_files { - req_builder = req_builder.query(&[("files", ¶m_value.to_string())]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("access_token", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("sudo", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("token", value)]); - } - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("X-FORGEJO-OTP", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Authorization", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Sudo", value); - }; - if let Some(ref auth_conf) = configuration.basic_auth { - req_builder = req_builder.basic_auth(auth_conf.0.to_owned(), auth_conf.1.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::Commit`"))), - ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::Commit`")))), - } - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -pub async fn repo_get_tag( - configuration: &configuration::Configuration, - owner: &str, - repo: &str, - tag: &str, -) -> Result> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_owner = owner; - let p_path_repo = repo; - let p_path_tag = tag; - - let uri_str = format!( - "{}/repos/{owner}/{repo}/tags/{tag}", - configuration.base_path, - owner = crate::apis::urlencode(p_path_owner), - repo = crate::apis::urlencode(p_path_repo), - tag = crate::apis::urlencode(p_path_tag) - ); - let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); - - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("access_token", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("sudo", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("token", value)]); - } - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("X-FORGEJO-OTP", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Authorization", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Sudo", value); - }; - if let Some(ref auth_conf) = configuration.basic_auth { - req_builder = req_builder.basic_auth(auth_conf.0.to_owned(), auth_conf.1.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::Tag`"))), - ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::Tag`")))), - } - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -pub async fn repo_get_tag_protection( - configuration: &configuration::Configuration, - owner: &str, - repo: &str, - id: i64, -) -> Result> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_owner = owner; - let p_path_repo = repo; - let p_path_id = id; - - let uri_str = format!( - "{}/repos/{owner}/{repo}/tag_protections/{id}", - configuration.base_path, - owner = crate::apis::urlencode(p_path_owner), - repo = crate::apis::urlencode(p_path_repo), - id = p_path_id - ); - let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); - - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("access_token", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("sudo", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("token", value)]); - } - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("X-FORGEJO-OTP", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Authorization", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Sudo", value); - }; - if let Some(ref auth_conf) = configuration.basic_auth { - req_builder = req_builder.basic_auth(auth_conf.0.to_owned(), auth_conf.1.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::TagProtection`"))), - ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::TagProtection`")))), - } - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -pub async fn repo_get_wiki_page( - configuration: &configuration::Configuration, - owner: &str, - repo: &str, - page_name: &str, -) -> Result> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_owner = owner; - let p_path_repo = repo; - let p_path_page_name = page_name; - - let uri_str = format!( - "{}/repos/{owner}/{repo}/wiki/page/{pageName}", - configuration.base_path, - owner = crate::apis::urlencode(p_path_owner), - repo = crate::apis::urlencode(p_path_repo), - pageName = crate::apis::urlencode(p_path_page_name) - ); - let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); - - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("access_token", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("sudo", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("token", value)]); - } - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("X-FORGEJO-OTP", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Authorization", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Sudo", value); - }; - if let Some(ref auth_conf) = configuration.basic_auth { - req_builder = req_builder.basic_auth(auth_conf.0.to_owned(), auth_conf.1.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::WikiPage`"))), - ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::WikiPage`")))), - } - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -pub async fn repo_get_wiki_page_revisions( - configuration: &configuration::Configuration, - owner: &str, - repo: &str, - page_name: &str, - page: Option, -) -> Result> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_owner = owner; - let p_path_repo = repo; - let p_path_page_name = page_name; - let p_query_page = page; - - let uri_str = format!( - "{}/repos/{owner}/{repo}/wiki/revisions/{pageName}", - configuration.base_path, - owner = crate::apis::urlencode(p_path_owner), - repo = crate::apis::urlencode(p_path_repo), - pageName = crate::apis::urlencode(p_path_page_name) - ); - let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); - - if let Some(ref param_value) = p_query_page { - req_builder = req_builder.query(&[("page", ¶m_value.to_string())]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("access_token", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("sudo", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("token", value)]); - } - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("X-FORGEJO-OTP", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Authorization", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Sudo", value); - }; - if let Some(ref auth_conf) = configuration.basic_auth { - req_builder = req_builder.basic_auth(auth_conf.0.to_owned(), auth_conf.1.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::WikiCommitList`"))), - ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::WikiCommitList`")))), - } - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -pub async fn repo_get_wiki_pages( - configuration: &configuration::Configuration, - owner: &str, - repo: &str, - page: Option, - limit: Option, -) -> Result, Error> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_owner = owner; - let p_path_repo = repo; - let p_query_page = page; - let p_query_limit = limit; - - let uri_str = format!( - "{}/repos/{owner}/{repo}/wiki/pages", - configuration.base_path, - owner = crate::apis::urlencode(p_path_owner), - repo = crate::apis::urlencode(p_path_repo) - ); - let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); - - if let Some(ref param_value) = p_query_page { - req_builder = req_builder.query(&[("page", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_limit { - req_builder = req_builder.query(&[("limit", ¶m_value.to_string())]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("access_token", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("sudo", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("token", value)]); - } - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("X-FORGEJO-OTP", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Authorization", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Sudo", value); - }; - if let Some(ref auth_conf) = configuration.basic_auth { - req_builder = req_builder.basic_auth(auth_conf.0.to_owned(), auth_conf.1.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `Vec<models::WikiPageMetaData>`"))), - ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `Vec<models::WikiPageMetaData>`")))), - } - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -pub async fn repo_list_actions_secrets( - configuration: &configuration::Configuration, - owner: &str, - repo: &str, - page: Option, - limit: Option, -) -> Result, Error> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_owner = owner; - let p_path_repo = repo; - let p_query_page = page; - let p_query_limit = limit; - - let uri_str = format!( - "{}/repos/{owner}/{repo}/actions/secrets", - configuration.base_path, - owner = crate::apis::urlencode(p_path_owner), - repo = crate::apis::urlencode(p_path_repo) - ); - let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); - - if let Some(ref param_value) = p_query_page { - req_builder = req_builder.query(&[("page", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_limit { - req_builder = req_builder.query(&[("limit", ¶m_value.to_string())]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("access_token", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("sudo", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("token", value)]); - } - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("X-FORGEJO-OTP", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Authorization", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Sudo", value); - }; - if let Some(ref auth_conf) = configuration.basic_auth { - req_builder = req_builder.basic_auth(auth_conf.0.to_owned(), auth_conf.1.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `Vec<models::Secret>`"))), - ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `Vec<models::Secret>`")))), - } - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -pub async fn repo_list_activity_feeds( - configuration: &configuration::Configuration, - owner: &str, - repo: &str, - date: Option, - page: Option, - limit: Option, -) -> Result, Error> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_owner = owner; - let p_path_repo = repo; - let p_query_date = date; - let p_query_page = page; - let p_query_limit = limit; - - let uri_str = format!( - "{}/repos/{owner}/{repo}/activities/feeds", - configuration.base_path, - owner = crate::apis::urlencode(p_path_owner), - repo = crate::apis::urlencode(p_path_repo) - ); - let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); - - if let Some(ref param_value) = p_query_date { - req_builder = req_builder.query(&[("date", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_page { - req_builder = req_builder.query(&[("page", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_limit { - req_builder = req_builder.query(&[("limit", ¶m_value.to_string())]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("access_token", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("sudo", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("token", value)]); - } - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("X-FORGEJO-OTP", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Authorization", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Sudo", value); - }; - if let Some(ref auth_conf) = configuration.basic_auth { - req_builder = req_builder.basic_auth(auth_conf.0.to_owned(), auth_conf.1.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `Vec<models::Activity>`"))), - ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `Vec<models::Activity>`")))), - } - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -pub async fn repo_list_all_git_refs( - configuration: &configuration::Configuration, - owner: &str, - repo: &str, -) -> Result, Error> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_owner = owner; - let p_path_repo = repo; - - let uri_str = format!( - "{}/repos/{owner}/{repo}/git/refs", - configuration.base_path, - owner = crate::apis::urlencode(p_path_owner), - repo = crate::apis::urlencode(p_path_repo) - ); - let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); - - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("access_token", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("sudo", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("token", value)]); - } - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("X-FORGEJO-OTP", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Authorization", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Sudo", value); - }; - if let Some(ref auth_conf) = configuration.basic_auth { - req_builder = req_builder.basic_auth(auth_conf.0.to_owned(), auth_conf.1.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `Vec<models::Reference>`"))), - ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `Vec<models::Reference>`")))), - } - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -pub async fn repo_list_branch_protection( - configuration: &configuration::Configuration, - owner: &str, - repo: &str, -) -> Result, Error> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_owner = owner; - let p_path_repo = repo; - - let uri_str = format!( - "{}/repos/{owner}/{repo}/branch_protections", - configuration.base_path, - owner = crate::apis::urlencode(p_path_owner), - repo = crate::apis::urlencode(p_path_repo) - ); - let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); - - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("access_token", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("sudo", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("token", value)]); - } - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("X-FORGEJO-OTP", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Authorization", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Sudo", value); - }; - if let Some(ref auth_conf) = configuration.basic_auth { - req_builder = req_builder.basic_auth(auth_conf.0.to_owned(), auth_conf.1.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `Vec<models::BranchProtection>`"))), - ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `Vec<models::BranchProtection>`")))), - } - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -pub async fn repo_list_branches( - configuration: &configuration::Configuration, - owner: &str, - repo: &str, - page: Option, - limit: Option, -) -> Result, Error> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_owner = owner; - let p_path_repo = repo; - let p_query_page = page; - let p_query_limit = limit; - - let uri_str = format!( - "{}/repos/{owner}/{repo}/branches", - configuration.base_path, - owner = crate::apis::urlencode(p_path_owner), - repo = crate::apis::urlencode(p_path_repo) - ); - let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); - - if let Some(ref param_value) = p_query_page { - req_builder = req_builder.query(&[("page", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_limit { - req_builder = req_builder.query(&[("limit", ¶m_value.to_string())]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("access_token", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("sudo", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("token", value)]); - } - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("X-FORGEJO-OTP", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Authorization", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Sudo", value); - }; - if let Some(ref auth_conf) = configuration.basic_auth { - req_builder = req_builder.basic_auth(auth_conf.0.to_owned(), auth_conf.1.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `Vec<models::Branch>`"))), - ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `Vec<models::Branch>`")))), - } - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -pub async fn repo_list_collaborators( - configuration: &configuration::Configuration, - owner: &str, - repo: &str, - page: Option, - limit: Option, -) -> Result, Error> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_owner = owner; - let p_path_repo = repo; - let p_query_page = page; - let p_query_limit = limit; - - let uri_str = format!( - "{}/repos/{owner}/{repo}/collaborators", - configuration.base_path, - owner = crate::apis::urlencode(p_path_owner), - repo = crate::apis::urlencode(p_path_repo) - ); - let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); - - if let Some(ref param_value) = p_query_page { - req_builder = req_builder.query(&[("page", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_limit { - req_builder = req_builder.query(&[("limit", ¶m_value.to_string())]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("access_token", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("sudo", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("token", value)]); - } - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("X-FORGEJO-OTP", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Authorization", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Sudo", value); - }; - if let Some(ref auth_conf) = configuration.basic_auth { - req_builder = req_builder.basic_auth(auth_conf.0.to_owned(), auth_conf.1.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `Vec<models::User>`"))), - ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `Vec<models::User>`")))), - } - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -pub async fn repo_list_flags( - configuration: &configuration::Configuration, - owner: &str, - repo: &str, -) -> Result, Error> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_owner = owner; - let p_path_repo = repo; - - let uri_str = format!( - "{}/repos/{owner}/{repo}/flags", - configuration.base_path, - owner = crate::apis::urlencode(p_path_owner), - repo = crate::apis::urlencode(p_path_repo) - ); - let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); - - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("access_token", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("sudo", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("token", value)]); - } - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("X-FORGEJO-OTP", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Authorization", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Sudo", value); - }; - if let Some(ref auth_conf) = configuration.basic_auth { - req_builder = req_builder.basic_auth(auth_conf.0.to_owned(), auth_conf.1.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `Vec<String>`"))), - ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `Vec<String>`")))), - } - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -pub async fn repo_list_git_hooks( - configuration: &configuration::Configuration, - owner: &str, - repo: &str, -) -> Result, Error> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_owner = owner; - let p_path_repo = repo; - - let uri_str = format!( - "{}/repos/{owner}/{repo}/hooks/git", - configuration.base_path, - owner = crate::apis::urlencode(p_path_owner), - repo = crate::apis::urlencode(p_path_repo) - ); - let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); - - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("access_token", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("sudo", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("token", value)]); - } - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("X-FORGEJO-OTP", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Authorization", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Sudo", value); - }; - if let Some(ref auth_conf) = configuration.basic_auth { - req_builder = req_builder.basic_auth(auth_conf.0.to_owned(), auth_conf.1.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `Vec<models::GitHook>`"))), - ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `Vec<models::GitHook>`")))), - } - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -pub async fn repo_list_git_refs( - configuration: &configuration::Configuration, - owner: &str, - repo: &str, - r#ref: &str, -) -> Result, Error> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_owner = owner; - let p_path_repo = repo; - let p_path_ref = r#ref; - - let uri_str = format!("{}/repos/{owner}/{repo}/git/refs/{ref}", configuration.base_path, owner=crate::apis::urlencode(p_path_owner), repo=crate::apis::urlencode(p_path_repo), ref=crate::apis::urlencode(p_path_ref)); - let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); - - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("access_token", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("sudo", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("token", value)]); - } - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("X-FORGEJO-OTP", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Authorization", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Sudo", value); - }; - if let Some(ref auth_conf) = configuration.basic_auth { - req_builder = req_builder.basic_auth(auth_conf.0.to_owned(), auth_conf.1.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `Vec<models::Reference>`"))), - ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `Vec<models::Reference>`")))), - } - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -pub async fn repo_list_hooks( - configuration: &configuration::Configuration, - owner: &str, - repo: &str, - page: Option, - limit: Option, -) -> Result, Error> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_owner = owner; - let p_path_repo = repo; - let p_query_page = page; - let p_query_limit = limit; - - let uri_str = format!( - "{}/repos/{owner}/{repo}/hooks", - configuration.base_path, - owner = crate::apis::urlencode(p_path_owner), - repo = crate::apis::urlencode(p_path_repo) - ); - let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); - - if let Some(ref param_value) = p_query_page { - req_builder = req_builder.query(&[("page", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_limit { - req_builder = req_builder.query(&[("limit", ¶m_value.to_string())]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("access_token", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("sudo", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("token", value)]); - } - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("X-FORGEJO-OTP", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Authorization", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Sudo", value); - }; - if let Some(ref auth_conf) = configuration.basic_auth { - req_builder = req_builder.basic_auth(auth_conf.0.to_owned(), auth_conf.1.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `Vec<models::Hook>`"))), - ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `Vec<models::Hook>`")))), - } - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -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> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_owner = owner; - let p_path_repo = repo; - let p_query_key_id = key_id; - let p_query_fingerprint = fingerprint; - let p_query_page = page; - let p_query_limit = limit; - - let uri_str = format!( - "{}/repos/{owner}/{repo}/keys", - configuration.base_path, - owner = crate::apis::urlencode(p_path_owner), - repo = crate::apis::urlencode(p_path_repo) - ); - let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); - - if let Some(ref param_value) = p_query_key_id { - req_builder = req_builder.query(&[("key_id", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_fingerprint { - req_builder = req_builder.query(&[("fingerprint", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_page { - req_builder = req_builder.query(&[("page", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_limit { - req_builder = req_builder.query(&[("limit", ¶m_value.to_string())]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("access_token", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("sudo", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("token", value)]); - } - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("X-FORGEJO-OTP", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Authorization", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Sudo", value); - }; - if let Some(ref auth_conf) = configuration.basic_auth { - req_builder = req_builder.basic_auth(auth_conf.0.to_owned(), auth_conf.1.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `Vec<models::DeployKey>`"))), - ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `Vec<models::DeployKey>`")))), - } - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -pub async fn repo_list_pinned_issues( - configuration: &configuration::Configuration, - owner: &str, - repo: &str, -) -> Result, Error> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_owner = owner; - let p_path_repo = repo; - - let uri_str = format!( - "{}/repos/{owner}/{repo}/issues/pinned", - configuration.base_path, - owner = crate::apis::urlencode(p_path_owner), - repo = crate::apis::urlencode(p_path_repo) - ); - let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); - - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("access_token", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("sudo", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("token", value)]); - } - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("X-FORGEJO-OTP", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Authorization", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Sudo", value); - }; - if let Some(ref auth_conf) = configuration.basic_auth { - req_builder = req_builder.basic_auth(auth_conf.0.to_owned(), auth_conf.1.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `Vec<models::Issue>`"))), - ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `Vec<models::Issue>`")))), - } - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -pub async fn repo_list_pinned_pull_requests( - configuration: &configuration::Configuration, - owner: &str, - repo: &str, -) -> Result, Error> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_owner = owner; - let p_path_repo = repo; - - let uri_str = format!( - "{}/repos/{owner}/{repo}/pulls/pinned", - configuration.base_path, - owner = crate::apis::urlencode(p_path_owner), - repo = crate::apis::urlencode(p_path_repo) - ); - let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); - - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("access_token", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("sudo", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("token", value)]); - } - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("X-FORGEJO-OTP", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Authorization", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Sudo", value); - }; - if let Some(ref auth_conf) = configuration.basic_auth { - req_builder = req_builder.basic_auth(auth_conf.0.to_owned(), auth_conf.1.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `Vec<models::PullRequest>`"))), - ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `Vec<models::PullRequest>`")))), - } - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -pub async fn repo_list_pull_requests( - configuration: &configuration::Configuration, - owner: &str, - repo: &str, - state: Option<&str>, - sort: Option<&str>, - milestone: Option, - labels: Option>, - poster: Option<&str>, - page: Option, - limit: Option, -) -> Result, Error> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_owner = owner; - let p_path_repo = repo; - let p_query_state = state; - let p_query_sort = sort; - let p_query_milestone = milestone; - let p_query_labels = labels; - let p_query_poster = poster; - let p_query_page = page; - let p_query_limit = limit; - - let uri_str = format!( - "{}/repos/{owner}/{repo}/pulls", - configuration.base_path, - owner = crate::apis::urlencode(p_path_owner), - repo = crate::apis::urlencode(p_path_repo) - ); - let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); - - if let Some(ref param_value) = p_query_state { - req_builder = req_builder.query(&[("state", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_sort { - req_builder = req_builder.query(&[("sort", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_milestone { - req_builder = req_builder.query(&[("milestone", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_labels { - req_builder = match "multi" { - "multi" => req_builder.query( - ¶m_value - .into_iter() - .map(|p| ("labels".to_owned(), p.to_string())) - .collect::>(), - ), - _ => req_builder.query(&[( - "labels", - ¶m_value - .into_iter() - .map(|p| p.to_string()) - .collect::>() - .join(",") - .to_string(), - )]), - }; - } - if let Some(ref param_value) = p_query_poster { - req_builder = req_builder.query(&[("poster", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_page { - req_builder = req_builder.query(&[("page", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_limit { - req_builder = req_builder.query(&[("limit", ¶m_value.to_string())]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("access_token", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("sudo", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("token", value)]); - } - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("X-FORGEJO-OTP", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Authorization", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Sudo", value); - }; - if let Some(ref auth_conf) = configuration.basic_auth { - req_builder = req_builder.basic_auth(auth_conf.0.to_owned(), auth_conf.1.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `Vec<models::PullRequest>`"))), - ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `Vec<models::PullRequest>`")))), - } - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -pub async fn repo_list_pull_reviews( - configuration: &configuration::Configuration, - owner: &str, - repo: &str, - index: i64, - page: Option, - limit: Option, -) -> Result, Error> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_owner = owner; - let p_path_repo = repo; - let p_path_index = index; - let p_query_page = page; - let p_query_limit = limit; - - let uri_str = format!( - "{}/repos/{owner}/{repo}/pulls/{index}/reviews", - configuration.base_path, - owner = crate::apis::urlencode(p_path_owner), - repo = crate::apis::urlencode(p_path_repo), - index = p_path_index - ); - let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); - - if let Some(ref param_value) = p_query_page { - req_builder = req_builder.query(&[("page", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_limit { - req_builder = req_builder.query(&[("limit", ¶m_value.to_string())]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("access_token", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("sudo", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("token", value)]); - } - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("X-FORGEJO-OTP", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Authorization", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Sudo", value); - }; - if let Some(ref auth_conf) = configuration.basic_auth { - req_builder = req_builder.basic_auth(auth_conf.0.to_owned(), auth_conf.1.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `Vec<models::PullReview>`"))), - ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `Vec<models::PullReview>`")))), - } - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -pub async fn repo_list_push_mirrors( - configuration: &configuration::Configuration, - owner: &str, - repo: &str, - page: Option, - limit: Option, -) -> Result, Error> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_owner = owner; - let p_path_repo = repo; - let p_query_page = page; - let p_query_limit = limit; - - let uri_str = format!( - "{}/repos/{owner}/{repo}/push_mirrors", - configuration.base_path, - owner = crate::apis::urlencode(p_path_owner), - repo = crate::apis::urlencode(p_path_repo) - ); - let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); - - if let Some(ref param_value) = p_query_page { - req_builder = req_builder.query(&[("page", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_limit { - req_builder = req_builder.query(&[("limit", ¶m_value.to_string())]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("access_token", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("sudo", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("token", value)]); - } - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("X-FORGEJO-OTP", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Authorization", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Sudo", value); - }; - if let Some(ref auth_conf) = configuration.basic_auth { - req_builder = req_builder.basic_auth(auth_conf.0.to_owned(), auth_conf.1.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `Vec<models::PushMirror>`"))), - ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `Vec<models::PushMirror>`")))), - } - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -pub async fn repo_list_release_attachments( - configuration: &configuration::Configuration, - owner: &str, - repo: &str, - id: i64, -) -> Result, Error> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_owner = owner; - let p_path_repo = repo; - let p_path_id = id; - - let uri_str = format!( - "{}/repos/{owner}/{repo}/releases/{id}/assets", - configuration.base_path, - owner = crate::apis::urlencode(p_path_owner), - repo = crate::apis::urlencode(p_path_repo), - id = p_path_id - ); - let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); - - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("access_token", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("sudo", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("token", value)]); - } - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("X-FORGEJO-OTP", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Authorization", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Sudo", value); - }; - if let Some(ref auth_conf) = configuration.basic_auth { - req_builder = req_builder.basic_auth(auth_conf.0.to_owned(), auth_conf.1.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `Vec<models::Attachment>`"))), - ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `Vec<models::Attachment>`")))), - } - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -pub async fn repo_list_releases( - configuration: &configuration::Configuration, - owner: &str, - repo: &str, - draft: Option, - pre_release: Option, - q: Option<&str>, - page: Option, - limit: Option, -) -> Result, Error> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_owner = owner; - let p_path_repo = repo; - let p_query_draft = draft; - let p_query_pre_release = pre_release; - let p_query_q = q; - let p_query_page = page; - let p_query_limit = limit; - - let uri_str = format!( - "{}/repos/{owner}/{repo}/releases", - configuration.base_path, - owner = crate::apis::urlencode(p_path_owner), - repo = crate::apis::urlencode(p_path_repo) - ); - let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); - - if let Some(ref param_value) = p_query_draft { - req_builder = req_builder.query(&[("draft", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_pre_release { - req_builder = req_builder.query(&[("pre-release", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_q { - req_builder = req_builder.query(&[("q", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_page { - req_builder = req_builder.query(&[("page", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_limit { - req_builder = req_builder.query(&[("limit", ¶m_value.to_string())]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("access_token", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("sudo", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("token", value)]); - } - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("X-FORGEJO-OTP", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Authorization", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Sudo", value); - }; - if let Some(ref auth_conf) = configuration.basic_auth { - req_builder = req_builder.basic_auth(auth_conf.0.to_owned(), auth_conf.1.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `Vec<models::Release>`"))), - ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `Vec<models::Release>`")))), - } - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -pub async fn repo_list_stargazers( - configuration: &configuration::Configuration, - owner: &str, - repo: &str, - page: Option, - limit: Option, -) -> Result, Error> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_owner = owner; - let p_path_repo = repo; - let p_query_page = page; - let p_query_limit = limit; - - let uri_str = format!( - "{}/repos/{owner}/{repo}/stargazers", - configuration.base_path, - owner = crate::apis::urlencode(p_path_owner), - repo = crate::apis::urlencode(p_path_repo) - ); - let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); - - if let Some(ref param_value) = p_query_page { - req_builder = req_builder.query(&[("page", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_limit { - req_builder = req_builder.query(&[("limit", ¶m_value.to_string())]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("access_token", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("sudo", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("token", value)]); - } - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("X-FORGEJO-OTP", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Authorization", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Sudo", value); - }; - if let Some(ref auth_conf) = configuration.basic_auth { - req_builder = req_builder.basic_auth(auth_conf.0.to_owned(), auth_conf.1.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `Vec<models::User>`"))), - ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `Vec<models::User>`")))), - } - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -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> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_owner = owner; - let p_path_repo = repo; - let p_path_sha = sha; - let p_query_sort = sort; - let p_query_state = state; - let p_query_page = page; - let p_query_limit = limit; - - let uri_str = format!( - "{}/repos/{owner}/{repo}/statuses/{sha}", - configuration.base_path, - owner = crate::apis::urlencode(p_path_owner), - repo = crate::apis::urlencode(p_path_repo), - sha = crate::apis::urlencode(p_path_sha) - ); - let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); - - if let Some(ref param_value) = p_query_sort { - req_builder = req_builder.query(&[("sort", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_state { - req_builder = req_builder.query(&[("state", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_page { - req_builder = req_builder.query(&[("page", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_limit { - req_builder = req_builder.query(&[("limit", ¶m_value.to_string())]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("access_token", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("sudo", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("token", value)]); - } - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("X-FORGEJO-OTP", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Authorization", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Sudo", value); - }; - if let Some(ref auth_conf) = configuration.basic_auth { - req_builder = req_builder.basic_auth(auth_conf.0.to_owned(), auth_conf.1.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `Vec<models::CommitStatus>`"))), - ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `Vec<models::CommitStatus>`")))), - } - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -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> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_owner = owner; - let p_path_repo = repo; - let p_path_ref = r#ref; - let p_query_sort = sort; - let p_query_state = state; - let p_query_page = page; - let p_query_limit = limit; - - let uri_str = format!("{}/repos/{owner}/{repo}/commits/{ref}/statuses", configuration.base_path, owner=crate::apis::urlencode(p_path_owner), repo=crate::apis::urlencode(p_path_repo), ref=crate::apis::urlencode(p_path_ref)); - let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); - - if let Some(ref param_value) = p_query_sort { - req_builder = req_builder.query(&[("sort", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_state { - req_builder = req_builder.query(&[("state", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_page { - req_builder = req_builder.query(&[("page", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_limit { - req_builder = req_builder.query(&[("limit", ¶m_value.to_string())]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("access_token", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("sudo", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("token", value)]); - } - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("X-FORGEJO-OTP", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Authorization", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Sudo", value); - }; - if let Some(ref auth_conf) = configuration.basic_auth { - req_builder = req_builder.basic_auth(auth_conf.0.to_owned(), auth_conf.1.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `Vec<models::CommitStatus>`"))), - ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `Vec<models::CommitStatus>`")))), - } - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -pub async fn repo_list_subscribers( - configuration: &configuration::Configuration, - owner: &str, - repo: &str, - page: Option, - limit: Option, -) -> Result, Error> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_owner = owner; - let p_path_repo = repo; - let p_query_page = page; - let p_query_limit = limit; - - let uri_str = format!( - "{}/repos/{owner}/{repo}/subscribers", - configuration.base_path, - owner = crate::apis::urlencode(p_path_owner), - repo = crate::apis::urlencode(p_path_repo) - ); - let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); - - if let Some(ref param_value) = p_query_page { - req_builder = req_builder.query(&[("page", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_limit { - req_builder = req_builder.query(&[("limit", ¶m_value.to_string())]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("access_token", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("sudo", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("token", value)]); - } - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("X-FORGEJO-OTP", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Authorization", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Sudo", value); - }; - if let Some(ref auth_conf) = configuration.basic_auth { - req_builder = req_builder.basic_auth(auth_conf.0.to_owned(), auth_conf.1.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `Vec<models::User>`"))), - ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `Vec<models::User>`")))), - } - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -pub async fn repo_list_tag_protection( - configuration: &configuration::Configuration, - owner: &str, - repo: &str, -) -> Result, Error> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_owner = owner; - let p_path_repo = repo; - - let uri_str = format!( - "{}/repos/{owner}/{repo}/tag_protections", - configuration.base_path, - owner = crate::apis::urlencode(p_path_owner), - repo = crate::apis::urlencode(p_path_repo) - ); - let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); - - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("access_token", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("sudo", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("token", value)]); - } - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("X-FORGEJO-OTP", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Authorization", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Sudo", value); - }; - if let Some(ref auth_conf) = configuration.basic_auth { - req_builder = req_builder.basic_auth(auth_conf.0.to_owned(), auth_conf.1.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `Vec<models::TagProtection>`"))), - ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `Vec<models::TagProtection>`")))), - } - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -pub async fn repo_list_tags( - configuration: &configuration::Configuration, - owner: &str, - repo: &str, - page: Option, - limit: Option, -) -> Result, Error> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_owner = owner; - let p_path_repo = repo; - let p_query_page = page; - let p_query_limit = limit; - - let uri_str = format!( - "{}/repos/{owner}/{repo}/tags", - configuration.base_path, - owner = crate::apis::urlencode(p_path_owner), - repo = crate::apis::urlencode(p_path_repo) - ); - let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); - - if let Some(ref param_value) = p_query_page { - req_builder = req_builder.query(&[("page", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_limit { - req_builder = req_builder.query(&[("limit", ¶m_value.to_string())]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("access_token", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("sudo", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("token", value)]); - } - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("X-FORGEJO-OTP", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Authorization", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Sudo", value); - }; - if let Some(ref auth_conf) = configuration.basic_auth { - req_builder = req_builder.basic_auth(auth_conf.0.to_owned(), auth_conf.1.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `Vec<models::Tag>`"))), - ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `Vec<models::Tag>`")))), - } - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -pub async fn repo_list_teams( - configuration: &configuration::Configuration, - owner: &str, - repo: &str, -) -> Result, Error> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_owner = owner; - let p_path_repo = repo; - - let uri_str = format!( - "{}/repos/{owner}/{repo}/teams", - configuration.base_path, - owner = crate::apis::urlencode(p_path_owner), - repo = crate::apis::urlencode(p_path_repo) - ); - let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); - - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("access_token", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("sudo", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("token", value)]); - } - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("X-FORGEJO-OTP", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Authorization", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Sudo", value); - }; - if let Some(ref auth_conf) = configuration.basic_auth { - req_builder = req_builder.basic_auth(auth_conf.0.to_owned(), auth_conf.1.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `Vec<models::Team>`"))), - ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `Vec<models::Team>`")))), - } - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -pub async fn repo_list_topics( - configuration: &configuration::Configuration, - owner: &str, - repo: &str, - page: Option, - limit: Option, -) -> Result> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_owner = owner; - let p_path_repo = repo; - let p_query_page = page; - let p_query_limit = limit; - - let uri_str = format!( - "{}/repos/{owner}/{repo}/topics", - configuration.base_path, - owner = crate::apis::urlencode(p_path_owner), - repo = crate::apis::urlencode(p_path_repo) - ); - let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); - - if let Some(ref param_value) = p_query_page { - req_builder = req_builder.query(&[("page", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_limit { - req_builder = req_builder.query(&[("limit", ¶m_value.to_string())]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("access_token", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("sudo", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("token", value)]); - } - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("X-FORGEJO-OTP", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Authorization", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Sudo", value); - }; - if let Some(ref auth_conf) = configuration.basic_auth { - req_builder = req_builder.basic_auth(auth_conf.0.to_owned(), auth_conf.1.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::TopicName`"))), - ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::TopicName`")))), - } - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -pub async fn repo_merge_pull_request( - configuration: &configuration::Configuration, - owner: &str, - repo: &str, - index: i64, - body: Option, -) -> Result<(), Error> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_owner = owner; - let p_path_repo = repo; - let p_path_index = index; - let p_body_body = body; - - let uri_str = format!( - "{}/repos/{owner}/{repo}/pulls/{index}/merge", - configuration.base_path, - owner = crate::apis::urlencode(p_path_owner), - repo = crate::apis::urlencode(p_path_repo), - index = p_path_index - ); - let mut req_builder = configuration - .client - .request(reqwest::Method::POST, &uri_str); - - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("access_token", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("sudo", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("token", value)]); - } - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("X-FORGEJO-OTP", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Authorization", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Sudo", value); - }; - if let Some(ref auth_conf) = configuration.basic_auth { - req_builder = req_builder.basic_auth(auth_conf.0.to_owned(), auth_conf.1.to_owned()); - }; - req_builder = req_builder.json(&p_body_body); - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - - if !status.is_client_error() && !status.is_server_error() { - Ok(()) - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -pub async fn repo_migrate( - configuration: &configuration::Configuration, - body: Option, -) -> Result> { - // add a prefix to parameters to efficiently prevent name collisions - let p_body_body = body; - - let uri_str = format!("{}/repos/migrate", configuration.base_path); - let mut req_builder = configuration - .client - .request(reqwest::Method::POST, &uri_str); - - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("access_token", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("sudo", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("token", value)]); - } - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("X-FORGEJO-OTP", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Authorization", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Sudo", value); - }; - if let Some(ref auth_conf) = configuration.basic_auth { - req_builder = req_builder.basic_auth(auth_conf.0.to_owned(), auth_conf.1.to_owned()); - }; - req_builder = req_builder.json(&p_body_body); - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::Repository`"))), - ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::Repository`")))), - } - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -pub async fn repo_mirror_sync( - configuration: &configuration::Configuration, - owner: &str, - repo: &str, -) -> Result<(), Error> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_owner = owner; - let p_path_repo = repo; - - let uri_str = format!( - "{}/repos/{owner}/{repo}/mirror-sync", - configuration.base_path, - owner = crate::apis::urlencode(p_path_owner), - repo = crate::apis::urlencode(p_path_repo) - ); - let mut req_builder = configuration - .client - .request(reqwest::Method::POST, &uri_str); - - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("access_token", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("sudo", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("token", value)]); - } - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("X-FORGEJO-OTP", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Authorization", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Sudo", value); - }; - if let Some(ref auth_conf) = configuration.basic_auth { - req_builder = req_builder.basic_auth(auth_conf.0.to_owned(), auth_conf.1.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - - if !status.is_client_error() && !status.is_server_error() { - Ok(()) - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -pub async fn repo_new_pin_allowed( - configuration: &configuration::Configuration, - owner: &str, - repo: &str, -) -> Result> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_owner = owner; - let p_path_repo = repo; - - let uri_str = format!( - "{}/repos/{owner}/{repo}/new_pin_allowed", - configuration.base_path, - owner = crate::apis::urlencode(p_path_owner), - repo = crate::apis::urlencode(p_path_repo) - ); - let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); - - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("access_token", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("sudo", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("token", value)]); - } - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("X-FORGEJO-OTP", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Authorization", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Sudo", value); - }; - if let Some(ref auth_conf) = configuration.basic_auth { - req_builder = req_builder.basic_auth(auth_conf.0.to_owned(), auth_conf.1.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::NewIssuePinsAllowed`"))), - ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::NewIssuePinsAllowed`")))), - } - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -pub async fn repo_pull_request_is_merged( - configuration: &configuration::Configuration, - owner: &str, - repo: &str, - index: i64, -) -> Result<(), Error> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_owner = owner; - let p_path_repo = repo; - let p_path_index = index; - - let uri_str = format!( - "{}/repos/{owner}/{repo}/pulls/{index}/merge", - configuration.base_path, - owner = crate::apis::urlencode(p_path_owner), - repo = crate::apis::urlencode(p_path_repo), - index = p_path_index - ); - let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); - - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("access_token", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("sudo", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("token", value)]); - } - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("X-FORGEJO-OTP", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Authorization", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Sudo", value); - }; - if let Some(ref auth_conf) = configuration.basic_auth { - req_builder = req_builder.basic_auth(auth_conf.0.to_owned(), auth_conf.1.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - - if !status.is_client_error() && !status.is_server_error() { - Ok(()) - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -pub async fn repo_push_mirror_sync( - configuration: &configuration::Configuration, - owner: &str, - repo: &str, -) -> Result<(), Error> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_owner = owner; - let p_path_repo = repo; - - let uri_str = format!( - "{}/repos/{owner}/{repo}/push_mirrors-sync", - configuration.base_path, - owner = crate::apis::urlencode(p_path_owner), - repo = crate::apis::urlencode(p_path_repo) - ); - let mut req_builder = configuration - .client - .request(reqwest::Method::POST, &uri_str); - - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("access_token", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("sudo", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("token", value)]); - } - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("X-FORGEJO-OTP", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Authorization", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Sudo", value); - }; - if let Some(ref auth_conf) = configuration.basic_auth { - req_builder = req_builder.basic_auth(auth_conf.0.to_owned(), auth_conf.1.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - - if !status.is_client_error() && !status.is_server_error() { - Ok(()) - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -pub async fn repo_remove_note( - configuration: &configuration::Configuration, - owner: &str, - repo: &str, - sha: &str, -) -> Result<(), Error> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_owner = owner; - let p_path_repo = repo; - let p_path_sha = sha; - - let uri_str = format!( - "{}/repos/{owner}/{repo}/git/notes/{sha}", - configuration.base_path, - owner = crate::apis::urlencode(p_path_owner), - repo = crate::apis::urlencode(p_path_repo), - sha = crate::apis::urlencode(p_path_sha) - ); - let mut req_builder = configuration - .client - .request(reqwest::Method::DELETE, &uri_str); - - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("access_token", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("sudo", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("token", value)]); - } - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("X-FORGEJO-OTP", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Authorization", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Sudo", value); - }; - if let Some(ref auth_conf) = configuration.basic_auth { - req_builder = req_builder.basic_auth(auth_conf.0.to_owned(), auth_conf.1.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - - if !status.is_client_error() && !status.is_server_error() { - Ok(()) - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -pub async fn repo_replace_all_flags( - configuration: &configuration::Configuration, - owner: &str, - repo: &str, - body: Option, -) -> Result<(), Error> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_owner = owner; - let p_path_repo = repo; - let p_body_body = body; - - let uri_str = format!( - "{}/repos/{owner}/{repo}/flags", - configuration.base_path, - owner = crate::apis::urlencode(p_path_owner), - repo = crate::apis::urlencode(p_path_repo) - ); - let mut req_builder = configuration.client.request(reqwest::Method::PUT, &uri_str); - - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("access_token", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("sudo", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("token", value)]); - } - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("X-FORGEJO-OTP", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Authorization", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Sudo", value); - }; - if let Some(ref auth_conf) = configuration.basic_auth { - req_builder = req_builder.basic_auth(auth_conf.0.to_owned(), auth_conf.1.to_owned()); - }; - req_builder = req_builder.json(&p_body_body); - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - - if !status.is_client_error() && !status.is_server_error() { - Ok(()) - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -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> { - // add a prefix to parameters to efficiently prevent name collisions - let p_query_q = q; - let p_query_topic = topic; - let p_query_include_desc = include_desc; - let p_query_uid = uid; - let p_query_priority_owner_id = priority_owner_id; - let p_query_team_id = team_id; - let p_query_starred_by = starred_by; - let p_query_private = private; - let p_query_is_private = is_private; - let p_query_template = template; - let p_query_archived = archived; - let p_query_mode = mode; - let p_query_exclusive = exclusive; - let p_query_sort = sort; - let p_query_order = order; - let p_query_page = page; - let p_query_limit = limit; - - let uri_str = format!("{}/repos/search", configuration.base_path); - let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); - - if let Some(ref param_value) = p_query_q { - req_builder = req_builder.query(&[("q", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_topic { - req_builder = req_builder.query(&[("topic", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_include_desc { - req_builder = req_builder.query(&[("includeDesc", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_uid { - req_builder = req_builder.query(&[("uid", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_priority_owner_id { - req_builder = req_builder.query(&[("priority_owner_id", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_team_id { - req_builder = req_builder.query(&[("team_id", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_starred_by { - req_builder = req_builder.query(&[("starredBy", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_private { - req_builder = req_builder.query(&[("private", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_is_private { - req_builder = req_builder.query(&[("is_private", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_template { - req_builder = req_builder.query(&[("template", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_archived { - req_builder = req_builder.query(&[("archived", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_mode { - req_builder = req_builder.query(&[("mode", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_exclusive { - req_builder = req_builder.query(&[("exclusive", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_sort { - req_builder = req_builder.query(&[("sort", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_order { - req_builder = req_builder.query(&[("order", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_page { - req_builder = req_builder.query(&[("page", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_limit { - req_builder = req_builder.query(&[("limit", ¶m_value.to_string())]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("access_token", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("sudo", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("token", value)]); - } - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("X-FORGEJO-OTP", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Authorization", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Sudo", value); - }; - if let Some(ref auth_conf) = configuration.basic_auth { - req_builder = req_builder.basic_auth(auth_conf.0.to_owned(), auth_conf.1.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::SearchResults`"))), - ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::SearchResults`")))), - } - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -pub async fn repo_search_run_jobs( - configuration: &configuration::Configuration, - owner: &str, - repo: &str, - labels: Option<&str>, -) -> Result, Error> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_owner = owner; - let p_path_repo = repo; - let p_query_labels = labels; - - let uri_str = format!( - "{}/repos/{owner}/{repo}/actions/runners/jobs", - configuration.base_path, - owner = crate::apis::urlencode(p_path_owner), - repo = crate::apis::urlencode(p_path_repo) - ); - let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); - - if let Some(ref param_value) = p_query_labels { - req_builder = req_builder.query(&[("labels", ¶m_value.to_string())]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("access_token", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("sudo", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("token", value)]); - } - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("X-FORGEJO-OTP", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Authorization", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Sudo", value); - }; - if let Some(ref auth_conf) = configuration.basic_auth { - req_builder = req_builder.basic_auth(auth_conf.0.to_owned(), auth_conf.1.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `Vec<models::ActionRunJob>`"))), - ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `Vec<models::ActionRunJob>`")))), - } - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -pub async fn repo_set_note( - configuration: &configuration::Configuration, - owner: &str, - repo: &str, - sha: &str, - body: Option, -) -> Result> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_owner = owner; - let p_path_repo = repo; - let p_path_sha = sha; - let p_body_body = body; - - let uri_str = format!( - "{}/repos/{owner}/{repo}/git/notes/{sha}", - configuration.base_path, - owner = crate::apis::urlencode(p_path_owner), - repo = crate::apis::urlencode(p_path_repo), - sha = crate::apis::urlencode(p_path_sha) - ); - let mut req_builder = configuration - .client - .request(reqwest::Method::POST, &uri_str); - - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("access_token", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("sudo", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("token", value)]); - } - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("X-FORGEJO-OTP", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Authorization", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Sudo", value); - }; - if let Some(ref auth_conf) = configuration.basic_auth { - req_builder = req_builder.basic_auth(auth_conf.0.to_owned(), auth_conf.1.to_owned()); - }; - req_builder = req_builder.json(&p_body_body); - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::Note`"))), - ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::Note`")))), - } - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -pub async fn repo_signing_key( - configuration: &configuration::Configuration, - owner: &str, - repo: &str, -) -> Result> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_owner = owner; - let p_path_repo = repo; - - let uri_str = format!( - "{}/repos/{owner}/{repo}/signing-key.gpg", - configuration.base_path, - owner = crate::apis::urlencode(p_path_owner), - repo = crate::apis::urlencode(p_path_repo) - ); - let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); - - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("access_token", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("sudo", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("token", value)]); - } - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("X-FORGEJO-OTP", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Authorization", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Sudo", value); - }; - if let Some(ref auth_conf) = configuration.basic_auth { - req_builder = req_builder.basic_auth(auth_conf.0.to_owned(), auth_conf.1.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => return Ok(content), - ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `String`")))), - } - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -pub async fn repo_submit_pull_review( - configuration: &configuration::Configuration, - owner: &str, - repo: &str, - index: i64, - id: i64, - body: models::SubmitPullReviewOptions, -) -> Result> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_owner = owner; - let p_path_repo = repo; - let p_path_index = index; - let p_path_id = id; - let p_body_body = body; - - let uri_str = format!( - "{}/repos/{owner}/{repo}/pulls/{index}/reviews/{id}", - configuration.base_path, - owner = crate::apis::urlencode(p_path_owner), - repo = crate::apis::urlencode(p_path_repo), - index = p_path_index, - id = p_path_id - ); - let mut req_builder = configuration - .client - .request(reqwest::Method::POST, &uri_str); - - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("access_token", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("sudo", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("token", value)]); - } - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("X-FORGEJO-OTP", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Authorization", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Sudo", value); - }; - if let Some(ref auth_conf) = configuration.basic_auth { - req_builder = req_builder.basic_auth(auth_conf.0.to_owned(), auth_conf.1.to_owned()); - }; - req_builder = req_builder.json(&p_body_body); - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::PullReview`"))), - ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::PullReview`")))), - } - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -pub async fn repo_sync_fork_branch( - configuration: &configuration::Configuration, - owner: &str, - repo: &str, - branch: &str, -) -> Result<(), Error> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_owner = owner; - let p_path_repo = repo; - let p_path_branch = branch; - - let uri_str = format!( - "{}/repos/{owner}/{repo}/sync_fork/{branch}", - configuration.base_path, - owner = crate::apis::urlencode(p_path_owner), - repo = crate::apis::urlencode(p_path_repo), - branch = crate::apis::urlencode(p_path_branch) - ); - let mut req_builder = configuration - .client - .request(reqwest::Method::POST, &uri_str); - - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("access_token", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("sudo", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("token", value)]); - } - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("X-FORGEJO-OTP", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Authorization", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Sudo", value); - }; - if let Some(ref auth_conf) = configuration.basic_auth { - req_builder = req_builder.basic_auth(auth_conf.0.to_owned(), auth_conf.1.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - - if !status.is_client_error() && !status.is_server_error() { - Ok(()) - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -pub async fn repo_sync_fork_branch_info( - configuration: &configuration::Configuration, - owner: &str, - repo: &str, - branch: &str, -) -> Result> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_owner = owner; - let p_path_repo = repo; - let p_path_branch = branch; - - let uri_str = format!( - "{}/repos/{owner}/{repo}/sync_fork/{branch}", - configuration.base_path, - owner = crate::apis::urlencode(p_path_owner), - repo = crate::apis::urlencode(p_path_repo), - branch = crate::apis::urlencode(p_path_branch) - ); - let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); - - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("access_token", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("sudo", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("token", value)]); - } - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("X-FORGEJO-OTP", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Authorization", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Sudo", value); - }; - if let Some(ref auth_conf) = configuration.basic_auth { - req_builder = req_builder.basic_auth(auth_conf.0.to_owned(), auth_conf.1.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::SyncForkInfo`"))), - ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::SyncForkInfo`")))), - } - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -pub async fn repo_sync_fork_default( - configuration: &configuration::Configuration, - owner: &str, - repo: &str, -) -> Result<(), Error> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_owner = owner; - let p_path_repo = repo; - - let uri_str = format!( - "{}/repos/{owner}/{repo}/sync_fork", - configuration.base_path, - owner = crate::apis::urlencode(p_path_owner), - repo = crate::apis::urlencode(p_path_repo) - ); - let mut req_builder = configuration - .client - .request(reqwest::Method::POST, &uri_str); - - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("access_token", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("sudo", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("token", value)]); - } - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("X-FORGEJO-OTP", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Authorization", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Sudo", value); - }; - if let Some(ref auth_conf) = configuration.basic_auth { - req_builder = req_builder.basic_auth(auth_conf.0.to_owned(), auth_conf.1.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - - if !status.is_client_error() && !status.is_server_error() { - Ok(()) - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -pub async fn repo_sync_fork_default_info( - configuration: &configuration::Configuration, - owner: &str, - repo: &str, -) -> Result> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_owner = owner; - let p_path_repo = repo; - - let uri_str = format!( - "{}/repos/{owner}/{repo}/sync_fork", - configuration.base_path, - owner = crate::apis::urlencode(p_path_owner), - repo = crate::apis::urlencode(p_path_repo) - ); - let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); - - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("access_token", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("sudo", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("token", value)]); - } - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("X-FORGEJO-OTP", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Authorization", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Sudo", value); - }; - if let Some(ref auth_conf) = configuration.basic_auth { - req_builder = req_builder.basic_auth(auth_conf.0.to_owned(), auth_conf.1.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::SyncForkInfo`"))), - ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::SyncForkInfo`")))), - } - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -pub async fn repo_test_hook( - configuration: &configuration::Configuration, - owner: &str, - repo: &str, - id: i64, - r#ref: Option<&str>, -) -> Result<(), Error> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_owner = owner; - let p_path_repo = repo; - let p_path_id = id; - let p_query_ref = r#ref; - - let uri_str = format!( - "{}/repos/{owner}/{repo}/hooks/{id}/tests", - configuration.base_path, - owner = crate::apis::urlencode(p_path_owner), - repo = crate::apis::urlencode(p_path_repo), - id = p_path_id - ); - let mut req_builder = configuration - .client - .request(reqwest::Method::POST, &uri_str); - - if let Some(ref param_value) = p_query_ref { - req_builder = req_builder.query(&[("ref", ¶m_value.to_string())]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("access_token", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("sudo", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("token", value)]); - } - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("X-FORGEJO-OTP", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Authorization", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Sudo", value); - }; - if let Some(ref auth_conf) = configuration.basic_auth { - req_builder = req_builder.basic_auth(auth_conf.0.to_owned(), auth_conf.1.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - - if !status.is_client_error() && !status.is_server_error() { - Ok(()) - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -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> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_owner = owner; - let p_path_repo = repo; - let p_query_user = user; - let p_query_since = since; - let p_query_before = before; - let p_query_page = page; - let p_query_limit = limit; - - let uri_str = format!( - "{}/repos/{owner}/{repo}/times", - configuration.base_path, - owner = crate::apis::urlencode(p_path_owner), - repo = crate::apis::urlencode(p_path_repo) - ); - let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); - - if let Some(ref param_value) = p_query_user { - req_builder = req_builder.query(&[("user", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_since { - req_builder = req_builder.query(&[("since", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_before { - req_builder = req_builder.query(&[("before", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_page { - req_builder = req_builder.query(&[("page", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_limit { - req_builder = req_builder.query(&[("limit", ¶m_value.to_string())]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("access_token", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("sudo", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("token", value)]); - } - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("X-FORGEJO-OTP", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Authorization", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Sudo", value); - }; - if let Some(ref auth_conf) = configuration.basic_auth { - req_builder = req_builder.basic_auth(auth_conf.0.to_owned(), auth_conf.1.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `Vec<models::TrackedTime>`"))), - ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `Vec<models::TrackedTime>`")))), - } - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -pub async fn repo_transfer( - configuration: &configuration::Configuration, - owner: &str, - repo: &str, - body: models::TransferRepoOption, -) -> Result> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_owner = owner; - let p_path_repo = repo; - let p_body_body = body; - - let uri_str = format!( - "{}/repos/{owner}/{repo}/transfer", - configuration.base_path, - owner = crate::apis::urlencode(p_path_owner), - repo = crate::apis::urlencode(p_path_repo) - ); - let mut req_builder = configuration - .client - .request(reqwest::Method::POST, &uri_str); - - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("access_token", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("sudo", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("token", value)]); - } - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("X-FORGEJO-OTP", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Authorization", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Sudo", value); - }; - if let Some(ref auth_conf) = configuration.basic_auth { - req_builder = req_builder.basic_auth(auth_conf.0.to_owned(), auth_conf.1.to_owned()); - }; - req_builder = req_builder.json(&p_body_body); - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::Repository`"))), - ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::Repository`")))), - } - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -pub async fn repo_un_dismiss_pull_review( - configuration: &configuration::Configuration, - owner: &str, - repo: &str, - index: i64, - id: i64, -) -> Result> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_owner = owner; - let p_path_repo = repo; - let p_path_index = index; - let p_path_id = id; - - let uri_str = format!( - "{}/repos/{owner}/{repo}/pulls/{index}/reviews/{id}/undismissals", - configuration.base_path, - owner = crate::apis::urlencode(p_path_owner), - repo = crate::apis::urlencode(p_path_repo), - index = p_path_index, - id = p_path_id - ); - let mut req_builder = configuration - .client - .request(reqwest::Method::POST, &uri_str); - - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("access_token", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("sudo", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("token", value)]); - } - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("X-FORGEJO-OTP", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Authorization", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Sudo", value); - }; - if let Some(ref auth_conf) = configuration.basic_auth { - req_builder = req_builder.basic_auth(auth_conf.0.to_owned(), auth_conf.1.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::PullReview`"))), - ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::PullReview`")))), - } - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -pub async fn repo_update_avatar( - configuration: &configuration::Configuration, - owner: &str, - repo: &str, - body: Option, -) -> Result<(), Error> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_owner = owner; - let p_path_repo = repo; - let p_body_body = body; - - let uri_str = format!( - "{}/repos/{owner}/{repo}/avatar", - configuration.base_path, - owner = crate::apis::urlencode(p_path_owner), - repo = crate::apis::urlencode(p_path_repo) - ); - let mut req_builder = configuration - .client - .request(reqwest::Method::POST, &uri_str); - - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("access_token", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("sudo", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("token", value)]); - } - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("X-FORGEJO-OTP", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Authorization", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Sudo", value); - }; - if let Some(ref auth_conf) = configuration.basic_auth { - req_builder = req_builder.basic_auth(auth_conf.0.to_owned(), auth_conf.1.to_owned()); - }; - req_builder = req_builder.json(&p_body_body); - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - - if !status.is_client_error() && !status.is_server_error() { - Ok(()) - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -pub async fn repo_update_branch( - configuration: &configuration::Configuration, - owner: &str, - repo: &str, - branch: &str, - body: Option, -) -> Result<(), Error> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_owner = owner; - let p_path_repo = repo; - let p_path_branch = branch; - let p_body_body = body; - - let uri_str = format!( - "{}/repos/{owner}/{repo}/branches/{branch}", - configuration.base_path, - owner = crate::apis::urlencode(p_path_owner), - repo = crate::apis::urlencode(p_path_repo), - branch = crate::apis::urlencode(p_path_branch) - ); - let mut req_builder = configuration - .client - .request(reqwest::Method::PATCH, &uri_str); - - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("access_token", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("sudo", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("token", value)]); - } - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("X-FORGEJO-OTP", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Authorization", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Sudo", value); - }; - if let Some(ref auth_conf) = configuration.basic_auth { - req_builder = req_builder.basic_auth(auth_conf.0.to_owned(), auth_conf.1.to_owned()); - }; - req_builder = req_builder.json(&p_body_body); - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - - if !status.is_client_error() && !status.is_server_error() { - Ok(()) - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -pub async fn repo_update_file( - configuration: &configuration::Configuration, - owner: &str, - repo: &str, - filepath: &str, - body: models::UpdateFileOptions, -) -> Result> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_owner = owner; - let p_path_repo = repo; - let p_path_filepath = filepath; - let p_body_body = body; - - let uri_str = format!( - "{}/repos/{owner}/{repo}/contents/{filepath}", - configuration.base_path, - owner = crate::apis::urlencode(p_path_owner), - repo = crate::apis::urlencode(p_path_repo), - filepath = crate::apis::urlencode(p_path_filepath) - ); - let mut req_builder = configuration.client.request(reqwest::Method::PUT, &uri_str); - - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("access_token", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("sudo", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("token", value)]); - } - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("X-FORGEJO-OTP", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Authorization", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Sudo", value); - }; - if let Some(ref auth_conf) = configuration.basic_auth { - req_builder = req_builder.basic_auth(auth_conf.0.to_owned(), auth_conf.1.to_owned()); - }; - req_builder = req_builder.json(&p_body_body); - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::FileResponse`"))), - ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::FileResponse`")))), - } - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -pub async fn repo_update_pull_request( - configuration: &configuration::Configuration, - owner: &str, - repo: &str, - index: i64, - style: Option<&str>, -) -> Result<(), Error> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_owner = owner; - let p_path_repo = repo; - let p_path_index = index; - let p_query_style = style; - - let uri_str = format!( - "{}/repos/{owner}/{repo}/pulls/{index}/update", - configuration.base_path, - owner = crate::apis::urlencode(p_path_owner), - repo = crate::apis::urlencode(p_path_repo), - index = p_path_index - ); - let mut req_builder = configuration - .client - .request(reqwest::Method::POST, &uri_str); - - if let Some(ref param_value) = p_query_style { - req_builder = req_builder.query(&[("style", ¶m_value.to_string())]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("access_token", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("sudo", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("token", value)]); - } - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("X-FORGEJO-OTP", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Authorization", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Sudo", value); - }; - if let Some(ref auth_conf) = configuration.basic_auth { - req_builder = req_builder.basic_auth(auth_conf.0.to_owned(), auth_conf.1.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - - if !status.is_client_error() && !status.is_server_error() { - Ok(()) - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -pub async fn repo_update_topics( - configuration: &configuration::Configuration, - owner: &str, - repo: &str, - body: Option, -) -> Result<(), Error> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_owner = owner; - let p_path_repo = repo; - let p_body_body = body; - - let uri_str = format!( - "{}/repos/{owner}/{repo}/topics", - configuration.base_path, - owner = crate::apis::urlencode(p_path_owner), - repo = crate::apis::urlencode(p_path_repo) - ); - let mut req_builder = configuration.client.request(reqwest::Method::PUT, &uri_str); - - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("access_token", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("sudo", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("token", value)]); - } - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("X-FORGEJO-OTP", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Authorization", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Sudo", value); - }; - if let Some(ref auth_conf) = configuration.basic_auth { - req_builder = req_builder.basic_auth(auth_conf.0.to_owned(), auth_conf.1.to_owned()); - }; - req_builder = req_builder.json(&p_body_body); - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - - if !status.is_client_error() && !status.is_server_error() { - Ok(()) - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -pub async fn repo_validate_issue_config( - configuration: &configuration::Configuration, - owner: &str, - repo: &str, -) -> Result> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_owner = owner; - let p_path_repo = repo; - - let uri_str = format!( - "{}/repos/{owner}/{repo}/issue_config/validate", - configuration.base_path, - owner = crate::apis::urlencode(p_path_owner), - repo = crate::apis::urlencode(p_path_repo) - ); - let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); - - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("access_token", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("sudo", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("token", value)]); - } - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("X-FORGEJO-OTP", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Authorization", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Sudo", value); - }; - if let Some(ref auth_conf) = configuration.basic_auth { - req_builder = req_builder.basic_auth(auth_conf.0.to_owned(), auth_conf.1.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::IssueConfigValidation`"))), - ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::IssueConfigValidation`")))), - } - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -pub async fn topic_search( - configuration: &configuration::Configuration, - q: &str, - page: Option, - limit: Option, -) -> Result> { - // add a prefix to parameters to efficiently prevent name collisions - let p_query_q = q; - let p_query_page = page; - let p_query_limit = limit; - - let uri_str = format!("{}/topics/search", configuration.base_path); - let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); - - req_builder = req_builder.query(&[("q", &p_query_q.to_string())]); - if let Some(ref param_value) = p_query_page { - req_builder = req_builder.query(&[("page", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_limit { - req_builder = req_builder.query(&[("limit", ¶m_value.to_string())]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("access_token", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("sudo", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("token", value)]); - } - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("X-FORGEJO-OTP", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Authorization", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Sudo", value); - }; - if let Some(ref auth_conf) = configuration.basic_auth { - req_builder = req_builder.basic_auth(auth_conf.0.to_owned(), auth_conf.1.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::TopicSearchResults`"))), - ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::TopicSearchResults`")))), - } - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -pub async fn update_repo_secret( - configuration: &configuration::Configuration, - owner: &str, - repo: &str, - secretname: &str, - body: Option, -) -> Result<(), Error> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_owner = owner; - let p_path_repo = repo; - let p_path_secretname = secretname; - let p_body_body = body; - - let uri_str = format!( - "{}/repos/{owner}/{repo}/actions/secrets/{secretname}", - configuration.base_path, - owner = crate::apis::urlencode(p_path_owner), - repo = crate::apis::urlencode(p_path_repo), - secretname = crate::apis::urlencode(p_path_secretname) - ); - let mut req_builder = configuration.client.request(reqwest::Method::PUT, &uri_str); - - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("access_token", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("sudo", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("token", value)]); - } - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("X-FORGEJO-OTP", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Authorization", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Sudo", value); - }; - if let Some(ref auth_conf) = configuration.basic_auth { - req_builder = req_builder.basic_auth(auth_conf.0.to_owned(), auth_conf.1.to_owned()); - }; - req_builder = req_builder.json(&p_body_body); - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - - if !status.is_client_error() && !status.is_server_error() { - Ok(()) - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -pub async fn update_repo_variable( - configuration: &configuration::Configuration, - owner: &str, - repo: &str, - variablename: &str, - body: Option, -) -> Result<(), Error> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_owner = owner; - let p_path_repo = repo; - let p_path_variablename = variablename; - let p_body_body = body; - - let uri_str = format!( - "{}/repos/{owner}/{repo}/actions/variables/{variablename}", - configuration.base_path, - owner = crate::apis::urlencode(p_path_owner), - repo = crate::apis::urlencode(p_path_repo), - variablename = crate::apis::urlencode(p_path_variablename) - ); - let mut req_builder = configuration.client.request(reqwest::Method::PUT, &uri_str); - - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("access_token", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("sudo", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("token", value)]); - } - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("X-FORGEJO-OTP", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Authorization", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Sudo", value); - }; - if let Some(ref auth_conf) = configuration.basic_auth { - req_builder = req_builder.basic_auth(auth_conf.0.to_owned(), auth_conf.1.to_owned()); - }; - req_builder = req_builder.json(&p_body_body); - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - - if !status.is_client_error() && !status.is_server_error() { - Ok(()) - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -pub async fn user_current_check_subscription( - configuration: &configuration::Configuration, - owner: &str, - repo: &str, -) -> Result> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_owner = owner; - let p_path_repo = repo; - - let uri_str = format!( - "{}/repos/{owner}/{repo}/subscription", - configuration.base_path, - owner = crate::apis::urlencode(p_path_owner), - repo = crate::apis::urlencode(p_path_repo) - ); - let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); - - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("access_token", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("sudo", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("token", value)]); - } - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("X-FORGEJO-OTP", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Authorization", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Sudo", value); - }; - if let Some(ref auth_conf) = configuration.basic_auth { - req_builder = req_builder.basic_auth(auth_conf.0.to_owned(), auth_conf.1.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::WatchInfo`"))), - ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::WatchInfo`")))), - } - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -pub async fn user_current_delete_subscription( - configuration: &configuration::Configuration, - owner: &str, - repo: &str, -) -> Result<(), Error> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_owner = owner; - let p_path_repo = repo; - - let uri_str = format!( - "{}/repos/{owner}/{repo}/subscription", - configuration.base_path, - owner = crate::apis::urlencode(p_path_owner), - repo = crate::apis::urlencode(p_path_repo) - ); - let mut req_builder = configuration - .client - .request(reqwest::Method::DELETE, &uri_str); - - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("access_token", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("sudo", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("token", value)]); - } - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("X-FORGEJO-OTP", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Authorization", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Sudo", value); - }; - if let Some(ref auth_conf) = configuration.basic_auth { - req_builder = req_builder.basic_auth(auth_conf.0.to_owned(), auth_conf.1.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - - if !status.is_client_error() && !status.is_server_error() { - Ok(()) - } else { - let content = resp.text().await?; - let entity: Option = - serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -pub async fn user_current_put_subscription( - configuration: &configuration::Configuration, - owner: &str, - repo: &str, -) -> Result> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_owner = owner; - let p_path_repo = repo; - - let uri_str = format!( - "{}/repos/{owner}/{repo}/subscription", - configuration.base_path, - owner = crate::apis::urlencode(p_path_owner), - repo = crate::apis::urlencode(p_path_repo) - ); - let mut req_builder = configuration.client.request(reqwest::Method::PUT, &uri_str); - - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("access_token", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("sudo", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("token", value)]); - } - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("X-FORGEJO-OTP", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Authorization", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Sudo", value); - }; - if let Some(ref auth_conf) = configuration.basic_auth { - req_builder = req_builder.basic_auth(auth_conf.0.to_owned(), auth_conf.1.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::WatchInfo`"))), - ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::WatchInfo`")))), - } - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -#[deprecated] -pub async fn user_tracked_times( - configuration: &configuration::Configuration, - owner: &str, - repo: &str, - user: &str, -) -> Result, Error> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_owner = owner; - let p_path_repo = repo; - let p_path_user = user; - - let uri_str = format!( - "{}/repos/{owner}/{repo}/times/{user}", - configuration.base_path, - owner = crate::apis::urlencode(p_path_owner), - repo = crate::apis::urlencode(p_path_repo), - user = crate::apis::urlencode(p_path_user) - ); - let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); - - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("access_token", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("sudo", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("token", value)]); - } - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("X-FORGEJO-OTP", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Authorization", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Sudo", value); - }; - if let Some(ref auth_conf) = configuration.basic_auth { - req_builder = req_builder.basic_auth(auth_conf.0.to_owned(), auth_conf.1.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `Vec<models::TrackedTime>`"))), - ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `Vec<models::TrackedTime>`")))), - } - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} diff --git a/src/apis/settings_api.rs b/src/apis/settings_api.rs deleted file mode 100644 index 3669504..0000000 --- a/src/apis/settings_api.rs +++ /dev/null @@ -1,402 +0,0 @@ -/* - * Forgejo API - * - * This documentation describes the Forgejo API. - * - * The version of the OpenAPI document: 14.0.2-2-84240ce3a2+gitea-1.22.0 - * - * Generated by: https://openapi-generator.tech - */ - -use super::{configuration, ContentType, Error}; -use crate::{apis::ResponseContent, models}; -use reqwest; -use serde::{de::Error as _, Deserialize, Serialize}; - -/// 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 uri_str = format!("{}/settings/api", configuration.base_path); - let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); - - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("access_token", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("sudo", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("token", value)]); - } - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("X-FORGEJO-OTP", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Authorization", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Sudo", value); - }; - if let Some(ref auth_conf) = configuration.basic_auth { - req_builder = req_builder.basic_auth(auth_conf.0.to_owned(), auth_conf.1.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::GeneralApiSettings`"))), - ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::GeneralApiSettings`")))), - } - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -pub async fn get_general_attachment_settings( - configuration: &configuration::Configuration, -) -> Result> { - let uri_str = format!("{}/settings/attachment", configuration.base_path); - let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); - - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("access_token", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("sudo", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("token", value)]); - } - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("X-FORGEJO-OTP", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Authorization", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Sudo", value); - }; - if let Some(ref auth_conf) = configuration.basic_auth { - req_builder = req_builder.basic_auth(auth_conf.0.to_owned(), auth_conf.1.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::GeneralAttachmentSettings`"))), - ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::GeneralAttachmentSettings`")))), - } - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -pub async fn get_general_repository_settings( - configuration: &configuration::Configuration, -) -> Result> { - let uri_str = format!("{}/settings/repository", configuration.base_path); - let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); - - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("access_token", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("sudo", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("token", value)]); - } - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("X-FORGEJO-OTP", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Authorization", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Sudo", value); - }; - if let Some(ref auth_conf) = configuration.basic_auth { - req_builder = req_builder.basic_auth(auth_conf.0.to_owned(), auth_conf.1.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::GeneralRepoSettings`"))), - ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::GeneralRepoSettings`")))), - } - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -pub async fn get_general_ui_settings( - configuration: &configuration::Configuration, -) -> Result> { - let uri_str = format!("{}/settings/ui", configuration.base_path); - let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); - - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("access_token", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("sudo", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("token", value)]); - } - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("X-FORGEJO-OTP", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Authorization", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Sudo", value); - }; - if let Some(ref auth_conf) = configuration.basic_auth { - req_builder = req_builder.basic_auth(auth_conf.0.to_owned(), auth_conf.1.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::GeneralUiSettings`"))), - ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::GeneralUiSettings`")))), - } - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} diff --git a/src/apis/user_api.rs b/src/apis/user_api.rs deleted file mode 100644 index 3de1ccb..0000000 --- a/src/apis/user_api.rs +++ /dev/null @@ -1,8031 +0,0 @@ -/* - * Forgejo API - * - * This documentation describes the Forgejo API. - * - * The version of the OpenAPI document: 14.0.2-2-84240ce3a2+gitea-1.22.0 - * - * Generated by: https://openapi-generator.tech - */ - -use super::{configuration, ContentType, Error}; -use crate::{apis::ResponseContent, models}; -use reqwest; -use serde::{de::Error as _, Deserialize, Serialize}; - -/// struct for typed errors of method [`create_current_user_repo`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum CreateCurrentUserRepoError { - Status400(models::ApiError), - Status401(models::ApiUnauthorizedError), - Status403(models::ApiForbiddenError), - Status409(), - Status413(), - Status422(models::ApiValidationError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`create_user_variable`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum CreateUserVariableError { - Status400(models::ApiError), - Status401(models::ApiUnauthorizedError), - Status403(models::ApiForbiddenError), - Status404(models::ApiNotFound), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`delete_user_secret`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum DeleteUserSecretError { - Status400(models::ApiError), - Status401(models::ApiUnauthorizedError), - Status403(models::ApiForbiddenError), - Status404(models::ApiNotFound), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`delete_user_variable`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum DeleteUserVariableError { - Status400(models::ApiError), - Status401(models::ApiUnauthorizedError), - Status403(models::ApiForbiddenError), - Status404(models::ApiNotFound), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`get_user_settings`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum GetUserSettingsError { - Status401(models::ApiUnauthorizedError), - Status403(models::ApiForbiddenError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`get_user_variable`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum GetUserVariableError { - Status400(models::ApiError), - Status401(models::ApiUnauthorizedError), - Status403(models::ApiForbiddenError), - Status404(models::ApiNotFound), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`get_user_variables_list`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum GetUserVariablesListError { - Status400(models::ApiError), - Status401(models::ApiUnauthorizedError), - Status403(models::ApiForbiddenError), - Status404(models::ApiNotFound), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`get_verification_token`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum GetVerificationTokenError { - Status401(models::ApiUnauthorizedError), - Status403(models::ApiForbiddenError), - Status404(models::ApiNotFound), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`update_user_secret`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum UpdateUserSecretError { - Status400(models::ApiError), - Status401(models::ApiUnauthorizedError), - Status403(models::ApiForbiddenError), - Status404(models::ApiNotFound), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`update_user_settings`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum UpdateUserSettingsError { - Status401(models::ApiUnauthorizedError), - Status403(models::ApiForbiddenError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`update_user_variable`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum UpdateUserVariableError { - Status400(models::ApiError), - Status401(models::ApiUnauthorizedError), - Status403(models::ApiForbiddenError), - Status404(models::ApiNotFound), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`user_add_email`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum UserAddEmailError { - Status401(models::ApiUnauthorizedError), - Status403(models::ApiForbiddenError), - Status422(models::ApiValidationError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`user_block_user`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum UserBlockUserError { - Status401(models::ApiUnauthorizedError), - Status403(models::ApiForbiddenError), - Status404(models::ApiNotFound), - Status422(models::ApiValidationError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`user_check_following`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum UserCheckFollowingError { - Status404(models::ApiNotFound), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`user_check_quota`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum UserCheckQuotaError { - Status401(models::ApiUnauthorizedError), - Status403(models::ApiForbiddenError), - Status422(models::ApiValidationError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`user_create_hook`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum UserCreateHookError { - Status401(models::ApiUnauthorizedError), - Status403(models::ApiForbiddenError), - 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(models::ApiError), - Status401(models::ApiUnauthorizedError), - Status403(models::ApiForbiddenError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`user_create_token`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum UserCreateTokenError { - Status400(models::ApiError), - Status403(models::ApiForbiddenError), - Status404(models::ApiNotFound), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`user_current_check_following`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum UserCurrentCheckFollowingError { - Status401(models::ApiUnauthorizedError), - Status403(models::ApiForbiddenError), - Status404(models::ApiNotFound), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`user_current_check_starring`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum UserCurrentCheckStarringError { - Status401(models::ApiUnauthorizedError), - Status403(models::ApiForbiddenError), - Status404(models::ApiNotFound), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`user_current_delete_follow`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum UserCurrentDeleteFollowError { - Status401(models::ApiUnauthorizedError), - Status403(models::ApiForbiddenError), - Status404(models::ApiNotFound), - 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 { - Status401(models::ApiUnauthorizedError), - Status403(models::ApiForbiddenError), - Status404(models::ApiNotFound), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`user_current_delete_key`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum UserCurrentDeleteKeyError { - Status401(models::ApiUnauthorizedError), - Status403(models::ApiForbiddenError), - Status404(models::ApiNotFound), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`user_current_delete_star`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum UserCurrentDeleteStarError { - Status401(models::ApiUnauthorizedError), - Status403(models::ApiForbiddenError), - Status404(models::ApiNotFound), - 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 { - Status401(models::ApiUnauthorizedError), - Status403(models::ApiForbiddenError), - Status404(models::ApiNotFound), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`user_current_get_key`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum UserCurrentGetKeyError { - Status401(models::ApiUnauthorizedError), - Status403(models::ApiForbiddenError), - Status404(models::ApiNotFound), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`user_current_list_followers`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum UserCurrentListFollowersError { - Status401(models::ApiUnauthorizedError), - Status403(models::ApiForbiddenError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`user_current_list_following`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum UserCurrentListFollowingError { - Status401(models::ApiUnauthorizedError), - Status403(models::ApiForbiddenError), - 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 { - Status401(models::ApiUnauthorizedError), - Status403(models::ApiForbiddenError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`user_current_list_keys`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum UserCurrentListKeysError { - Status401(models::ApiUnauthorizedError), - Status403(models::ApiForbiddenError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`user_current_list_repos`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum UserCurrentListReposError { - Status401(models::ApiUnauthorizedError), - Status403(models::ApiForbiddenError), - Status422(models::ApiValidationError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`user_current_list_starred`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum UserCurrentListStarredError { - Status401(models::ApiUnauthorizedError), - Status403(models::ApiForbiddenError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`user_current_list_subscriptions`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum UserCurrentListSubscriptionsError { - Status401(models::ApiUnauthorizedError), - Status403(models::ApiForbiddenError), - 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 { - Status401(models::ApiUnauthorizedError), - Status403(models::ApiForbiddenError), - Status404(models::ApiNotFound), - Status422(models::ApiValidationError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`user_current_post_key`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum UserCurrentPostKeyError { - Status401(models::ApiUnauthorizedError), - Status403(models::ApiForbiddenError), - Status422(models::ApiValidationError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`user_current_put_follow`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum UserCurrentPutFollowError { - Status401(models::ApiUnauthorizedError), - Status403(models::ApiForbiddenError), - Status404(models::ApiNotFound), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`user_current_put_star`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum UserCurrentPutStarError { - Status401(models::ApiUnauthorizedError), - Status403(models::ApiForbiddenError), - Status404(models::ApiNotFound), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`user_current_tracked_times`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum UserCurrentTrackedTimesError { - Status401(models::ApiUnauthorizedError), - Status403(models::ApiForbiddenError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`user_delete_access_token`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum UserDeleteAccessTokenError { - Status403(models::ApiForbiddenError), - Status404(models::ApiNotFound), - Status422(models::ApiError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`user_delete_avatar`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum UserDeleteAvatarError { - Status401(models::ApiUnauthorizedError), - Status403(models::ApiForbiddenError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`user_delete_email`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum UserDeleteEmailError { - Status401(models::ApiUnauthorizedError), - Status403(models::ApiForbiddenError), - Status404(models::ApiNotFound), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`user_delete_hook`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum UserDeleteHookError { - Status401(models::ApiUnauthorizedError), - Status403(models::ApiForbiddenError), - 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 { - Status401(models::ApiUnauthorizedError), - Status403(models::ApiForbiddenError), - Status404(models::ApiNotFound), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`user_edit_hook`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum UserEditHookError { - Status401(models::ApiUnauthorizedError), - Status403(models::ApiForbiddenError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`user_get`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum UserGetError { - Status404(models::ApiNotFound), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`user_get_current`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum UserGetCurrentError { - Status401(models::ApiUnauthorizedError), - Status403(models::ApiForbiddenError), - 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(models::ApiNotFound), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`user_get_hook`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum UserGetHookError { - Status401(models::ApiUnauthorizedError), - Status403(models::ApiForbiddenError), - 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 { - Status401(models::ApiUnauthorizedError), - Status403(models::ApiForbiddenError), - Status404(models::ApiNotFound), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`user_get_o_auth2_applications`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum UserGetOAuth2ApplicationsError { - Status401(models::ApiUnauthorizedError), - Status403(models::ApiForbiddenError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`user_get_quota`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum UserGetQuotaError { - Status401(models::ApiUnauthorizedError), - Status403(models::ApiForbiddenError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`user_get_runner_registration_token`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum UserGetRunnerRegistrationTokenError { - Status401(models::ApiUnauthorizedError), - Status403(models::ApiForbiddenError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`user_get_stop_watches`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum UserGetStopWatchesError { - Status401(models::ApiUnauthorizedError), - Status403(models::ApiForbiddenError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`user_get_tokens`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum UserGetTokensError { - Status403(models::ApiForbiddenError), - Status404(models::ApiNotFound), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`user_list_activity_feeds`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum UserListActivityFeedsError { - Status404(models::ApiNotFound), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`user_list_blocked_users`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum UserListBlockedUsersError { - Status401(models::ApiUnauthorizedError), - Status403(models::ApiForbiddenError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`user_list_emails`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum UserListEmailsError { - Status401(models::ApiUnauthorizedError), - Status403(models::ApiForbiddenError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`user_list_followers`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum UserListFollowersError { - Status404(models::ApiNotFound), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`user_list_following`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum UserListFollowingError { - Status404(models::ApiNotFound), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`user_list_gpg_keys`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum UserListGpgKeysError { - Status404(models::ApiNotFound), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`user_list_hooks`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum UserListHooksError { - Status401(models::ApiUnauthorizedError), - Status403(models::ApiForbiddenError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`user_list_keys`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum UserListKeysError { - Status404(models::ApiNotFound), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`user_list_quota_artifacts`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum UserListQuotaArtifactsError { - Status401(models::ApiUnauthorizedError), - Status403(models::ApiForbiddenError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`user_list_quota_attachments`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum UserListQuotaAttachmentsError { - Status401(models::ApiUnauthorizedError), - Status403(models::ApiForbiddenError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`user_list_quota_packages`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum UserListQuotaPackagesError { - Status401(models::ApiUnauthorizedError), - Status403(models::ApiForbiddenError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`user_list_repos`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum UserListReposError { - Status404(models::ApiNotFound), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`user_list_starred`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum UserListStarredError { - Status404(models::ApiNotFound), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`user_list_subscriptions`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum UserListSubscriptionsError { - Status404(models::ApiNotFound), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`user_list_teams`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum UserListTeamsError { - Status401(models::ApiUnauthorizedError), - Status403(models::ApiForbiddenError), - 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_search_run_jobs`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum UserSearchRunJobsError { - Status401(models::ApiUnauthorizedError), - Status403(models::ApiForbiddenError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`user_unblock_user`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum UserUnblockUserError { - Status401(models::ApiUnauthorizedError), - Status403(models::ApiForbiddenError), - Status404(models::ApiNotFound), - Status422(models::ApiValidationError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`user_update_avatar`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum UserUpdateAvatarError { - Status401(models::ApiUnauthorizedError), - Status403(models::ApiForbiddenError), - 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 { - Status401(models::ApiUnauthorizedError), - Status403(models::ApiForbiddenError), - Status404(models::ApiNotFound), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`user_verify_gpg_key`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum UserVerifyGpgKeyError { - Status401(models::ApiUnauthorizedError), - Status403(models::ApiForbiddenError), - Status404(models::ApiNotFound), - Status422(models::ApiValidationError), - UnknownValue(serde_json::Value), -} - -pub async fn create_current_user_repo( - configuration: &configuration::Configuration, - body: Option, -) -> Result> { - // add a prefix to parameters to efficiently prevent name collisions - let p_body_body = body; - - let uri_str = format!("{}/user/repos", configuration.base_path); - let mut req_builder = configuration - .client - .request(reqwest::Method::POST, &uri_str); - - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("access_token", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("sudo", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("token", value)]); - } - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("X-FORGEJO-OTP", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Authorization", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Sudo", value); - }; - if let Some(ref auth_conf) = configuration.basic_auth { - req_builder = req_builder.basic_auth(auth_conf.0.to_owned(), auth_conf.1.to_owned()); - }; - req_builder = req_builder.json(&p_body_body); - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::Repository`"))), - ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::Repository`")))), - } - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -pub async fn create_user_variable( - configuration: &configuration::Configuration, - variablename: &str, - body: Option, -) -> Result<(), Error> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_variablename = variablename; - let p_body_body = body; - - let uri_str = format!( - "{}/user/actions/variables/{variablename}", - configuration.base_path, - variablename = crate::apis::urlencode(p_path_variablename) - ); - let mut req_builder = configuration - .client - .request(reqwest::Method::POST, &uri_str); - - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("access_token", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("sudo", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("token", value)]); - } - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("X-FORGEJO-OTP", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Authorization", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Sudo", value); - }; - if let Some(ref auth_conf) = configuration.basic_auth { - req_builder = req_builder.basic_auth(auth_conf.0.to_owned(), auth_conf.1.to_owned()); - }; - req_builder = req_builder.json(&p_body_body); - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - - if !status.is_client_error() && !status.is_server_error() { - Ok(()) - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -pub async fn delete_user_secret( - configuration: &configuration::Configuration, - secretname: &str, -) -> Result<(), Error> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_secretname = secretname; - - let uri_str = format!( - "{}/user/actions/secrets/{secretname}", - configuration.base_path, - secretname = crate::apis::urlencode(p_path_secretname) - ); - let mut req_builder = configuration - .client - .request(reqwest::Method::DELETE, &uri_str); - - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("access_token", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("sudo", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("token", value)]); - } - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("X-FORGEJO-OTP", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Authorization", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Sudo", value); - }; - if let Some(ref auth_conf) = configuration.basic_auth { - req_builder = req_builder.basic_auth(auth_conf.0.to_owned(), auth_conf.1.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - - if !status.is_client_error() && !status.is_server_error() { - Ok(()) - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -pub async fn delete_user_variable( - configuration: &configuration::Configuration, - variablename: &str, -) -> Result<(), Error> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_variablename = variablename; - - let uri_str = format!( - "{}/user/actions/variables/{variablename}", - configuration.base_path, - variablename = crate::apis::urlencode(p_path_variablename) - ); - let mut req_builder = configuration - .client - .request(reqwest::Method::DELETE, &uri_str); - - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("access_token", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("sudo", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("token", value)]); - } - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("X-FORGEJO-OTP", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Authorization", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Sudo", value); - }; - if let Some(ref auth_conf) = configuration.basic_auth { - req_builder = req_builder.basic_auth(auth_conf.0.to_owned(), auth_conf.1.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - - if !status.is_client_error() && !status.is_server_error() { - Ok(()) - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -pub async fn get_user_settings( - configuration: &configuration::Configuration, -) -> Result> { - let uri_str = format!("{}/user/settings", configuration.base_path); - let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); - - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("access_token", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("sudo", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("token", value)]); - } - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("X-FORGEJO-OTP", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Authorization", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Sudo", value); - }; - if let Some(ref auth_conf) = configuration.basic_auth { - req_builder = req_builder.basic_auth(auth_conf.0.to_owned(), auth_conf.1.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::UserSettings`"))), - ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::UserSettings`")))), - } - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -pub async fn get_user_variable( - configuration: &configuration::Configuration, - variablename: &str, -) -> Result> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_variablename = variablename; - - let uri_str = format!( - "{}/user/actions/variables/{variablename}", - configuration.base_path, - variablename = crate::apis::urlencode(p_path_variablename) - ); - let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); - - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("access_token", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("sudo", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("token", value)]); - } - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("X-FORGEJO-OTP", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Authorization", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Sudo", value); - }; - if let Some(ref auth_conf) = configuration.basic_auth { - req_builder = req_builder.basic_auth(auth_conf.0.to_owned(), auth_conf.1.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::ActionVariable`"))), - ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::ActionVariable`")))), - } - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -pub async fn get_user_variables_list( - configuration: &configuration::Configuration, - page: Option, - limit: Option, -) -> Result, Error> { - // add a prefix to parameters to efficiently prevent name collisions - let p_query_page = page; - let p_query_limit = limit; - - let uri_str = format!("{}/user/actions/variables", configuration.base_path); - let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); - - if let Some(ref param_value) = p_query_page { - req_builder = req_builder.query(&[("page", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_limit { - req_builder = req_builder.query(&[("limit", ¶m_value.to_string())]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("access_token", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("sudo", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("token", value)]); - } - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("X-FORGEJO-OTP", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Authorization", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Sudo", value); - }; - if let Some(ref auth_conf) = configuration.basic_auth { - req_builder = req_builder.basic_auth(auth_conf.0.to_owned(), auth_conf.1.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `Vec<models::ActionVariable>`"))), - ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `Vec<models::ActionVariable>`")))), - } - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -pub async fn get_verification_token( - configuration: &configuration::Configuration, -) -> Result> { - let uri_str = format!("{}/user/gpg_key_token", configuration.base_path); - let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); - - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("access_token", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("sudo", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("token", value)]); - } - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("X-FORGEJO-OTP", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Authorization", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Sudo", value); - }; - if let Some(ref auth_conf) = configuration.basic_auth { - req_builder = req_builder.basic_auth(auth_conf.0.to_owned(), auth_conf.1.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => return Ok(content), - ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `String`")))), - } - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -pub async fn update_user_secret( - configuration: &configuration::Configuration, - secretname: &str, - body: Option, -) -> Result<(), Error> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_secretname = secretname; - let p_body_body = body; - - let uri_str = format!( - "{}/user/actions/secrets/{secretname}", - configuration.base_path, - secretname = crate::apis::urlencode(p_path_secretname) - ); - let mut req_builder = configuration.client.request(reqwest::Method::PUT, &uri_str); - - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("access_token", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("sudo", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("token", value)]); - } - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("X-FORGEJO-OTP", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Authorization", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Sudo", value); - }; - if let Some(ref auth_conf) = configuration.basic_auth { - req_builder = req_builder.basic_auth(auth_conf.0.to_owned(), auth_conf.1.to_owned()); - }; - req_builder = req_builder.json(&p_body_body); - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - - if !status.is_client_error() && !status.is_server_error() { - Ok(()) - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -pub async fn update_user_settings( - configuration: &configuration::Configuration, - body: Option, -) -> Result> { - // add a prefix to parameters to efficiently prevent name collisions - let p_body_body = body; - - let uri_str = format!("{}/user/settings", configuration.base_path); - let mut req_builder = configuration - .client - .request(reqwest::Method::PATCH, &uri_str); - - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("access_token", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("sudo", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("token", value)]); - } - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("X-FORGEJO-OTP", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Authorization", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Sudo", value); - }; - if let Some(ref auth_conf) = configuration.basic_auth { - req_builder = req_builder.basic_auth(auth_conf.0.to_owned(), auth_conf.1.to_owned()); - }; - req_builder = req_builder.json(&p_body_body); - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::UserSettings`"))), - ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::UserSettings`")))), - } - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -pub async fn update_user_variable( - configuration: &configuration::Configuration, - variablename: &str, - body: Option, -) -> Result<(), Error> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_variablename = variablename; - let p_body_body = body; - - let uri_str = format!( - "{}/user/actions/variables/{variablename}", - configuration.base_path, - variablename = crate::apis::urlencode(p_path_variablename) - ); - let mut req_builder = configuration.client.request(reqwest::Method::PUT, &uri_str); - - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("access_token", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("sudo", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("token", value)]); - } - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("X-FORGEJO-OTP", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Authorization", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Sudo", value); - }; - if let Some(ref auth_conf) = configuration.basic_auth { - req_builder = req_builder.basic_auth(auth_conf.0.to_owned(), auth_conf.1.to_owned()); - }; - req_builder = req_builder.json(&p_body_body); - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - - if !status.is_client_error() && !status.is_server_error() { - Ok(()) - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -pub async fn user_add_email( - configuration: &configuration::Configuration, - body: Option, -) -> Result, Error> { - // add a prefix to parameters to efficiently prevent name collisions - let p_body_body = body; - - let uri_str = format!("{}/user/emails", configuration.base_path); - let mut req_builder = configuration - .client - .request(reqwest::Method::POST, &uri_str); - - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("access_token", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("sudo", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("token", value)]); - } - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("X-FORGEJO-OTP", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Authorization", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Sudo", value); - }; - if let Some(ref auth_conf) = configuration.basic_auth { - req_builder = req_builder.basic_auth(auth_conf.0.to_owned(), auth_conf.1.to_owned()); - }; - req_builder = req_builder.json(&p_body_body); - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `Vec<models::Email>`"))), - ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `Vec<models::Email>`")))), - } - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -pub async fn user_block_user( - configuration: &configuration::Configuration, - username: &str, -) -> Result<(), Error> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_username = username; - - let uri_str = format!( - "{}/user/block/{username}", - configuration.base_path, - username = crate::apis::urlencode(p_path_username) - ); - let mut req_builder = configuration.client.request(reqwest::Method::PUT, &uri_str); - - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("access_token", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("sudo", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("token", value)]); - } - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("X-FORGEJO-OTP", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Authorization", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Sudo", value); - }; - if let Some(ref auth_conf) = configuration.basic_auth { - req_builder = req_builder.basic_auth(auth_conf.0.to_owned(), auth_conf.1.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - - if !status.is_client_error() && !status.is_server_error() { - Ok(()) - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -pub async fn user_check_following( - configuration: &configuration::Configuration, - username: &str, - target: &str, -) -> Result<(), Error> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_username = username; - let p_path_target = target; - - let uri_str = format!( - "{}/users/{username}/following/{target}", - configuration.base_path, - username = crate::apis::urlencode(p_path_username), - target = crate::apis::urlencode(p_path_target) - ); - let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); - - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("access_token", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("sudo", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("token", value)]); - } - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("X-FORGEJO-OTP", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Authorization", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Sudo", value); - }; - if let Some(ref auth_conf) = configuration.basic_auth { - req_builder = req_builder.basic_auth(auth_conf.0.to_owned(), auth_conf.1.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - - if !status.is_client_error() && !status.is_server_error() { - Ok(()) - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -pub async fn user_check_quota( - configuration: &configuration::Configuration, - subject: &str, -) -> Result> { - // add a prefix to parameters to efficiently prevent name collisions - let p_query_subject = subject; - - let uri_str = format!("{}/user/quota/check", configuration.base_path); - let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); - - req_builder = req_builder.query(&[("subject", &p_query_subject.to_string())]); - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("access_token", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("sudo", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("token", value)]); - } - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("X-FORGEJO-OTP", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Authorization", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Sudo", value); - }; - if let Some(ref auth_conf) = configuration.basic_auth { - req_builder = req_builder.basic_auth(auth_conf.0.to_owned(), auth_conf.1.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `bool`"))), - ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `bool`")))), - } - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -pub async fn user_create_hook( - configuration: &configuration::Configuration, - body: models::CreateHookOption, -) -> Result> { - // add a prefix to parameters to efficiently prevent name collisions - let p_body_body = body; - - let uri_str = format!("{}/user/hooks", configuration.base_path); - let mut req_builder = configuration - .client - .request(reqwest::Method::POST, &uri_str); - - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("access_token", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("sudo", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("token", value)]); - } - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("X-FORGEJO-OTP", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Authorization", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Sudo", value); - }; - if let Some(ref auth_conf) = configuration.basic_auth { - req_builder = req_builder.basic_auth(auth_conf.0.to_owned(), auth_conf.1.to_owned()); - }; - req_builder = req_builder.json(&p_body_body); - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::Hook`"))), - ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::Hook`")))), - } - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -pub async fn user_create_o_auth2_application( - configuration: &configuration::Configuration, - body: models::CreateOAuth2ApplicationOptions, -) -> Result> { - // add a prefix to parameters to efficiently prevent name collisions - let p_body_body = body; - - let uri_str = format!("{}/user/applications/oauth2", configuration.base_path); - let mut req_builder = configuration - .client - .request(reqwest::Method::POST, &uri_str); - - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("access_token", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("sudo", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("token", value)]); - } - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("X-FORGEJO-OTP", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Authorization", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Sudo", value); - }; - if let Some(ref auth_conf) = configuration.basic_auth { - req_builder = req_builder.basic_auth(auth_conf.0.to_owned(), auth_conf.1.to_owned()); - }; - req_builder = req_builder.json(&p_body_body); - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::OAuth2Application`"))), - ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::OAuth2Application`")))), - } - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -pub async fn user_create_token( - configuration: &configuration::Configuration, - username: &str, - body: Option, -) -> Result> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_username = username; - let p_body_body = body; - - let uri_str = format!( - "{}/users/{username}/tokens", - configuration.base_path, - username = crate::apis::urlencode(p_path_username) - ); - let mut req_builder = configuration - .client - .request(reqwest::Method::POST, &uri_str); - - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("access_token", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("sudo", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("token", value)]); - } - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("X-FORGEJO-OTP", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Authorization", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Sudo", value); - }; - if let Some(ref auth_conf) = configuration.basic_auth { - req_builder = req_builder.basic_auth(auth_conf.0.to_owned(), auth_conf.1.to_owned()); - }; - req_builder = req_builder.json(&p_body_body); - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::AccessToken`"))), - ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::AccessToken`")))), - } - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -pub async fn user_current_check_following( - configuration: &configuration::Configuration, - username: &str, -) -> Result<(), Error> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_username = username; - - let uri_str = format!( - "{}/user/following/{username}", - configuration.base_path, - username = crate::apis::urlencode(p_path_username) - ); - let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); - - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("access_token", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("sudo", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("token", value)]); - } - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("X-FORGEJO-OTP", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Authorization", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Sudo", value); - }; - if let Some(ref auth_conf) = configuration.basic_auth { - req_builder = req_builder.basic_auth(auth_conf.0.to_owned(), auth_conf.1.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - - if !status.is_client_error() && !status.is_server_error() { - Ok(()) - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -pub async fn user_current_check_starring( - configuration: &configuration::Configuration, - owner: &str, - repo: &str, -) -> Result<(), Error> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_owner = owner; - let p_path_repo = repo; - - let uri_str = format!( - "{}/user/starred/{owner}/{repo}", - configuration.base_path, - owner = crate::apis::urlencode(p_path_owner), - repo = crate::apis::urlencode(p_path_repo) - ); - let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); - - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("access_token", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("sudo", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("token", value)]); - } - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("X-FORGEJO-OTP", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Authorization", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Sudo", value); - }; - if let Some(ref auth_conf) = configuration.basic_auth { - req_builder = req_builder.basic_auth(auth_conf.0.to_owned(), auth_conf.1.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - - if !status.is_client_error() && !status.is_server_error() { - Ok(()) - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -pub async fn user_current_delete_follow( - configuration: &configuration::Configuration, - username: &str, -) -> Result<(), Error> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_username = username; - - let uri_str = format!( - "{}/user/following/{username}", - configuration.base_path, - username = crate::apis::urlencode(p_path_username) - ); - let mut req_builder = configuration - .client - .request(reqwest::Method::DELETE, &uri_str); - - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("access_token", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("sudo", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("token", value)]); - } - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("X-FORGEJO-OTP", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Authorization", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Sudo", value); - }; - if let Some(ref auth_conf) = configuration.basic_auth { - req_builder = req_builder.basic_auth(auth_conf.0.to_owned(), auth_conf.1.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - - if !status.is_client_error() && !status.is_server_error() { - Ok(()) - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -pub async fn user_current_delete_gpg_key( - configuration: &configuration::Configuration, - id: i64, -) -> Result<(), Error> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_id = id; - - let uri_str = format!( - "{}/user/gpg_keys/{id}", - configuration.base_path, - id = p_path_id - ); - let mut req_builder = configuration - .client - .request(reqwest::Method::DELETE, &uri_str); - - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("access_token", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("sudo", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("token", value)]); - } - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("X-FORGEJO-OTP", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Authorization", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Sudo", value); - }; - if let Some(ref auth_conf) = configuration.basic_auth { - req_builder = req_builder.basic_auth(auth_conf.0.to_owned(), auth_conf.1.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - - if !status.is_client_error() && !status.is_server_error() { - Ok(()) - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -pub async fn user_current_delete_key( - configuration: &configuration::Configuration, - id: i64, -) -> Result<(), Error> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_id = id; - - let uri_str = format!("{}/user/keys/{id}", configuration.base_path, id = p_path_id); - let mut req_builder = configuration - .client - .request(reqwest::Method::DELETE, &uri_str); - - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("access_token", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("sudo", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("token", value)]); - } - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("X-FORGEJO-OTP", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Authorization", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Sudo", value); - }; - if let Some(ref auth_conf) = configuration.basic_auth { - req_builder = req_builder.basic_auth(auth_conf.0.to_owned(), auth_conf.1.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - - if !status.is_client_error() && !status.is_server_error() { - Ok(()) - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -pub async fn user_current_delete_star( - configuration: &configuration::Configuration, - owner: &str, - repo: &str, -) -> Result<(), Error> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_owner = owner; - let p_path_repo = repo; - - let uri_str = format!( - "{}/user/starred/{owner}/{repo}", - configuration.base_path, - owner = crate::apis::urlencode(p_path_owner), - repo = crate::apis::urlencode(p_path_repo) - ); - let mut req_builder = configuration - .client - .request(reqwest::Method::DELETE, &uri_str); - - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("access_token", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("sudo", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("token", value)]); - } - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("X-FORGEJO-OTP", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Authorization", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Sudo", value); - }; - if let Some(ref auth_conf) = configuration.basic_auth { - req_builder = req_builder.basic_auth(auth_conf.0.to_owned(), auth_conf.1.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - - if !status.is_client_error() && !status.is_server_error() { - Ok(()) - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -pub async fn user_current_get_gpg_key( - configuration: &configuration::Configuration, - id: i64, -) -> Result> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_id = id; - - let uri_str = format!( - "{}/user/gpg_keys/{id}", - configuration.base_path, - id = p_path_id - ); - let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); - - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("access_token", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("sudo", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("token", value)]); - } - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("X-FORGEJO-OTP", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Authorization", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Sudo", value); - }; - if let Some(ref auth_conf) = configuration.basic_auth { - req_builder = req_builder.basic_auth(auth_conf.0.to_owned(), auth_conf.1.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::GpgKey`"))), - ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::GpgKey`")))), - } - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -pub async fn user_current_get_key( - configuration: &configuration::Configuration, - id: i64, -) -> Result> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_id = id; - - let uri_str = format!("{}/user/keys/{id}", configuration.base_path, id = p_path_id); - let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); - - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("access_token", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("sudo", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("token", value)]); - } - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("X-FORGEJO-OTP", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Authorization", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Sudo", value); - }; - if let Some(ref auth_conf) = configuration.basic_auth { - req_builder = req_builder.basic_auth(auth_conf.0.to_owned(), auth_conf.1.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::PublicKey`"))), - ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::PublicKey`")))), - } - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -pub async fn user_current_list_followers( - configuration: &configuration::Configuration, - page: Option, - limit: Option, -) -> Result, Error> { - // add a prefix to parameters to efficiently prevent name collisions - let p_query_page = page; - let p_query_limit = limit; - - let uri_str = format!("{}/user/followers", configuration.base_path); - let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); - - if let Some(ref param_value) = p_query_page { - req_builder = req_builder.query(&[("page", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_limit { - req_builder = req_builder.query(&[("limit", ¶m_value.to_string())]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("access_token", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("sudo", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("token", value)]); - } - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("X-FORGEJO-OTP", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Authorization", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Sudo", value); - }; - if let Some(ref auth_conf) = configuration.basic_auth { - req_builder = req_builder.basic_auth(auth_conf.0.to_owned(), auth_conf.1.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `Vec<models::User>`"))), - ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `Vec<models::User>`")))), - } - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -pub async fn user_current_list_following( - configuration: &configuration::Configuration, - page: Option, - limit: Option, -) -> Result, Error> { - // add a prefix to parameters to efficiently prevent name collisions - let p_query_page = page; - let p_query_limit = limit; - - let uri_str = format!("{}/user/following", configuration.base_path); - let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); - - if let Some(ref param_value) = p_query_page { - req_builder = req_builder.query(&[("page", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_limit { - req_builder = req_builder.query(&[("limit", ¶m_value.to_string())]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("access_token", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("sudo", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("token", value)]); - } - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("X-FORGEJO-OTP", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Authorization", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Sudo", value); - }; - if let Some(ref auth_conf) = configuration.basic_auth { - req_builder = req_builder.basic_auth(auth_conf.0.to_owned(), auth_conf.1.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `Vec<models::User>`"))), - ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `Vec<models::User>`")))), - } - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -pub async fn user_current_list_gpg_keys( - configuration: &configuration::Configuration, - page: Option, - limit: Option, -) -> Result, Error> { - // add a prefix to parameters to efficiently prevent name collisions - let p_query_page = page; - let p_query_limit = limit; - - let uri_str = format!("{}/user/gpg_keys", configuration.base_path); - let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); - - if let Some(ref param_value) = p_query_page { - req_builder = req_builder.query(&[("page", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_limit { - req_builder = req_builder.query(&[("limit", ¶m_value.to_string())]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("access_token", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("sudo", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("token", value)]); - } - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("X-FORGEJO-OTP", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Authorization", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Sudo", value); - }; - if let Some(ref auth_conf) = configuration.basic_auth { - req_builder = req_builder.basic_auth(auth_conf.0.to_owned(), auth_conf.1.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `Vec<models::GpgKey>`"))), - ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `Vec<models::GpgKey>`")))), - } - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -pub async fn user_current_list_keys( - configuration: &configuration::Configuration, - fingerprint: Option<&str>, - page: Option, - limit: Option, -) -> Result, Error> { - // add a prefix to parameters to efficiently prevent name collisions - let p_query_fingerprint = fingerprint; - let p_query_page = page; - let p_query_limit = limit; - - let uri_str = format!("{}/user/keys", configuration.base_path); - let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); - - if let Some(ref param_value) = p_query_fingerprint { - req_builder = req_builder.query(&[("fingerprint", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_page { - req_builder = req_builder.query(&[("page", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_limit { - req_builder = req_builder.query(&[("limit", ¶m_value.to_string())]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("access_token", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("sudo", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("token", value)]); - } - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("X-FORGEJO-OTP", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Authorization", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Sudo", value); - }; - if let Some(ref auth_conf) = configuration.basic_auth { - req_builder = req_builder.basic_auth(auth_conf.0.to_owned(), auth_conf.1.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `Vec<models::PublicKey>`"))), - ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `Vec<models::PublicKey>`")))), - } - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -pub async fn user_current_list_repos( - configuration: &configuration::Configuration, - page: Option, - limit: Option, - order_by: Option<&str>, -) -> Result, Error> { - // add a prefix to parameters to efficiently prevent name collisions - let p_query_page = page; - let p_query_limit = limit; - let p_query_order_by = order_by; - - let uri_str = format!("{}/user/repos", configuration.base_path); - let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); - - if let Some(ref param_value) = p_query_page { - req_builder = req_builder.query(&[("page", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_limit { - req_builder = req_builder.query(&[("limit", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_order_by { - req_builder = req_builder.query(&[("order_by", ¶m_value.to_string())]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("access_token", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("sudo", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("token", value)]); - } - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("X-FORGEJO-OTP", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Authorization", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Sudo", value); - }; - if let Some(ref auth_conf) = configuration.basic_auth { - req_builder = req_builder.basic_auth(auth_conf.0.to_owned(), auth_conf.1.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `Vec<models::Repository>`"))), - ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `Vec<models::Repository>`")))), - } - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -pub async fn user_current_list_starred( - configuration: &configuration::Configuration, - page: Option, - limit: Option, -) -> Result, Error> { - // add a prefix to parameters to efficiently prevent name collisions - let p_query_page = page; - let p_query_limit = limit; - - let uri_str = format!("{}/user/starred", configuration.base_path); - let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); - - if let Some(ref param_value) = p_query_page { - req_builder = req_builder.query(&[("page", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_limit { - req_builder = req_builder.query(&[("limit", ¶m_value.to_string())]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("access_token", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("sudo", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("token", value)]); - } - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("X-FORGEJO-OTP", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Authorization", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Sudo", value); - }; - if let Some(ref auth_conf) = configuration.basic_auth { - req_builder = req_builder.basic_auth(auth_conf.0.to_owned(), auth_conf.1.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `Vec<models::Repository>`"))), - ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `Vec<models::Repository>`")))), - } - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -pub async fn user_current_list_subscriptions( - configuration: &configuration::Configuration, - page: Option, - limit: Option, -) -> Result, Error> { - // add a prefix to parameters to efficiently prevent name collisions - let p_query_page = page; - let p_query_limit = limit; - - let uri_str = format!("{}/user/subscriptions", configuration.base_path); - let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); - - if let Some(ref param_value) = p_query_page { - req_builder = req_builder.query(&[("page", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_limit { - req_builder = req_builder.query(&[("limit", ¶m_value.to_string())]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("access_token", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("sudo", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("token", value)]); - } - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("X-FORGEJO-OTP", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Authorization", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Sudo", value); - }; - if let Some(ref auth_conf) = configuration.basic_auth { - req_builder = req_builder.basic_auth(auth_conf.0.to_owned(), auth_conf.1.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `Vec<models::Repository>`"))), - ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `Vec<models::Repository>`")))), - } - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -pub async fn user_current_post_gpg_key( - configuration: &configuration::Configuration, - form: Option, -) -> Result> { - // add a prefix to parameters to efficiently prevent name collisions - let p_body_form = form; - - let uri_str = format!("{}/user/gpg_keys", configuration.base_path); - let mut req_builder = configuration - .client - .request(reqwest::Method::POST, &uri_str); - - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("access_token", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("sudo", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("token", value)]); - } - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("X-FORGEJO-OTP", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Authorization", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Sudo", value); - }; - if let Some(ref auth_conf) = configuration.basic_auth { - req_builder = req_builder.basic_auth(auth_conf.0.to_owned(), auth_conf.1.to_owned()); - }; - req_builder = req_builder.json(&p_body_form); - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::GpgKey`"))), - ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::GpgKey`")))), - } - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -pub async fn user_current_post_key( - configuration: &configuration::Configuration, - body: Option, -) -> Result> { - // add a prefix to parameters to efficiently prevent name collisions - let p_body_body = body; - - let uri_str = format!("{}/user/keys", configuration.base_path); - let mut req_builder = configuration - .client - .request(reqwest::Method::POST, &uri_str); - - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("access_token", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("sudo", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("token", value)]); - } - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("X-FORGEJO-OTP", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Authorization", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Sudo", value); - }; - if let Some(ref auth_conf) = configuration.basic_auth { - req_builder = req_builder.basic_auth(auth_conf.0.to_owned(), auth_conf.1.to_owned()); - }; - req_builder = req_builder.json(&p_body_body); - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::PublicKey`"))), - ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::PublicKey`")))), - } - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -pub async fn user_current_put_follow( - configuration: &configuration::Configuration, - username: &str, -) -> Result<(), Error> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_username = username; - - let uri_str = format!( - "{}/user/following/{username}", - configuration.base_path, - username = crate::apis::urlencode(p_path_username) - ); - let mut req_builder = configuration.client.request(reqwest::Method::PUT, &uri_str); - - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("access_token", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("sudo", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("token", value)]); - } - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("X-FORGEJO-OTP", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Authorization", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Sudo", value); - }; - if let Some(ref auth_conf) = configuration.basic_auth { - req_builder = req_builder.basic_auth(auth_conf.0.to_owned(), auth_conf.1.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - - if !status.is_client_error() && !status.is_server_error() { - Ok(()) - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -pub async fn user_current_put_star( - configuration: &configuration::Configuration, - owner: &str, - repo: &str, -) -> Result<(), Error> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_owner = owner; - let p_path_repo = repo; - - let uri_str = format!( - "{}/user/starred/{owner}/{repo}", - configuration.base_path, - owner = crate::apis::urlencode(p_path_owner), - repo = crate::apis::urlencode(p_path_repo) - ); - let mut req_builder = configuration.client.request(reqwest::Method::PUT, &uri_str); - - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("access_token", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("sudo", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("token", value)]); - } - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("X-FORGEJO-OTP", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Authorization", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Sudo", value); - }; - if let Some(ref auth_conf) = configuration.basic_auth { - req_builder = req_builder.basic_auth(auth_conf.0.to_owned(), auth_conf.1.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - - if !status.is_client_error() && !status.is_server_error() { - Ok(()) - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -pub async fn user_current_tracked_times( - configuration: &configuration::Configuration, - page: Option, - limit: Option, - since: Option, - before: Option, -) -> Result, Error> { - // add a prefix to parameters to efficiently prevent name collisions - let p_query_page = page; - let p_query_limit = limit; - let p_query_since = since; - let p_query_before = before; - - let uri_str = format!("{}/user/times", configuration.base_path); - let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); - - if let Some(ref param_value) = p_query_page { - req_builder = req_builder.query(&[("page", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_limit { - req_builder = req_builder.query(&[("limit", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_since { - req_builder = req_builder.query(&[("since", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_before { - req_builder = req_builder.query(&[("before", ¶m_value.to_string())]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("access_token", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("sudo", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("token", value)]); - } - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("X-FORGEJO-OTP", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Authorization", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Sudo", value); - }; - if let Some(ref auth_conf) = configuration.basic_auth { - req_builder = req_builder.basic_auth(auth_conf.0.to_owned(), auth_conf.1.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `Vec<models::TrackedTime>`"))), - ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `Vec<models::TrackedTime>`")))), - } - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -pub async fn user_delete_access_token( - configuration: &configuration::Configuration, - username: &str, - token: &str, -) -> Result<(), Error> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_username = username; - let p_path_token = token; - - let uri_str = format!( - "{}/users/{username}/tokens/{token}", - configuration.base_path, - username = crate::apis::urlencode(p_path_username), - token = crate::apis::urlencode(p_path_token) - ); - let mut req_builder = configuration - .client - .request(reqwest::Method::DELETE, &uri_str); - - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("access_token", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("sudo", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("token", value)]); - } - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("X-FORGEJO-OTP", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Authorization", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Sudo", value); - }; - if let Some(ref auth_conf) = configuration.basic_auth { - req_builder = req_builder.basic_auth(auth_conf.0.to_owned(), auth_conf.1.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - - if !status.is_client_error() && !status.is_server_error() { - Ok(()) - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -pub async fn user_delete_avatar( - configuration: &configuration::Configuration, -) -> Result<(), Error> { - let uri_str = format!("{}/user/avatar", configuration.base_path); - let mut req_builder = configuration - .client - .request(reqwest::Method::DELETE, &uri_str); - - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("access_token", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("sudo", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("token", value)]); - } - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("X-FORGEJO-OTP", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Authorization", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Sudo", value); - }; - if let Some(ref auth_conf) = configuration.basic_auth { - req_builder = req_builder.basic_auth(auth_conf.0.to_owned(), auth_conf.1.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - - if !status.is_client_error() && !status.is_server_error() { - Ok(()) - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -pub async fn user_delete_email( - configuration: &configuration::Configuration, - body: Option, -) -> Result<(), Error> { - // add a prefix to parameters to efficiently prevent name collisions - let p_body_body = body; - - let uri_str = format!("{}/user/emails", configuration.base_path); - let mut req_builder = configuration - .client - .request(reqwest::Method::DELETE, &uri_str); - - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("access_token", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("sudo", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("token", value)]); - } - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("X-FORGEJO-OTP", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Authorization", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Sudo", value); - }; - if let Some(ref auth_conf) = configuration.basic_auth { - req_builder = req_builder.basic_auth(auth_conf.0.to_owned(), auth_conf.1.to_owned()); - }; - req_builder = req_builder.json(&p_body_body); - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - - if !status.is_client_error() && !status.is_server_error() { - Ok(()) - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -pub async fn user_delete_hook( - configuration: &configuration::Configuration, - id: i64, -) -> Result<(), Error> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_id = id; - - let uri_str = format!( - "{}/user/hooks/{id}", - configuration.base_path, - id = p_path_id - ); - let mut req_builder = configuration - .client - .request(reqwest::Method::DELETE, &uri_str); - - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("access_token", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("sudo", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("token", value)]); - } - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("X-FORGEJO-OTP", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Authorization", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Sudo", value); - }; - if let Some(ref auth_conf) = configuration.basic_auth { - req_builder = req_builder.basic_auth(auth_conf.0.to_owned(), auth_conf.1.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - - if !status.is_client_error() && !status.is_server_error() { - Ok(()) - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -pub async fn user_delete_o_auth2_application( - configuration: &configuration::Configuration, - id: i64, -) -> Result<(), Error> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_id = id; - - let uri_str = format!( - "{}/user/applications/oauth2/{id}", - configuration.base_path, - id = p_path_id - ); - let mut req_builder = configuration - .client - .request(reqwest::Method::DELETE, &uri_str); - - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("access_token", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("sudo", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("token", value)]); - } - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("X-FORGEJO-OTP", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Authorization", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Sudo", value); - }; - if let Some(ref auth_conf) = configuration.basic_auth { - req_builder = req_builder.basic_auth(auth_conf.0.to_owned(), auth_conf.1.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - - if !status.is_client_error() && !status.is_server_error() { - Ok(()) - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -pub async fn user_edit_hook( - configuration: &configuration::Configuration, - id: i64, - body: Option, -) -> Result> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_id = id; - let p_body_body = body; - - let uri_str = format!( - "{}/user/hooks/{id}", - configuration.base_path, - id = p_path_id - ); - let mut req_builder = configuration - .client - .request(reqwest::Method::PATCH, &uri_str); - - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("access_token", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("sudo", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("token", value)]); - } - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("X-FORGEJO-OTP", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Authorization", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Sudo", value); - }; - if let Some(ref auth_conf) = configuration.basic_auth { - req_builder = req_builder.basic_auth(auth_conf.0.to_owned(), auth_conf.1.to_owned()); - }; - req_builder = req_builder.json(&p_body_body); - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::Hook`"))), - ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::Hook`")))), - } - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -pub async fn user_get( - configuration: &configuration::Configuration, - username: &str, -) -> Result> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_username = username; - - let uri_str = format!( - "{}/users/{username}", - configuration.base_path, - username = crate::apis::urlencode(p_path_username) - ); - let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); - - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("access_token", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("sudo", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("token", value)]); - } - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("X-FORGEJO-OTP", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Authorization", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Sudo", value); - }; - if let Some(ref auth_conf) = configuration.basic_auth { - req_builder = req_builder.basic_auth(auth_conf.0.to_owned(), auth_conf.1.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::User`"))), - ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::User`")))), - } - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -pub async fn user_get_current( - configuration: &configuration::Configuration, -) -> Result> { - let uri_str = format!("{}/user", configuration.base_path); - let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); - - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("access_token", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("sudo", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("token", value)]); - } - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("X-FORGEJO-OTP", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Authorization", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Sudo", value); - }; - if let Some(ref auth_conf) = configuration.basic_auth { - req_builder = req_builder.basic_auth(auth_conf.0.to_owned(), auth_conf.1.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::User`"))), - ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::User`")))), - } - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -pub async fn user_get_heatmap_data( - configuration: &configuration::Configuration, - username: &str, -) -> Result, Error> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_username = username; - - let uri_str = format!( - "{}/users/{username}/heatmap", - configuration.base_path, - username = crate::apis::urlencode(p_path_username) - ); - let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); - - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("access_token", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("sudo", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("token", value)]); - } - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("X-FORGEJO-OTP", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Authorization", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Sudo", value); - }; - if let Some(ref auth_conf) = configuration.basic_auth { - req_builder = req_builder.basic_auth(auth_conf.0.to_owned(), auth_conf.1.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `Vec<models::UserHeatmapData>`"))), - ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `Vec<models::UserHeatmapData>`")))), - } - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -pub async fn user_get_hook( - configuration: &configuration::Configuration, - id: i64, -) -> Result> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_id = id; - - let uri_str = format!( - "{}/user/hooks/{id}", - configuration.base_path, - id = p_path_id - ); - let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); - - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("access_token", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("sudo", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("token", value)]); - } - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("X-FORGEJO-OTP", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Authorization", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Sudo", value); - }; - if let Some(ref auth_conf) = configuration.basic_auth { - req_builder = req_builder.basic_auth(auth_conf.0.to_owned(), auth_conf.1.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::Hook`"))), - ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::Hook`")))), - } - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -pub async fn user_get_o_auth2_application( - configuration: &configuration::Configuration, - id: i64, -) -> Result> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_id = id; - - let uri_str = format!( - "{}/user/applications/oauth2/{id}", - configuration.base_path, - id = p_path_id - ); - let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); - - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("access_token", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("sudo", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("token", value)]); - } - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("X-FORGEJO-OTP", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Authorization", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Sudo", value); - }; - if let Some(ref auth_conf) = configuration.basic_auth { - req_builder = req_builder.basic_auth(auth_conf.0.to_owned(), auth_conf.1.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::OAuth2Application`"))), - ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::OAuth2Application`")))), - } - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -pub async fn user_get_o_auth2_applications( - configuration: &configuration::Configuration, - page: Option, - limit: Option, -) -> Result, Error> { - // add a prefix to parameters to efficiently prevent name collisions - let p_query_page = page; - let p_query_limit = limit; - - let uri_str = format!("{}/user/applications/oauth2", configuration.base_path); - let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); - - if let Some(ref param_value) = p_query_page { - req_builder = req_builder.query(&[("page", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_limit { - req_builder = req_builder.query(&[("limit", ¶m_value.to_string())]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("access_token", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("sudo", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("token", value)]); - } - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("X-FORGEJO-OTP", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Authorization", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Sudo", value); - }; - if let Some(ref auth_conf) = configuration.basic_auth { - req_builder = req_builder.basic_auth(auth_conf.0.to_owned(), auth_conf.1.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `Vec<models::OAuth2Application>`"))), - ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `Vec<models::OAuth2Application>`")))), - } - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -pub async fn user_get_quota( - configuration: &configuration::Configuration, -) -> Result> { - let uri_str = format!("{}/user/quota", configuration.base_path); - let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); - - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("access_token", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("sudo", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("token", value)]); - } - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("X-FORGEJO-OTP", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Authorization", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Sudo", value); - }; - if let Some(ref auth_conf) = configuration.basic_auth { - req_builder = req_builder.basic_auth(auth_conf.0.to_owned(), auth_conf.1.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::QuotaInfo`"))), - ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::QuotaInfo`")))), - } - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -pub async fn user_get_runner_registration_token( - configuration: &configuration::Configuration, -) -> Result> { - let uri_str = format!( - "{}/user/actions/runners/registration-token", - configuration.base_path - ); - let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); - - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("access_token", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("sudo", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("token", value)]); - } - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("X-FORGEJO-OTP", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Authorization", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Sudo", value); - }; - if let Some(ref auth_conf) = configuration.basic_auth { - req_builder = req_builder.basic_auth(auth_conf.0.to_owned(), auth_conf.1.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::RegistrationToken`"))), - ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::RegistrationToken`")))), - } - } else { - let content = resp.text().await?; - let entity: Option = - serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -pub async fn user_get_stop_watches( - configuration: &configuration::Configuration, - page: Option, - limit: Option, -) -> Result, Error> { - // add a prefix to parameters to efficiently prevent name collisions - let p_query_page = page; - let p_query_limit = limit; - - let uri_str = format!("{}/user/stopwatches", configuration.base_path); - let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); - - if let Some(ref param_value) = p_query_page { - req_builder = req_builder.query(&[("page", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_limit { - req_builder = req_builder.query(&[("limit", ¶m_value.to_string())]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("access_token", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("sudo", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("token", value)]); - } - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("X-FORGEJO-OTP", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Authorization", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Sudo", value); - }; - if let Some(ref auth_conf) = configuration.basic_auth { - req_builder = req_builder.basic_auth(auth_conf.0.to_owned(), auth_conf.1.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `Vec<models::StopWatch>`"))), - ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `Vec<models::StopWatch>`")))), - } - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -pub async fn user_get_tokens( - configuration: &configuration::Configuration, - username: &str, - page: Option, - limit: Option, -) -> Result, Error> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_username = username; - let p_query_page = page; - let p_query_limit = limit; - - let uri_str = format!( - "{}/users/{username}/tokens", - configuration.base_path, - username = crate::apis::urlencode(p_path_username) - ); - let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); - - if let Some(ref param_value) = p_query_page { - req_builder = req_builder.query(&[("page", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_limit { - req_builder = req_builder.query(&[("limit", ¶m_value.to_string())]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("access_token", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("sudo", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("token", value)]); - } - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("X-FORGEJO-OTP", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Authorization", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Sudo", value); - }; - if let Some(ref auth_conf) = configuration.basic_auth { - req_builder = req_builder.basic_auth(auth_conf.0.to_owned(), auth_conf.1.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `Vec<models::AccessToken>`"))), - ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `Vec<models::AccessToken>`")))), - } - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -pub async fn user_list_activity_feeds( - configuration: &configuration::Configuration, - username: &str, - only_performed_by: Option, - date: Option, - page: Option, - limit: Option, -) -> Result, Error> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_username = username; - let p_query_only_performed_by = only_performed_by; - let p_query_date = date; - let p_query_page = page; - let p_query_limit = limit; - - let uri_str = format!( - "{}/users/{username}/activities/feeds", - configuration.base_path, - username = crate::apis::urlencode(p_path_username) - ); - let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); - - if let Some(ref param_value) = p_query_only_performed_by { - req_builder = req_builder.query(&[("only-performed-by", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_date { - req_builder = req_builder.query(&[("date", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_page { - req_builder = req_builder.query(&[("page", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_limit { - req_builder = req_builder.query(&[("limit", ¶m_value.to_string())]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("access_token", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("sudo", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("token", value)]); - } - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("X-FORGEJO-OTP", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Authorization", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Sudo", value); - }; - if let Some(ref auth_conf) = configuration.basic_auth { - req_builder = req_builder.basic_auth(auth_conf.0.to_owned(), auth_conf.1.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `Vec<models::Activity>`"))), - ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `Vec<models::Activity>`")))), - } - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -pub async fn user_list_blocked_users( - configuration: &configuration::Configuration, - page: Option, - limit: Option, -) -> Result, Error> { - // add a prefix to parameters to efficiently prevent name collisions - let p_query_page = page; - let p_query_limit = limit; - - let uri_str = format!("{}/user/list_blocked", configuration.base_path); - let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); - - if let Some(ref param_value) = p_query_page { - req_builder = req_builder.query(&[("page", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_limit { - req_builder = req_builder.query(&[("limit", ¶m_value.to_string())]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("access_token", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("sudo", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("token", value)]); - } - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("X-FORGEJO-OTP", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Authorization", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Sudo", value); - }; - if let Some(ref auth_conf) = configuration.basic_auth { - req_builder = req_builder.basic_auth(auth_conf.0.to_owned(), auth_conf.1.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `Vec<models::BlockedUser>`"))), - ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `Vec<models::BlockedUser>`")))), - } - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -pub async fn user_list_emails( - configuration: &configuration::Configuration, -) -> Result, Error> { - let uri_str = format!("{}/user/emails", configuration.base_path); - let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); - - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("access_token", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("sudo", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("token", value)]); - } - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("X-FORGEJO-OTP", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Authorization", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Sudo", value); - }; - if let Some(ref auth_conf) = configuration.basic_auth { - req_builder = req_builder.basic_auth(auth_conf.0.to_owned(), auth_conf.1.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `Vec<models::Email>`"))), - ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `Vec<models::Email>`")))), - } - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -pub async fn user_list_followers( - configuration: &configuration::Configuration, - username: &str, - page: Option, - limit: Option, -) -> Result, Error> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_username = username; - let p_query_page = page; - let p_query_limit = limit; - - let uri_str = format!( - "{}/users/{username}/followers", - configuration.base_path, - username = crate::apis::urlencode(p_path_username) - ); - let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); - - if let Some(ref param_value) = p_query_page { - req_builder = req_builder.query(&[("page", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_limit { - req_builder = req_builder.query(&[("limit", ¶m_value.to_string())]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("access_token", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("sudo", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("token", value)]); - } - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("X-FORGEJO-OTP", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Authorization", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Sudo", value); - }; - if let Some(ref auth_conf) = configuration.basic_auth { - req_builder = req_builder.basic_auth(auth_conf.0.to_owned(), auth_conf.1.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `Vec<models::User>`"))), - ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `Vec<models::User>`")))), - } - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -pub async fn user_list_following( - configuration: &configuration::Configuration, - username: &str, - page: Option, - limit: Option, -) -> Result, Error> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_username = username; - let p_query_page = page; - let p_query_limit = limit; - - let uri_str = format!( - "{}/users/{username}/following", - configuration.base_path, - username = crate::apis::urlencode(p_path_username) - ); - let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); - - if let Some(ref param_value) = p_query_page { - req_builder = req_builder.query(&[("page", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_limit { - req_builder = req_builder.query(&[("limit", ¶m_value.to_string())]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("access_token", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("sudo", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("token", value)]); - } - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("X-FORGEJO-OTP", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Authorization", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Sudo", value); - }; - if let Some(ref auth_conf) = configuration.basic_auth { - req_builder = req_builder.basic_auth(auth_conf.0.to_owned(), auth_conf.1.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `Vec<models::User>`"))), - ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `Vec<models::User>`")))), - } - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -pub async fn user_list_gpg_keys( - configuration: &configuration::Configuration, - username: &str, - page: Option, - limit: Option, -) -> Result, Error> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_username = username; - let p_query_page = page; - let p_query_limit = limit; - - let uri_str = format!( - "{}/users/{username}/gpg_keys", - configuration.base_path, - username = crate::apis::urlencode(p_path_username) - ); - let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); - - if let Some(ref param_value) = p_query_page { - req_builder = req_builder.query(&[("page", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_limit { - req_builder = req_builder.query(&[("limit", ¶m_value.to_string())]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("access_token", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("sudo", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("token", value)]); - } - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("X-FORGEJO-OTP", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Authorization", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Sudo", value); - }; - if let Some(ref auth_conf) = configuration.basic_auth { - req_builder = req_builder.basic_auth(auth_conf.0.to_owned(), auth_conf.1.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `Vec<models::GpgKey>`"))), - ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `Vec<models::GpgKey>`")))), - } - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -pub async fn user_list_hooks( - configuration: &configuration::Configuration, - page: Option, - limit: Option, -) -> Result, Error> { - // add a prefix to parameters to efficiently prevent name collisions - let p_query_page = page; - let p_query_limit = limit; - - let uri_str = format!("{}/user/hooks", configuration.base_path); - let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); - - if let Some(ref param_value) = p_query_page { - req_builder = req_builder.query(&[("page", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_limit { - req_builder = req_builder.query(&[("limit", ¶m_value.to_string())]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("access_token", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("sudo", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("token", value)]); - } - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("X-FORGEJO-OTP", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Authorization", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Sudo", value); - }; - if let Some(ref auth_conf) = configuration.basic_auth { - req_builder = req_builder.basic_auth(auth_conf.0.to_owned(), auth_conf.1.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `Vec<models::Hook>`"))), - ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `Vec<models::Hook>`")))), - } - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -pub async fn user_list_keys( - configuration: &configuration::Configuration, - username: &str, - fingerprint: Option<&str>, - page: Option, - limit: Option, -) -> Result, Error> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_username = username; - let p_query_fingerprint = fingerprint; - let p_query_page = page; - let p_query_limit = limit; - - let uri_str = format!( - "{}/users/{username}/keys", - configuration.base_path, - username = crate::apis::urlencode(p_path_username) - ); - let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); - - if let Some(ref param_value) = p_query_fingerprint { - req_builder = req_builder.query(&[("fingerprint", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_page { - req_builder = req_builder.query(&[("page", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_limit { - req_builder = req_builder.query(&[("limit", ¶m_value.to_string())]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("access_token", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("sudo", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("token", value)]); - } - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("X-FORGEJO-OTP", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Authorization", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Sudo", value); - }; - if let Some(ref auth_conf) = configuration.basic_auth { - req_builder = req_builder.basic_auth(auth_conf.0.to_owned(), auth_conf.1.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `Vec<models::PublicKey>`"))), - ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `Vec<models::PublicKey>`")))), - } - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -pub async fn user_list_quota_artifacts( - configuration: &configuration::Configuration, - page: Option, - limit: Option, -) -> Result, Error> { - // add a prefix to parameters to efficiently prevent name collisions - let p_query_page = page; - let p_query_limit = limit; - - let uri_str = format!("{}/user/quota/artifacts", configuration.base_path); - let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); - - if let Some(ref param_value) = p_query_page { - req_builder = req_builder.query(&[("page", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_limit { - req_builder = req_builder.query(&[("limit", ¶m_value.to_string())]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("access_token", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("sudo", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("token", value)]); - } - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("X-FORGEJO-OTP", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Authorization", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Sudo", value); - }; - if let Some(ref auth_conf) = configuration.basic_auth { - req_builder = req_builder.basic_auth(auth_conf.0.to_owned(), auth_conf.1.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `Vec<models::QuotaUsedArtifact>`"))), - ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `Vec<models::QuotaUsedArtifact>`")))), - } - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -pub async fn user_list_quota_attachments( - configuration: &configuration::Configuration, - page: Option, - limit: Option, -) -> Result, Error> { - // add a prefix to parameters to efficiently prevent name collisions - let p_query_page = page; - let p_query_limit = limit; - - let uri_str = format!("{}/user/quota/attachments", configuration.base_path); - let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); - - if let Some(ref param_value) = p_query_page { - req_builder = req_builder.query(&[("page", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_limit { - req_builder = req_builder.query(&[("limit", ¶m_value.to_string())]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("access_token", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("sudo", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("token", value)]); - } - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("X-FORGEJO-OTP", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Authorization", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Sudo", value); - }; - if let Some(ref auth_conf) = configuration.basic_auth { - req_builder = req_builder.basic_auth(auth_conf.0.to_owned(), auth_conf.1.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `Vec<models::QuotaUsedAttachment>`"))), - ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `Vec<models::QuotaUsedAttachment>`")))), - } - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -pub async fn user_list_quota_packages( - configuration: &configuration::Configuration, - page: Option, - limit: Option, -) -> Result, Error> { - // add a prefix to parameters to efficiently prevent name collisions - let p_query_page = page; - let p_query_limit = limit; - - let uri_str = format!("{}/user/quota/packages", configuration.base_path); - let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); - - if let Some(ref param_value) = p_query_page { - req_builder = req_builder.query(&[("page", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_limit { - req_builder = req_builder.query(&[("limit", ¶m_value.to_string())]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("access_token", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("sudo", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("token", value)]); - } - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("X-FORGEJO-OTP", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Authorization", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Sudo", value); - }; - if let Some(ref auth_conf) = configuration.basic_auth { - req_builder = req_builder.basic_auth(auth_conf.0.to_owned(), auth_conf.1.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `Vec<models::QuotaUsedPackage>`"))), - ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `Vec<models::QuotaUsedPackage>`")))), - } - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -pub async fn user_list_repos( - configuration: &configuration::Configuration, - username: &str, - page: Option, - limit: Option, -) -> Result, Error> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_username = username; - let p_query_page = page; - let p_query_limit = limit; - - let uri_str = format!( - "{}/users/{username}/repos", - configuration.base_path, - username = crate::apis::urlencode(p_path_username) - ); - let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); - - if let Some(ref param_value) = p_query_page { - req_builder = req_builder.query(&[("page", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_limit { - req_builder = req_builder.query(&[("limit", ¶m_value.to_string())]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("access_token", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("sudo", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("token", value)]); - } - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("X-FORGEJO-OTP", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Authorization", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Sudo", value); - }; - if let Some(ref auth_conf) = configuration.basic_auth { - req_builder = req_builder.basic_auth(auth_conf.0.to_owned(), auth_conf.1.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `Vec<models::Repository>`"))), - ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `Vec<models::Repository>`")))), - } - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -pub async fn user_list_starred( - configuration: &configuration::Configuration, - username: &str, - page: Option, - limit: Option, -) -> Result, Error> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_username = username; - let p_query_page = page; - let p_query_limit = limit; - - let uri_str = format!( - "{}/users/{username}/starred", - configuration.base_path, - username = crate::apis::urlencode(p_path_username) - ); - let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); - - if let Some(ref param_value) = p_query_page { - req_builder = req_builder.query(&[("page", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_limit { - req_builder = req_builder.query(&[("limit", ¶m_value.to_string())]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("access_token", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("sudo", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("token", value)]); - } - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("X-FORGEJO-OTP", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Authorization", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Sudo", value); - }; - if let Some(ref auth_conf) = configuration.basic_auth { - req_builder = req_builder.basic_auth(auth_conf.0.to_owned(), auth_conf.1.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `Vec<models::Repository>`"))), - ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `Vec<models::Repository>`")))), - } - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -pub async fn user_list_subscriptions( - configuration: &configuration::Configuration, - username: &str, - page: Option, - limit: Option, -) -> Result, Error> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_username = username; - let p_query_page = page; - let p_query_limit = limit; - - let uri_str = format!( - "{}/users/{username}/subscriptions", - configuration.base_path, - username = crate::apis::urlencode(p_path_username) - ); - let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); - - if let Some(ref param_value) = p_query_page { - req_builder = req_builder.query(&[("page", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_limit { - req_builder = req_builder.query(&[("limit", ¶m_value.to_string())]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("access_token", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("sudo", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("token", value)]); - } - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("X-FORGEJO-OTP", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Authorization", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Sudo", value); - }; - if let Some(ref auth_conf) = configuration.basic_auth { - req_builder = req_builder.basic_auth(auth_conf.0.to_owned(), auth_conf.1.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `Vec<models::Repository>`"))), - ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `Vec<models::Repository>`")))), - } - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -pub async fn user_list_teams( - configuration: &configuration::Configuration, - page: Option, - limit: Option, -) -> Result, Error> { - // add a prefix to parameters to efficiently prevent name collisions - let p_query_page = page; - let p_query_limit = limit; - - let uri_str = format!("{}/user/teams", configuration.base_path); - let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); - - if let Some(ref param_value) = p_query_page { - req_builder = req_builder.query(&[("page", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_limit { - req_builder = req_builder.query(&[("limit", ¶m_value.to_string())]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("access_token", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("sudo", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("token", value)]); - } - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("X-FORGEJO-OTP", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Authorization", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Sudo", value); - }; - if let Some(ref auth_conf) = configuration.basic_auth { - req_builder = req_builder.basic_auth(auth_conf.0.to_owned(), auth_conf.1.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `Vec<models::Team>`"))), - ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `Vec<models::Team>`")))), - } - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -pub async fn user_search( - configuration: &configuration::Configuration, - q: Option<&str>, - uid: Option, - sort: Option<&str>, - page: Option, - limit: Option, -) -> Result> { - // add a prefix to parameters to efficiently prevent name collisions - let p_query_q = q; - let p_query_uid = uid; - let p_query_sort = sort; - let p_query_page = page; - let p_query_limit = limit; - - let uri_str = format!("{}/users/search", configuration.base_path); - let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); - - if let Some(ref param_value) = p_query_q { - req_builder = req_builder.query(&[("q", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_uid { - req_builder = req_builder.query(&[("uid", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_sort { - req_builder = req_builder.query(&[("sort", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_page { - req_builder = req_builder.query(&[("page", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_limit { - req_builder = req_builder.query(&[("limit", ¶m_value.to_string())]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("access_token", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("sudo", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("token", value)]); - } - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("X-FORGEJO-OTP", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Authorization", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Sudo", value); - }; - if let Some(ref auth_conf) = configuration.basic_auth { - req_builder = req_builder.basic_auth(auth_conf.0.to_owned(), auth_conf.1.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::UserSearchResults`"))), - ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::UserSearchResults`")))), - } - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -pub async fn user_search_run_jobs( - configuration: &configuration::Configuration, - labels: Option<&str>, -) -> Result, Error> { - // add a prefix to parameters to efficiently prevent name collisions - let p_query_labels = labels; - - let uri_str = format!("{}/user/actions/runners/jobs", configuration.base_path); - let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); - - if let Some(ref param_value) = p_query_labels { - req_builder = req_builder.query(&[("labels", ¶m_value.to_string())]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("access_token", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("sudo", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("token", value)]); - } - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("X-FORGEJO-OTP", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Authorization", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Sudo", value); - }; - if let Some(ref auth_conf) = configuration.basic_auth { - req_builder = req_builder.basic_auth(auth_conf.0.to_owned(), auth_conf.1.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `Vec<models::ActionRunJob>`"))), - ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `Vec<models::ActionRunJob>`")))), - } - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -pub async fn user_unblock_user( - configuration: &configuration::Configuration, - username: &str, -) -> Result<(), Error> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_username = username; - - let uri_str = format!( - "{}/user/unblock/{username}", - configuration.base_path, - username = crate::apis::urlencode(p_path_username) - ); - let mut req_builder = configuration.client.request(reqwest::Method::PUT, &uri_str); - - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("access_token", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("sudo", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("token", value)]); - } - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("X-FORGEJO-OTP", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Authorization", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Sudo", value); - }; - if let Some(ref auth_conf) = configuration.basic_auth { - req_builder = req_builder.basic_auth(auth_conf.0.to_owned(), auth_conf.1.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - - if !status.is_client_error() && !status.is_server_error() { - Ok(()) - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -pub async fn user_update_avatar( - configuration: &configuration::Configuration, - body: Option, -) -> Result<(), Error> { - // add a prefix to parameters to efficiently prevent name collisions - let p_body_body = body; - - let uri_str = format!("{}/user/avatar", configuration.base_path); - let mut req_builder = configuration - .client - .request(reqwest::Method::POST, &uri_str); - - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("access_token", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("sudo", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("token", value)]); - } - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("X-FORGEJO-OTP", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Authorization", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Sudo", value); - }; - if let Some(ref auth_conf) = configuration.basic_auth { - req_builder = req_builder.basic_auth(auth_conf.0.to_owned(), auth_conf.1.to_owned()); - }; - req_builder = req_builder.json(&p_body_body); - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - - if !status.is_client_error() && !status.is_server_error() { - Ok(()) - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -pub async fn user_update_o_auth2_application( - configuration: &configuration::Configuration, - id: i64, - body: models::CreateOAuth2ApplicationOptions, -) -> Result> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_id = id; - let p_body_body = body; - - let uri_str = format!( - "{}/user/applications/oauth2/{id}", - configuration.base_path, - id = p_path_id - ); - let mut req_builder = configuration - .client - .request(reqwest::Method::PATCH, &uri_str); - - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("access_token", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("sudo", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("token", value)]); - } - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("X-FORGEJO-OTP", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Authorization", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Sudo", value); - }; - if let Some(ref auth_conf) = configuration.basic_auth { - req_builder = req_builder.basic_auth(auth_conf.0.to_owned(), auth_conf.1.to_owned()); - }; - req_builder = req_builder.json(&p_body_body); - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::OAuth2Application`"))), - ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::OAuth2Application`")))), - } - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -pub async fn user_verify_gpg_key( - configuration: &configuration::Configuration, - body: Option, -) -> Result> { - // add a prefix to parameters to efficiently prevent name collisions - let p_body_body = body; - - let uri_str = format!("{}/user/gpg_key_verify", configuration.base_path); - let mut req_builder = configuration - .client - .request(reqwest::Method::POST, &uri_str); - - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("access_token", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("sudo", value)]); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.query(&[("token", value)]); - } - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("X-FORGEJO-OTP", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Authorization", value); - }; - if let Some(ref apikey) = configuration.api_key { - let key = apikey.key.clone(); - let value = match apikey.prefix { - Some(ref prefix) => format!("{} {}", prefix, key), - None => key, - }; - req_builder = req_builder.header("Sudo", value); - }; - if let Some(ref auth_conf) = configuration.basic_auth { - req_builder = req_builder.basic_auth(auth_conf.0.to_owned(), auth_conf.1.to_owned()); - }; - req_builder = req_builder.json(&p_body_body); - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::GpgKey`"))), - ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::GpgKey`")))), - } - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} diff --git a/src/lib.rs b/src/lib.rs index 9556a0a..e69de29 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -1,11 +0,0 @@ -#![allow(unused_imports)] -#![allow(clippy::too_many_arguments)] - -extern crate reqwest; -extern crate serde; -extern crate serde_json; -extern crate serde_repr; -extern crate url; - -pub mod apis; -pub mod models; diff --git a/src/models/access_token.rs b/src/models/access_token.rs deleted file mode 100644 index cd1c1af..0000000 --- a/src/models/access_token.rs +++ /dev/null @@ -1,38 +0,0 @@ -/* - * Forgejo API - * - * This documentation describes the Forgejo API. - * - * The version of the OpenAPI document: 14.0.2-2-84240ce3a2+gitea-1.22.0 - * - * Generated by: https://openapi-generator.tech - */ - -use crate::models; -use serde::{Deserialize, Serialize}; - -#[derive(Clone, Default, Debug, PartialEq, 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 = "scopes", skip_serializing_if = "Option::is_none")] - pub scopes: 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, - scopes: None, - sha1: None, - token_last_eight: None, - } - } -} diff --git a/src/models/action_run.rs b/src/models/action_run.rs deleted file mode 100644 index 5d1ef96..0000000 --- a/src/models/action_run.rs +++ /dev/null @@ -1,118 +0,0 @@ -/* - * Forgejo API - * - * This documentation describes the Forgejo API. - * - * The version of the OpenAPI document: 14.0.2-2-84240ce3a2+gitea-1.22.0 - * - * Generated by: https://openapi-generator.tech - */ - -use crate::models; -use serde::{Deserialize, Serialize}; - -/// ActionRun : ActionRun represents an action run -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct ActionRun { - /// the cron id for the schedule trigger - #[serde(rename = "ScheduleID", skip_serializing_if = "Option::is_none")] - pub schedule_id: Option, - /// who approved this action run - #[serde(rename = "approved_by", skip_serializing_if = "Option::is_none")] - pub approved_by: Option, - /// the commit sha the action run ran on - #[serde(rename = "commit_sha", skip_serializing_if = "Option::is_none")] - pub commit_sha: Option, - /// when the action run was created - #[serde(rename = "created", skip_serializing_if = "Option::is_none")] - pub created: Option, - /// A Duration represents the elapsed time between two instants as an int64 nanosecond count. The representation limits the largest representable duration to approximately 290 years. - #[serde(rename = "duration", skip_serializing_if = "Option::is_none")] - pub duration: Option, - /// the webhook event that causes the workflow to run - #[serde(rename = "event", skip_serializing_if = "Option::is_none")] - pub event: Option, - /// the payload of the webhook event that causes the workflow to run - #[serde(rename = "event_payload", skip_serializing_if = "Option::is_none")] - pub event_payload: Option, - /// the url of this action run - #[serde(rename = "html_url", skip_serializing_if = "Option::is_none")] - pub html_url: Option, - /// the action run id - #[serde(rename = "id", skip_serializing_if = "Option::is_none")] - pub id: Option, - /// a unique number for each run of a repository - #[serde(rename = "index_in_repo", skip_serializing_if = "Option::is_none")] - pub index_in_repo: Option, - /// If this is triggered by a PR from a forked repository or an untrusted user, we need to check if it is approved and limit permissions when running the workflow. - #[serde( - rename = "is_fork_pull_request", - skip_serializing_if = "Option::is_none" - )] - pub is_fork_pull_request: Option, - /// has the commit/tag/… the action run ran on been deleted - #[serde(rename = "is_ref_deleted", skip_serializing_if = "Option::is_none")] - pub is_ref_deleted: Option, - /// may need approval if it's a fork pull request - #[serde(rename = "need_approval", skip_serializing_if = "Option::is_none")] - pub need_approval: Option, - /// the commit/tag/… the action run ran on - #[serde(rename = "prettyref", skip_serializing_if = "Option::is_none")] - pub prettyref: Option, - #[serde(rename = "repository", skip_serializing_if = "Option::is_none")] - pub repository: Option>, - /// when the action run was started - #[serde(rename = "started", skip_serializing_if = "Option::is_none")] - pub started: Option, - /// the current status of this run - #[serde(rename = "status", skip_serializing_if = "Option::is_none")] - pub status: Option, - /// when the action run was stopped - #[serde(rename = "stopped", skip_serializing_if = "Option::is_none")] - pub stopped: Option, - /// the action run's title - #[serde(rename = "title", skip_serializing_if = "Option::is_none")] - pub title: Option, - /// the trigger event defined in the `on` configuration of the triggered workflow - #[serde(rename = "trigger_event", skip_serializing_if = "Option::is_none")] - pub trigger_event: Option, - #[serde(rename = "trigger_user", skip_serializing_if = "Option::is_none")] - pub trigger_user: Option>, - /// when the action run was last updated - #[serde(rename = "updated", skip_serializing_if = "Option::is_none")] - pub updated: Option, - /// the name of workflow file - #[serde(rename = "workflow_id", skip_serializing_if = "Option::is_none")] - pub workflow_id: Option, -} - -impl ActionRun { - /// ActionRun represents an action run - pub fn new() -> ActionRun { - ActionRun { - schedule_id: None, - approved_by: None, - commit_sha: None, - created: None, - duration: None, - event: None, - event_payload: None, - html_url: None, - id: None, - index_in_repo: None, - is_fork_pull_request: None, - is_ref_deleted: None, - need_approval: None, - prettyref: None, - repository: None, - started: None, - status: None, - stopped: None, - title: None, - trigger_event: None, - trigger_user: None, - updated: None, - workflow_id: None, - } - } -} diff --git a/src/models/action_run_job.rs b/src/models/action_run_job.rs deleted file mode 100644 index a66f8e4..0000000 --- a/src/models/action_run_job.rs +++ /dev/null @@ -1,57 +0,0 @@ -/* - * Forgejo API - * - * This documentation describes the Forgejo API. - * - * The version of the OpenAPI document: 14.0.2-2-84240ce3a2+gitea-1.22.0 - * - * Generated by: https://openapi-generator.tech - */ - -use crate::models; -use serde::{Deserialize, Serialize}; - -/// ActionRunJob : ActionRunJob represents a job of a run -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct ActionRunJob { - /// the action run job id - #[serde(rename = "id", skip_serializing_if = "Option::is_none")] - pub id: Option, - /// the action run job name - #[serde(rename = "name", skip_serializing_if = "Option::is_none")] - pub name: Option, - /// the action run job needed ids - #[serde(rename = "needs", skip_serializing_if = "Option::is_none")] - pub needs: Option>, - /// the owner id - #[serde(rename = "owner_id", skip_serializing_if = "Option::is_none")] - pub owner_id: Option, - /// the repository id - #[serde(rename = "repo_id", skip_serializing_if = "Option::is_none")] - pub repo_id: Option, - /// the action run job labels to run on - #[serde(rename = "runs_on", skip_serializing_if = "Option::is_none")] - pub runs_on: Option>, - /// the action run job status - #[serde(rename = "status", skip_serializing_if = "Option::is_none")] - pub status: Option, - /// the action run job latest task id - #[serde(rename = "task_id", skip_serializing_if = "Option::is_none")] - pub task_id: Option, -} - -impl ActionRunJob { - /// ActionRunJob represents a job of a run - pub fn new() -> ActionRunJob { - ActionRunJob { - id: None, - name: None, - needs: None, - owner_id: None, - repo_id: None, - runs_on: None, - status: None, - task_id: None, - } - } -} diff --git a/src/models/action_task.rs b/src/models/action_task.rs deleted file mode 100644 index aee667e..0000000 --- a/src/models/action_task.rs +++ /dev/null @@ -1,64 +0,0 @@ -/* - * Forgejo API - * - * This documentation describes the Forgejo API. - * - * The version of the OpenAPI document: 14.0.2-2-84240ce3a2+gitea-1.22.0 - * - * Generated by: https://openapi-generator.tech - */ - -use crate::models; -use serde::{Deserialize, Serialize}; - -/// ActionTask : ActionTask represents a ActionTask -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct ActionTask { - #[serde(rename = "created_at", skip_serializing_if = "Option::is_none")] - pub created_at: Option, - #[serde(rename = "display_title", skip_serializing_if = "Option::is_none")] - pub display_title: Option, - #[serde(rename = "event", skip_serializing_if = "Option::is_none")] - pub event: Option, - #[serde(rename = "head_branch", skip_serializing_if = "Option::is_none")] - pub head_branch: Option, - #[serde(rename = "head_sha", skip_serializing_if = "Option::is_none")] - pub head_sha: 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 = "run_number", skip_serializing_if = "Option::is_none")] - pub run_number: Option, - #[serde(rename = "run_started_at", skip_serializing_if = "Option::is_none")] - pub run_started_at: Option, - #[serde(rename = "status", skip_serializing_if = "Option::is_none")] - pub status: 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 = "workflow_id", skip_serializing_if = "Option::is_none")] - pub workflow_id: Option, -} - -impl ActionTask { - /// ActionTask represents a ActionTask - pub fn new() -> ActionTask { - ActionTask { - created_at: None, - display_title: None, - event: None, - head_branch: None, - head_sha: None, - id: None, - name: None, - run_number: None, - run_started_at: None, - status: None, - updated_at: None, - url: None, - workflow_id: None, - } - } -} diff --git a/src/models/action_task_response.rs b/src/models/action_task_response.rs deleted file mode 100644 index daaca0c..0000000 --- a/src/models/action_task_response.rs +++ /dev/null @@ -1,31 +0,0 @@ -/* - * Forgejo API - * - * This documentation describes the Forgejo API. - * - * The version of the OpenAPI document: 14.0.2-2-84240ce3a2+gitea-1.22.0 - * - * Generated by: https://openapi-generator.tech - */ - -use crate::models; -use serde::{Deserialize, Serialize}; - -/// ActionTaskResponse : ActionTaskResponse returns a ActionTask -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct ActionTaskResponse { - #[serde(rename = "total_count", skip_serializing_if = "Option::is_none")] - pub total_count: Option, - #[serde(rename = "workflow_runs", skip_serializing_if = "Option::is_none")] - pub workflow_runs: Option>, -} - -impl ActionTaskResponse { - /// ActionTaskResponse returns a ActionTask - pub fn new() -> ActionTaskResponse { - ActionTaskResponse { - total_count: None, - workflow_runs: None, - } - } -} diff --git a/src/models/action_variable.rs b/src/models/action_variable.rs deleted file mode 100644 index fa47539..0000000 --- a/src/models/action_variable.rs +++ /dev/null @@ -1,41 +0,0 @@ -/* - * Forgejo API - * - * This documentation describes the Forgejo API. - * - * The version of the OpenAPI document: 14.0.2-2-84240ce3a2+gitea-1.22.0 - * - * Generated by: https://openapi-generator.tech - */ - -use crate::models; -use serde::{Deserialize, Serialize}; - -/// ActionVariable : ActionVariable return value of the query API -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct ActionVariable { - /// the value of the variable - #[serde(rename = "data", skip_serializing_if = "Option::is_none")] - pub data: Option, - /// the name of the variable - #[serde(rename = "name", skip_serializing_if = "Option::is_none")] - pub name: Option, - /// the owner to which the variable belongs - #[serde(rename = "owner_id", skip_serializing_if = "Option::is_none")] - pub owner_id: Option, - /// the repository to which the variable belongs - #[serde(rename = "repo_id", skip_serializing_if = "Option::is_none")] - pub repo_id: Option, -} - -impl ActionVariable { - /// ActionVariable return value of the query API - pub fn new() -> ActionVariable { - ActionVariable { - data: None, - name: None, - owner_id: None, - repo_id: None, - } - } -} diff --git a/src/models/activity.rs b/src/models/activity.rs deleted file mode 100644 index e56f338..0000000 --- a/src/models/activity.rs +++ /dev/null @@ -1,127 +0,0 @@ -/* - * Forgejo API - * - * This documentation describes the Forgejo API. - * - * The version of the OpenAPI document: 14.0.2-2-84240ce3a2+gitea-1.22.0 - * - * Generated by: https://openapi-generator.tech - */ - -use crate::models; -use serde::{Deserialize, Serialize}; - -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct Activity { - #[serde(rename = "act_user", skip_serializing_if = "Option::is_none")] - pub act_user: Option>, - #[serde(rename = "act_user_id", skip_serializing_if = "Option::is_none")] - pub act_user_id: Option, - #[serde(rename = "comment", skip_serializing_if = "Option::is_none")] - pub comment: Option>, - #[serde(rename = "comment_id", skip_serializing_if = "Option::is_none")] - pub comment_id: Option, - #[serde(rename = "content", skip_serializing_if = "Option::is_none")] - pub content: 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 = "is_private", skip_serializing_if = "Option::is_none")] - pub is_private: Option, - /// the type of action - #[serde(rename = "op_type", skip_serializing_if = "Option::is_none")] - pub op_type: Option, - #[serde(rename = "ref_name", skip_serializing_if = "Option::is_none")] - pub ref_name: 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 = "user_id", skip_serializing_if = "Option::is_none")] - pub user_id: Option, -} - -impl Activity { - pub fn new() -> Activity { - Activity { - act_user: None, - act_user_id: None, - comment: None, - comment_id: None, - content: None, - created: None, - id: None, - is_private: None, - op_type: None, - ref_name: None, - repo: None, - repo_id: None, - user_id: None, - } - } -} -/// the type of action -#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)] -pub enum OpType { - #[serde(rename = "create_repo")] - CreateRepo, - #[serde(rename = "rename_repo")] - RenameRepo, - #[serde(rename = "star_repo")] - StarRepo, - #[serde(rename = "watch_repo")] - WatchRepo, - #[serde(rename = "commit_repo")] - CommitRepo, - #[serde(rename = "create_issue")] - CreateIssue, - #[serde(rename = "create_pull_request")] - CreatePullRequest, - #[serde(rename = "transfer_repo")] - TransferRepo, - #[serde(rename = "push_tag")] - PushTag, - #[serde(rename = "comment_issue")] - CommentIssue, - #[serde(rename = "merge_pull_request")] - MergePullRequest, - #[serde(rename = "close_issue")] - CloseIssue, - #[serde(rename = "reopen_issue")] - ReopenIssue, - #[serde(rename = "close_pull_request")] - ClosePullRequest, - #[serde(rename = "reopen_pull_request")] - ReopenPullRequest, - #[serde(rename = "delete_tag")] - DeleteTag, - #[serde(rename = "delete_branch")] - DeleteBranch, - #[serde(rename = "mirror_sync_push")] - MirrorSyncPush, - #[serde(rename = "mirror_sync_create")] - MirrorSyncCreate, - #[serde(rename = "mirror_sync_delete")] - MirrorSyncDelete, - #[serde(rename = "approve_pull_request")] - ApprovePullRequest, - #[serde(rename = "reject_pull_request")] - RejectPullRequest, - #[serde(rename = "comment_pull")] - CommentPull, - #[serde(rename = "publish_release")] - PublishRelease, - #[serde(rename = "pull_review_dismissed")] - PullReviewDismissed, - #[serde(rename = "pull_request_ready_for_review")] - PullRequestReadyForReview, - #[serde(rename = "auto_merge_pull_request")] - AutoMergePullRequest, -} - -impl Default for OpType { - fn default() -> OpType { - Self::CreateRepo - } -} diff --git a/src/models/activity_pub.rs b/src/models/activity_pub.rs deleted file mode 100644 index c75f63f..0000000 --- a/src/models/activity_pub.rs +++ /dev/null @@ -1,26 +0,0 @@ -/* - * Forgejo API - * - * This documentation describes the Forgejo API. - * - * The version of the OpenAPI document: 14.0.2-2-84240ce3a2+gitea-1.22.0 - * - * Generated by: https://openapi-generator.tech - */ - -use crate::models; -use serde::{Deserialize, Serialize}; - -/// ActivityPub : ActivityPub type -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct ActivityPub { - #[serde(rename = "@context", skip_serializing_if = "Option::is_none")] - pub at_context: Option, -} - -impl ActivityPub { - /// ActivityPub type - pub fn new() -> ActivityPub { - ActivityPub { at_context: None } - } -} diff --git a/src/models/add_collaborator_option.rs b/src/models/add_collaborator_option.rs deleted file mode 100644 index 1b35b23..0000000 --- a/src/models/add_collaborator_option.rs +++ /dev/null @@ -1,42 +0,0 @@ -/* - * Forgejo API - * - * This documentation describes the Forgejo API. - * - * The version of the OpenAPI document: 14.0.2-2-84240ce3a2+gitea-1.22.0 - * - * Generated by: https://openapi-generator.tech - */ - -use crate::models; -use serde::{Deserialize, Serialize}; - -/// AddCollaboratorOption : AddCollaboratorOption options when adding a user as a collaborator of a repository -#[derive(Clone, Default, Debug, PartialEq, 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 } - } -} -/// -#[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/src/models/add_time_option.rs b/src/models/add_time_option.rs deleted file mode 100644 index e4cfccd..0000000 --- a/src/models/add_time_option.rs +++ /dev/null @@ -1,36 +0,0 @@ -/* - * Forgejo API - * - * This documentation describes the Forgejo API. - * - * The version of the OpenAPI document: 14.0.2-2-84240ce3a2+gitea-1.22.0 - * - * Generated by: https://openapi-generator.tech - */ - -use crate::models; -use serde::{Deserialize, Serialize}; - -/// AddTimeOption : AddTimeOption options for adding time to an issue -#[derive(Clone, Default, Debug, PartialEq, 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/src/models/annotated_tag.rs b/src/models/annotated_tag.rs deleted file mode 100644 index 9b4287e..0000000 --- a/src/models/annotated_tag.rs +++ /dev/null @@ -1,52 +0,0 @@ -/* - * Forgejo API - * - * This documentation describes the Forgejo API. - * - * The version of the OpenAPI document: 14.0.2-2-84240ce3a2+gitea-1.22.0 - * - * Generated by: https://openapi-generator.tech - */ - -use crate::models; -use serde::{Deserialize, Serialize}; - -/// AnnotatedTag : AnnotatedTag represents an annotated tag -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct AnnotatedTag { - #[serde( - rename = "archive_download_count", - skip_serializing_if = "Option::is_none" - )] - pub archive_download_count: Option>, - #[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 { - archive_download_count: None, - message: None, - object: None, - sha: None, - tag: None, - tagger: None, - url: None, - verification: None, - } - } -} diff --git a/src/models/annotated_tag_object.rs b/src/models/annotated_tag_object.rs deleted file mode 100644 index 32fb267..0000000 --- a/src/models/annotated_tag_object.rs +++ /dev/null @@ -1,34 +0,0 @@ -/* - * Forgejo API - * - * This documentation describes the Forgejo API. - * - * The version of the OpenAPI document: 14.0.2-2-84240ce3a2+gitea-1.22.0 - * - * Generated by: https://openapi-generator.tech - */ - -use crate::models; -use serde::{Deserialize, Serialize}; - -/// AnnotatedTagObject : AnnotatedTagObject contains meta information of the tag object -#[derive(Clone, Default, Debug, PartialEq, 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/src/models/api_error.rs b/src/models/api_error.rs deleted file mode 100644 index 93ae89a..0000000 --- a/src/models/api_error.rs +++ /dev/null @@ -1,31 +0,0 @@ -/* - * Forgejo API - * - * This documentation describes the Forgejo API. - * - * The version of the OpenAPI document: 14.0.2-2-84240ce3a2+gitea-1.22.0 - * - * Generated by: https://openapi-generator.tech - */ - -use crate::models; -use serde::{Deserialize, Serialize}; - -/// ApiError : APIError is an api error with a message -#[derive(Clone, Default, Debug, PartialEq, 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/src/models/api_forbidden_error.rs b/src/models/api_forbidden_error.rs deleted file mode 100644 index cd5de8f..0000000 --- a/src/models/api_forbidden_error.rs +++ /dev/null @@ -1,29 +0,0 @@ -/* - * Forgejo API - * - * This documentation describes the Forgejo API. - * - * The version of the OpenAPI document: 14.0.2-2-84240ce3a2+gitea-1.22.0 - * - * Generated by: https://openapi-generator.tech - */ - -use crate::models; -use serde::{Deserialize, Serialize}; - -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct ApiForbiddenError { - #[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 ApiForbiddenError { - pub fn new() -> ApiForbiddenError { - ApiForbiddenError { - message: None, - url: None, - } - } -} diff --git a/src/models/api_internal_server_error.rs b/src/models/api_internal_server_error.rs deleted file mode 100644 index 25f3764..0000000 --- a/src/models/api_internal_server_error.rs +++ /dev/null @@ -1,29 +0,0 @@ -/* - * Forgejo API - * - * This documentation describes the Forgejo API. - * - * The version of the OpenAPI document: 14.0.2-2-84240ce3a2+gitea-1.22.0 - * - * Generated by: https://openapi-generator.tech - */ - -use crate::models; -use serde::{Deserialize, Serialize}; - -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct ApiInternalServerError { - #[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 ApiInternalServerError { - pub fn new() -> ApiInternalServerError { - ApiInternalServerError { - message: None, - url: None, - } - } -} diff --git a/src/models/api_invalid_topics_error.rs b/src/models/api_invalid_topics_error.rs deleted file mode 100644 index c2c4301..0000000 --- a/src/models/api_invalid_topics_error.rs +++ /dev/null @@ -1,29 +0,0 @@ -/* - * Forgejo API - * - * This documentation describes the Forgejo API. - * - * The version of the OpenAPI document: 14.0.2-2-84240ce3a2+gitea-1.22.0 - * - * Generated by: https://openapi-generator.tech - */ - -use crate::models; -use serde::{Deserialize, Serialize}; - -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct ApiInvalidTopicsError { - #[serde(rename = "invalidTopics", skip_serializing_if = "Option::is_none")] - pub invalid_topics: Option>, - #[serde(rename = "message", skip_serializing_if = "Option::is_none")] - pub message: Option, -} - -impl ApiInvalidTopicsError { - pub fn new() -> ApiInvalidTopicsError { - ApiInvalidTopicsError { - invalid_topics: None, - message: None, - } - } -} diff --git a/src/models/api_not_found.rs b/src/models/api_not_found.rs deleted file mode 100644 index 11d7e55..0000000 --- a/src/models/api_not_found.rs +++ /dev/null @@ -1,32 +0,0 @@ -/* - * Forgejo API - * - * This documentation describes the Forgejo API. - * - * The version of the OpenAPI document: 14.0.2-2-84240ce3a2+gitea-1.22.0 - * - * Generated by: https://openapi-generator.tech - */ - -use crate::models; -use serde::{Deserialize, Serialize}; - -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct ApiNotFound { - #[serde(rename = "errors", skip_serializing_if = "Option::is_none")] - pub errors: Option>, - #[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 ApiNotFound { - pub fn new() -> ApiNotFound { - ApiNotFound { - errors: None, - message: None, - url: None, - } - } -} diff --git a/src/models/api_repo_archived_error.rs b/src/models/api_repo_archived_error.rs deleted file mode 100644 index 1fef532..0000000 --- a/src/models/api_repo_archived_error.rs +++ /dev/null @@ -1,29 +0,0 @@ -/* - * Forgejo API - * - * This documentation describes the Forgejo API. - * - * The version of the OpenAPI document: 14.0.2-2-84240ce3a2+gitea-1.22.0 - * - * Generated by: https://openapi-generator.tech - */ - -use crate::models; -use serde::{Deserialize, Serialize}; - -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct ApiRepoArchivedError { - #[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 ApiRepoArchivedError { - pub fn new() -> ApiRepoArchivedError { - ApiRepoArchivedError { - message: None, - url: None, - } - } -} diff --git a/src/models/api_unauthorized_error.rs b/src/models/api_unauthorized_error.rs deleted file mode 100644 index 6f6d075..0000000 --- a/src/models/api_unauthorized_error.rs +++ /dev/null @@ -1,29 +0,0 @@ -/* - * Forgejo API - * - * This documentation describes the Forgejo API. - * - * The version of the OpenAPI document: 14.0.2-2-84240ce3a2+gitea-1.22.0 - * - * Generated by: https://openapi-generator.tech - */ - -use crate::models; -use serde::{Deserialize, Serialize}; - -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct ApiUnauthorizedError { - #[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 ApiUnauthorizedError { - pub fn new() -> ApiUnauthorizedError { - ApiUnauthorizedError { - message: None, - url: None, - } - } -} diff --git a/src/models/api_validation_error.rs b/src/models/api_validation_error.rs deleted file mode 100644 index 8d6a348..0000000 --- a/src/models/api_validation_error.rs +++ /dev/null @@ -1,29 +0,0 @@ -/* - * Forgejo API - * - * This documentation describes the Forgejo API. - * - * The version of the OpenAPI document: 14.0.2-2-84240ce3a2+gitea-1.22.0 - * - * Generated by: https://openapi-generator.tech - */ - -use crate::models; -use serde::{Deserialize, Serialize}; - -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct ApiValidationError { - #[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 ApiValidationError { - pub fn new() -> ApiValidationError { - ApiValidationError { - message: None, - url: None, - } - } -} diff --git a/src/models/attachment.rs b/src/models/attachment.rs deleted file mode 100644 index 0e0a832..0000000 --- a/src/models/attachment.rs +++ /dev/null @@ -1,66 +0,0 @@ -/* - * Forgejo API - * - * This documentation describes the Forgejo API. - * - * The version of the OpenAPI document: 14.0.2-2-84240ce3a2+gitea-1.22.0 - * - * Generated by: https://openapi-generator.tech - */ - -use crate::models; -use serde::{Deserialize, Serialize}; - -/// Attachment : Attachment a generic attachment -#[derive(Clone, Default, Debug, PartialEq, 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 = "type", skip_serializing_if = "Option::is_none")] - pub r#type: 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, - r#type: None, - uuid: None, - } - } -} -/// -#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)] -pub enum Type { - #[serde(rename = "attachment")] - Attachment, - #[serde(rename = "external")] - External, -} - -impl Default for Type { - fn default() -> Type { - Self::Attachment - } -} diff --git a/src/models/blocked_user.rs b/src/models/blocked_user.rs deleted file mode 100644 index cef08d6..0000000 --- a/src/models/blocked_user.rs +++ /dev/null @@ -1,29 +0,0 @@ -/* - * Forgejo API - * - * This documentation describes the Forgejo API. - * - * The version of the OpenAPI document: 14.0.2-2-84240ce3a2+gitea-1.22.0 - * - * Generated by: https://openapi-generator.tech - */ - -use crate::models; -use serde::{Deserialize, Serialize}; - -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct BlockedUser { - #[serde(rename = "block_id", skip_serializing_if = "Option::is_none")] - pub block_id: Option, - #[serde(rename = "created_at", skip_serializing_if = "Option::is_none")] - pub created_at: Option, -} - -impl BlockedUser { - pub fn new() -> BlockedUser { - BlockedUser { - block_id: None, - created_at: None, - } - } -} diff --git a/src/models/branch.rs b/src/models/branch.rs deleted file mode 100644 index 256df14..0000000 --- a/src/models/branch.rs +++ /dev/null @@ -1,61 +0,0 @@ -/* - * Forgejo API - * - * This documentation describes the Forgejo API. - * - * The version of the OpenAPI document: 14.0.2-2-84240ce3a2+gitea-1.22.0 - * - * Generated by: https://openapi-generator.tech - */ - -use crate::models; -use serde::{Deserialize, Serialize}; - -/// Branch : Branch represents a repository branch -#[derive(Clone, Default, Debug, PartialEq, 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/src/models/branch_protection.rs b/src/models/branch_protection.rs deleted file mode 100644 index 43799f9..0000000 --- a/src/models/branch_protection.rs +++ /dev/null @@ -1,167 +0,0 @@ -/* - * Forgejo API - * - * This documentation describes the Forgejo API. - * - * The version of the OpenAPI document: 14.0.2-2-84240ce3a2+gitea-1.22.0 - * - * Generated by: https://openapi-generator.tech - */ - -use crate::models; -use serde::{Deserialize, Serialize}; - -/// BranchProtection : BranchProtection represents a branch protection for a repository -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct BranchProtection { - #[serde(rename = "apply_to_admins", skip_serializing_if = "Option::is_none")] - pub apply_to_admins: Option, - #[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, - /// Deprecated: true - #[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 = "ignore_stale_approvals", - skip_serializing_if = "Option::is_none" - )] - pub ignore_stale_approvals: 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 = "rule_name", skip_serializing_if = "Option::is_none")] - pub rule_name: 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 { - apply_to_admins: None, - 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, - ignore_stale_approvals: 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, - rule_name: None, - status_check_contexts: None, - unprotected_file_patterns: None, - updated_at: None, - } - } -} diff --git a/src/models/change_file_operation.rs b/src/models/change_file_operation.rs deleted file mode 100644 index c5c892a..0000000 --- a/src/models/change_file_operation.rs +++ /dev/null @@ -1,61 +0,0 @@ -/* - * Forgejo API - * - * This documentation describes the Forgejo API. - * - * The version of the OpenAPI document: 14.0.2-2-84240ce3a2+gitea-1.22.0 - * - * Generated by: https://openapi-generator.tech - */ - -use crate::models; -use serde::{Deserialize, Serialize}; - -/// ChangeFileOperation : ChangeFileOperation for creating, updating or deleting a file -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct ChangeFileOperation { - /// new or updated file content, must be base64 encoded - #[serde(rename = "content", skip_serializing_if = "Option::is_none")] - pub content: Option, - /// old path of the file to move - #[serde(rename = "from_path", skip_serializing_if = "Option::is_none")] - pub from_path: Option, - /// indicates what to do with the file - #[serde(rename = "operation")] - pub operation: Operation, - /// path to the existing or new file - #[serde(rename = "path")] - pub path: String, - /// sha is the SHA for the file that already exists, required for update or delete - #[serde(rename = "sha", skip_serializing_if = "Option::is_none")] - pub sha: Option, -} - -impl ChangeFileOperation { - /// ChangeFileOperation for creating, updating or deleting a file - pub fn new(operation: Operation, path: String) -> ChangeFileOperation { - ChangeFileOperation { - content: None, - from_path: None, - operation, - path, - sha: None, - } - } -} -/// indicates what to do with the file -#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)] -pub enum Operation { - #[serde(rename = "create")] - Create, - #[serde(rename = "update")] - Update, - #[serde(rename = "delete")] - Delete, -} - -impl Default for Operation { - fn default() -> Operation { - Self::Create - } -} diff --git a/src/models/change_files_options.rs b/src/models/change_files_options.rs deleted file mode 100644 index ee42046..0000000 --- a/src/models/change_files_options.rs +++ /dev/null @@ -1,54 +0,0 @@ -/* - * Forgejo API - * - * This documentation describes the Forgejo API. - * - * The version of the OpenAPI document: 14.0.2-2-84240ce3a2+gitea-1.22.0 - * - * Generated by: https://openapi-generator.tech - */ - -use crate::models; -use serde::{Deserialize, Serialize}; - -/// ChangeFilesOptions : ChangeFilesOptions options for creating, updating or deleting multiple 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, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct ChangeFilesOptions { - #[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>, - /// list of file operations - #[serde(rename = "files")] - pub files: Vec, - /// 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 ChangeFilesOptions { - /// ChangeFilesOptions options for creating, updating or deleting multiple 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(files: Vec) -> ChangeFilesOptions { - ChangeFilesOptions { - author: None, - branch: None, - committer: None, - dates: None, - files, - message: None, - new_branch: None, - signoff: None, - } - } -} diff --git a/src/models/changed_file.rs b/src/models/changed_file.rs deleted file mode 100644 index 7ca11e9..0000000 --- a/src/models/changed_file.rs +++ /dev/null @@ -1,52 +0,0 @@ -/* - * Forgejo API - * - * This documentation describes the Forgejo API. - * - * The version of the OpenAPI document: 14.0.2-2-84240ce3a2+gitea-1.22.0 - * - * Generated by: https://openapi-generator.tech - */ - -use crate::models; -use serde::{Deserialize, Serialize}; - -/// ChangedFile : ChangedFile store information about files affected by the pull request -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct ChangedFile { - #[serde(rename = "additions", skip_serializing_if = "Option::is_none")] - pub additions: Option, - #[serde(rename = "changes", skip_serializing_if = "Option::is_none")] - pub changes: Option, - #[serde(rename = "contents_url", skip_serializing_if = "Option::is_none")] - pub contents_url: Option, - #[serde(rename = "deletions", skip_serializing_if = "Option::is_none")] - pub deletions: Option, - #[serde(rename = "filename", skip_serializing_if = "Option::is_none")] - pub filename: Option, - #[serde(rename = "html_url", skip_serializing_if = "Option::is_none")] - pub html_url: Option, - #[serde(rename = "previous_filename", skip_serializing_if = "Option::is_none")] - pub previous_filename: Option, - #[serde(rename = "raw_url", skip_serializing_if = "Option::is_none")] - pub raw_url: Option, - #[serde(rename = "status", skip_serializing_if = "Option::is_none")] - pub status: Option, -} - -impl ChangedFile { - /// ChangedFile store information about files affected by the pull request - pub fn new() -> ChangedFile { - ChangedFile { - additions: None, - changes: None, - contents_url: None, - deletions: None, - filename: None, - html_url: None, - previous_filename: None, - raw_url: None, - status: None, - } - } -} diff --git a/src/models/combined_status.rs b/src/models/combined_status.rs deleted file mode 100644 index c104ef6..0000000 --- a/src/models/combined_status.rs +++ /dev/null @@ -1,47 +0,0 @@ -/* - * Forgejo API - * - * This documentation describes the Forgejo API. - * - * The version of the OpenAPI document: 14.0.2-2-84240ce3a2+gitea-1.22.0 - * - * Generated by: https://openapi-generator.tech - */ - -use crate::models; -use serde::{Deserialize, Serialize}; - -/// CombinedStatus : CombinedStatus holds the combined state of several statuses for a single commit -#[derive(Clone, Default, Debug, PartialEq, 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/src/models/comment.rs b/src/models/comment.rs deleted file mode 100644 index 944cf53..0000000 --- a/src/models/comment.rs +++ /dev/null @@ -1,58 +0,0 @@ -/* - * Forgejo API - * - * This documentation describes the Forgejo API. - * - * The version of the OpenAPI document: 14.0.2-2-84240ce3a2+gitea-1.22.0 - * - * Generated by: https://openapi-generator.tech - */ - -use crate::models; -use serde::{Deserialize, Serialize}; - -/// Comment : Comment represents a comment on a commit or issue -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct Comment { - #[serde(rename = "assets", skip_serializing_if = "Option::is_none")] - pub assets: 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 = "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 { - assets: None, - 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/src/models/commit.rs b/src/models/commit.rs deleted file mode 100644 index bd283a2..0000000 --- a/src/models/commit.rs +++ /dev/null @@ -1,53 +0,0 @@ -/* - * Forgejo API - * - * This documentation describes the Forgejo API. - * - * The version of the OpenAPI document: 14.0.2-2-84240ce3a2+gitea-1.22.0 - * - * Generated by: https://openapi-generator.tech - */ - -use crate::models; -use serde::{Deserialize, Serialize}; - -#[derive(Clone, Default, Debug, PartialEq, 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/src/models/commit_affected_files.rs b/src/models/commit_affected_files.rs deleted file mode 100644 index ac29723..0000000 --- a/src/models/commit_affected_files.rs +++ /dev/null @@ -1,31 +0,0 @@ -/* - * Forgejo API - * - * This documentation describes the Forgejo API. - * - * The version of the OpenAPI document: 14.0.2-2-84240ce3a2+gitea-1.22.0 - * - * Generated by: https://openapi-generator.tech - */ - -use crate::models; -use serde::{Deserialize, Serialize}; - -/// CommitAffectedFiles : CommitAffectedFiles store information about files affected by the commit -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct CommitAffectedFiles { - #[serde(rename = "filename", skip_serializing_if = "Option::is_none")] - pub filename: Option, - #[serde(rename = "status", skip_serializing_if = "Option::is_none")] - pub status: Option, -} - -impl CommitAffectedFiles { - /// CommitAffectedFiles store information about files affected by the commit - pub fn new() -> CommitAffectedFiles { - CommitAffectedFiles { - filename: None, - status: None, - } - } -} diff --git a/src/models/commit_date_options.rs b/src/models/commit_date_options.rs deleted file mode 100644 index 071dc0e..0000000 --- a/src/models/commit_date_options.rs +++ /dev/null @@ -1,31 +0,0 @@ -/* - * Forgejo API - * - * This documentation describes the Forgejo API. - * - * The version of the OpenAPI document: 14.0.2-2-84240ce3a2+gitea-1.22.0 - * - * Generated by: https://openapi-generator.tech - */ - -use crate::models; -use serde::{Deserialize, Serialize}; - -/// CommitDateOptions : CommitDateOptions store dates for GIT_AUTHOR_DATE and GIT_COMMITTER_DATE -#[derive(Clone, Default, Debug, PartialEq, 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/src/models/commit_meta.rs b/src/models/commit_meta.rs deleted file mode 100644 index 9f7d490..0000000 --- a/src/models/commit_meta.rs +++ /dev/null @@ -1,32 +0,0 @@ -/* - * Forgejo API - * - * This documentation describes the Forgejo API. - * - * The version of the OpenAPI document: 14.0.2-2-84240ce3a2+gitea-1.22.0 - * - * Generated by: https://openapi-generator.tech - */ - -use crate::models; -use serde::{Deserialize, Serialize}; - -#[derive(Clone, Default, Debug, PartialEq, 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/src/models/commit_stats.rs b/src/models/commit_stats.rs deleted file mode 100644 index d77247b..0000000 --- a/src/models/commit_stats.rs +++ /dev/null @@ -1,34 +0,0 @@ -/* - * Forgejo API - * - * This documentation describes the Forgejo API. - * - * The version of the OpenAPI document: 14.0.2-2-84240ce3a2+gitea-1.22.0 - * - * Generated by: https://openapi-generator.tech - */ - -use crate::models; -use serde::{Deserialize, Serialize}; - -/// CommitStats : CommitStats is statistics for a RepoCommit -#[derive(Clone, Default, Debug, PartialEq, 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/src/models/commit_status.rs b/src/models/commit_status.rs deleted file mode 100644 index 5ff9318..0000000 --- a/src/models/commit_status.rs +++ /dev/null @@ -1,53 +0,0 @@ -/* - * Forgejo API - * - * This documentation describes the Forgejo API. - * - * The version of the OpenAPI document: 14.0.2-2-84240ce3a2+gitea-1.22.0 - * - * Generated by: https://openapi-generator.tech - */ - -use crate::models; -use serde::{Deserialize, Serialize}; - -/// CommitStatus : CommitStatus holds a single status of a single Commit -#[derive(Clone, Default, Debug, PartialEq, 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/src/models/commit_user.rs b/src/models/commit_user.rs deleted file mode 100644 index f07d4b0..0000000 --- a/src/models/commit_user.rs +++ /dev/null @@ -1,32 +0,0 @@ -/* - * Forgejo API - * - * This documentation describes the Forgejo API. - * - * The version of the OpenAPI document: 14.0.2-2-84240ce3a2+gitea-1.22.0 - * - * Generated by: https://openapi-generator.tech - */ - -use crate::models; -use serde::{Deserialize, Serialize}; - -#[derive(Clone, Default, Debug, PartialEq, 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/src/models/compare.rs b/src/models/compare.rs deleted file mode 100644 index 71e47ac..0000000 --- a/src/models/compare.rs +++ /dev/null @@ -1,32 +0,0 @@ -/* - * Forgejo API - * - * This documentation describes the Forgejo API. - * - * The version of the OpenAPI document: 14.0.2-2-84240ce3a2+gitea-1.22.0 - * - * Generated by: https://openapi-generator.tech - */ - -use crate::models; -use serde::{Deserialize, Serialize}; - -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct Compare { - #[serde(rename = "commits", skip_serializing_if = "Option::is_none")] - pub commits: Option>, - #[serde(rename = "files", skip_serializing_if = "Option::is_none")] - pub files: Option>, - #[serde(rename = "total_commits", skip_serializing_if = "Option::is_none")] - pub total_commits: Option, -} - -impl Compare { - pub fn new() -> Compare { - Compare { - commits: None, - files: None, - total_commits: None, - } - } -} diff --git a/src/models/contents_response.rs b/src/models/contents_response.rs deleted file mode 100644 index 55f6b68..0000000 --- a/src/models/contents_response.rs +++ /dev/null @@ -1,78 +0,0 @@ -/* - * Forgejo API - * - * This documentation describes the Forgejo API. - * - * The version of the OpenAPI document: 14.0.2-2-84240ce3a2+gitea-1.22.0 - * - * Generated by: https://openapi-generator.tech - */ - -use crate::models; -use serde::{Deserialize, Serialize}; - -/// ContentsResponse : ContentsResponse contains information about a repo's entry's (dir, file, symlink, submodule) metadata and content -#[derive(Clone, Default, Debug, PartialEq, 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 = "last_commit_sha", skip_serializing_if = "Option::is_none")] - pub last_commit_sha: Option, - #[serde(rename = "last_commit_when", skip_serializing_if = "Option::is_none")] - pub last_commit_when: 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, - last_commit_sha: None, - last_commit_when: None, - name: None, - path: None, - sha: None, - size: None, - submodule_git_url: None, - target: None, - r#type: None, - url: None, - } - } -} diff --git a/src/models/create_access_token_option.rs b/src/models/create_access_token_option.rs deleted file mode 100644 index 30a0ce7..0000000 --- a/src/models/create_access_token_option.rs +++ /dev/null @@ -1,28 +0,0 @@ -/* - * Forgejo API - * - * This documentation describes the Forgejo API. - * - * The version of the OpenAPI document: 14.0.2-2-84240ce3a2+gitea-1.22.0 - * - * Generated by: https://openapi-generator.tech - */ - -use crate::models; -use serde::{Deserialize, Serialize}; - -/// CreateAccessTokenOption : CreateAccessTokenOption options when create access token -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct CreateAccessTokenOption { - #[serde(rename = "name")] - pub name: String, - #[serde(rename = "scopes", skip_serializing_if = "Option::is_none")] - pub scopes: Option>, -} - -impl CreateAccessTokenOption { - /// CreateAccessTokenOption options when create access token - pub fn new(name: String) -> CreateAccessTokenOption { - CreateAccessTokenOption { name, scopes: None } - } -} diff --git a/src/models/create_branch_protection_option.rs b/src/models/create_branch_protection_option.rs deleted file mode 100644 index 1a3fdc5..0000000 --- a/src/models/create_branch_protection_option.rs +++ /dev/null @@ -1,161 +0,0 @@ -/* - * Forgejo API - * - * This documentation describes the Forgejo API. - * - * The version of the OpenAPI document: 14.0.2-2-84240ce3a2+gitea-1.22.0 - * - * Generated by: https://openapi-generator.tech - */ - -use crate::models; -use serde::{Deserialize, Serialize}; - -/// CreateBranchProtectionOption : CreateBranchProtectionOption options for creating a branch protection -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct CreateBranchProtectionOption { - #[serde(rename = "apply_to_admins", skip_serializing_if = "Option::is_none")] - pub apply_to_admins: Option, - #[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, - /// Deprecated: true - #[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 = "ignore_stale_approvals", - skip_serializing_if = "Option::is_none" - )] - pub ignore_stale_approvals: 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 = "rule_name", skip_serializing_if = "Option::is_none")] - pub rule_name: 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 { - apply_to_admins: None, - 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, - ignore_stale_approvals: 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, - rule_name: None, - status_check_contexts: None, - unprotected_file_patterns: None, - } - } -} diff --git a/src/models/create_branch_repo_option.rs b/src/models/create_branch_repo_option.rs deleted file mode 100644 index 4bad27d..0000000 --- a/src/models/create_branch_repo_option.rs +++ /dev/null @@ -1,37 +0,0 @@ -/* - * Forgejo API - * - * This documentation describes the Forgejo API. - * - * The version of the OpenAPI document: 14.0.2-2-84240ce3a2+gitea-1.22.0 - * - * Generated by: https://openapi-generator.tech - */ - -use crate::models; -use serde::{Deserialize, Serialize}; - -/// CreateBranchRepoOption : CreateBranchRepoOption options when creating a branch in a repository -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct CreateBranchRepoOption { - /// Name of the branch to create - #[serde(rename = "new_branch_name")] - pub new_branch_name: String, - /// Deprecated: true Name of the old branch to create from - #[serde(rename = "old_branch_name", skip_serializing_if = "Option::is_none")] - pub old_branch_name: Option, - /// Name of the old branch/tag/commit to create from - #[serde(rename = "old_ref_name", skip_serializing_if = "Option::is_none")] - pub old_ref_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, - old_ref_name: None, - } - } -} diff --git a/src/models/create_email_option.rs b/src/models/create_email_option.rs deleted file mode 100644 index 1c68c83..0000000 --- a/src/models/create_email_option.rs +++ /dev/null @@ -1,27 +0,0 @@ -/* - * Forgejo API - * - * This documentation describes the Forgejo API. - * - * The version of the OpenAPI document: 14.0.2-2-84240ce3a2+gitea-1.22.0 - * - * Generated by: https://openapi-generator.tech - */ - -use crate::models; -use serde::{Deserialize, Serialize}; - -/// CreateEmailOption : CreateEmailOption options when creating email addresses -#[derive(Clone, Default, Debug, PartialEq, 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/src/models/create_file_options.rs b/src/models/create_file_options.rs deleted file mode 100644 index d3b3387..0000000 --- a/src/models/create_file_options.rs +++ /dev/null @@ -1,54 +0,0 @@ -/* - * Forgejo API - * - * This documentation describes the Forgejo API. - * - * The version of the OpenAPI document: 14.0.2-2-84240ce3a2+gitea-1.22.0 - * - * Generated by: https://openapi-generator.tech - */ - -use crate::models; -use serde::{Deserialize, Serialize}; - -/// 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, Default, Debug, PartialEq, 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/src/models/create_fork_option.rs b/src/models/create_fork_option.rs deleted file mode 100644 index 33058b2..0000000 --- a/src/models/create_fork_option.rs +++ /dev/null @@ -1,33 +0,0 @@ -/* - * Forgejo API - * - * This documentation describes the Forgejo API. - * - * The version of the OpenAPI document: 14.0.2-2-84240ce3a2+gitea-1.22.0 - * - * Generated by: https://openapi-generator.tech - */ - -use crate::models; -use serde::{Deserialize, Serialize}; - -/// CreateForkOption : CreateForkOption options for creating a fork -#[derive(Clone, Default, Debug, PartialEq, 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/src/models/create_gpg_key_option.rs b/src/models/create_gpg_key_option.rs deleted file mode 100644 index f259f7b..0000000 --- a/src/models/create_gpg_key_option.rs +++ /dev/null @@ -1,32 +0,0 @@ -/* - * Forgejo API - * - * This documentation describes the Forgejo API. - * - * The version of the OpenAPI document: 14.0.2-2-84240ce3a2+gitea-1.22.0 - * - * Generated by: https://openapi-generator.tech - */ - -use crate::models; -use serde::{Deserialize, Serialize}; - -/// CreateGpgKeyOption : CreateGPGKeyOption options create user GPG key -#[derive(Clone, Default, Debug, PartialEq, 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/src/models/create_hook_option.rs b/src/models/create_hook_option.rs deleted file mode 100644 index 7992d7f..0000000 --- a/src/models/create_hook_option.rs +++ /dev/null @@ -1,82 +0,0 @@ -/* - * Forgejo API - * - * This documentation describes the Forgejo API. - * - * The version of the OpenAPI document: 14.0.2-2-84240ce3a2+gitea-1.22.0 - * - * Generated by: https://openapi-generator.tech - */ - -use crate::models; -use serde::{Deserialize, Serialize}; - -/// CreateHookOption : CreateHookOption options when create a hook -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct CreateHookOption { - #[serde(rename = "active", skip_serializing_if = "Option::is_none")] - pub active: Option, - #[serde( - rename = "authorization_header", - skip_serializing_if = "Option::is_none" - )] - pub authorization_header: 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: Type, -} - -impl CreateHookOption { - /// CreateHookOption options when create a hook - pub fn new( - config: std::collections::HashMap, - r#type: Type, - ) -> CreateHookOption { - CreateHookOption { - active: None, - authorization_header: None, - branch_filter: None, - config, - events: None, - r#type, - } - } -} -/// -#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)] -pub enum Type { - #[serde(rename = "forgejo")] - Forgejo, - #[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 Type { - fn default() -> Type { - Self::Forgejo - } -} diff --git a/src/models/create_issue_comment_option.rs b/src/models/create_issue_comment_option.rs deleted file mode 100644 index 1cf890d..0000000 --- a/src/models/create_issue_comment_option.rs +++ /dev/null @@ -1,31 +0,0 @@ -/* - * Forgejo API - * - * This documentation describes the Forgejo API. - * - * The version of the OpenAPI document: 14.0.2-2-84240ce3a2+gitea-1.22.0 - * - * Generated by: https://openapi-generator.tech - */ - -use crate::models; -use serde::{Deserialize, Serialize}; - -/// CreateIssueCommentOption : CreateIssueCommentOption options for creating a comment on an issue -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct CreateIssueCommentOption { - #[serde(rename = "body")] - pub body: String, - #[serde(rename = "updated_at", skip_serializing_if = "Option::is_none")] - pub updated_at: Option, -} - -impl CreateIssueCommentOption { - /// CreateIssueCommentOption options for creating a comment on an issue - pub fn new(body: String) -> CreateIssueCommentOption { - CreateIssueCommentOption { - body, - updated_at: None, - } - } -} diff --git a/src/models/create_issue_option.rs b/src/models/create_issue_option.rs deleted file mode 100644 index a768c2d..0000000 --- a/src/models/create_issue_option.rs +++ /dev/null @@ -1,55 +0,0 @@ -/* - * Forgejo API - * - * This documentation describes the Forgejo API. - * - * The version of the OpenAPI document: 14.0.2-2-84240ce3a2+gitea-1.22.0 - * - * Generated by: https://openapi-generator.tech - */ - -use crate::models; -use serde::{Deserialize, Serialize}; - -/// CreateIssueOption : CreateIssueOption options to create one issue -#[derive(Clone, Default, Debug, PartialEq, 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/src/models/create_key_option.rs b/src/models/create_key_option.rs deleted file mode 100644 index 0d1e558..0000000 --- a/src/models/create_key_option.rs +++ /dev/null @@ -1,37 +0,0 @@ -/* - * Forgejo API - * - * This documentation describes the Forgejo API. - * - * The version of the OpenAPI document: 14.0.2-2-84240ce3a2+gitea-1.22.0 - * - * Generated by: https://openapi-generator.tech - */ - -use crate::models; -use serde::{Deserialize, Serialize}; - -/// CreateKeyOption : CreateKeyOption options when creating a key -#[derive(Clone, Default, Debug, PartialEq, 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/src/models/create_label_option.rs b/src/models/create_label_option.rs deleted file mode 100644 index 511c7b9..0000000 --- a/src/models/create_label_option.rs +++ /dev/null @@ -1,40 +0,0 @@ -/* - * Forgejo API - * - * This documentation describes the Forgejo API. - * - * The version of the OpenAPI document: 14.0.2-2-84240ce3a2+gitea-1.22.0 - * - * Generated by: https://openapi-generator.tech - */ - -use crate::models; -use serde::{Deserialize, Serialize}; - -/// CreateLabelOption : CreateLabelOption options for creating a label -#[derive(Clone, Default, Debug, PartialEq, 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 = "exclusive", skip_serializing_if = "Option::is_none")] - pub exclusive: Option, - #[serde(rename = "is_archived", skip_serializing_if = "Option::is_none")] - pub is_archived: 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, - exclusive: None, - is_archived: None, - name, - } - } -} diff --git a/src/models/create_milestone_option.rs b/src/models/create_milestone_option.rs deleted file mode 100644 index 1a07d81..0000000 --- a/src/models/create_milestone_option.rs +++ /dev/null @@ -1,51 +0,0 @@ -/* - * Forgejo API - * - * This documentation describes the Forgejo API. - * - * The version of the OpenAPI document: 14.0.2-2-84240ce3a2+gitea-1.22.0 - * - * Generated by: https://openapi-generator.tech - */ - -use crate::models; -use serde::{Deserialize, Serialize}; - -/// CreateMilestoneOption : CreateMilestoneOption options for creating a milestone -#[derive(Clone, Default, Debug, PartialEq, 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/src/models/create_o_auth2_application_options.rs b/src/models/create_o_auth2_application_options.rs deleted file mode 100644 index ae05bef..0000000 --- a/src/models/create_o_auth2_application_options.rs +++ /dev/null @@ -1,37 +0,0 @@ -/* - * Forgejo API - * - * This documentation describes the Forgejo API. - * - * The version of the OpenAPI document: 14.0.2-2-84240ce3a2+gitea-1.22.0 - * - * Generated by: https://openapi-generator.tech - */ - -use crate::models; -use serde::{Deserialize, Serialize}; - -/// CreateOAuth2ApplicationOptions : CreateOAuth2ApplicationOptions holds options to create an oauth2 application -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct CreateOAuth2ApplicationOptions { - #[serde( - rename = "confidential_client", - skip_serializing_if = "Option::is_none" - )] - pub confidential_client: 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 CreateOAuth2ApplicationOptions { - /// CreateOAuth2ApplicationOptions holds options to create an oauth2 application - pub fn new() -> CreateOAuth2ApplicationOptions { - CreateOAuth2ApplicationOptions { - confidential_client: None, - name: None, - redirect_uris: None, - } - } -} diff --git a/src/models/create_or_update_secret_option.rs b/src/models/create_or_update_secret_option.rs deleted file mode 100644 index e8839dc..0000000 --- a/src/models/create_or_update_secret_option.rs +++ /dev/null @@ -1,27 +0,0 @@ -/* - * Forgejo API - * - * This documentation describes the Forgejo API. - * - * The version of the OpenAPI document: 14.0.2-2-84240ce3a2+gitea-1.22.0 - * - * Generated by: https://openapi-generator.tech - */ - -use crate::models; -use serde::{Deserialize, Serialize}; - -/// CreateOrUpdateSecretOption : CreateOrUpdateSecretOption options when creating or updating secret -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct CreateOrUpdateSecretOption { - /// Data of the secret to update - #[serde(rename = "data")] - pub data: String, -} - -impl CreateOrUpdateSecretOption { - /// CreateOrUpdateSecretOption options when creating or updating secret - pub fn new(data: String) -> CreateOrUpdateSecretOption { - CreateOrUpdateSecretOption { data } - } -} diff --git a/src/models/create_org_option.rs b/src/models/create_org_option.rs deleted file mode 100644 index 0bdf172..0000000 --- a/src/models/create_org_option.rs +++ /dev/null @@ -1,69 +0,0 @@ -/* - * Forgejo API - * - * This documentation describes the Forgejo API. - * - * The version of the OpenAPI document: 14.0.2-2-84240ce3a2+gitea-1.22.0 - * - * Generated by: https://openapi-generator.tech - */ - -use crate::models; -use serde::{Deserialize, Serialize}; - -/// CreateOrgOption : CreateOrgOption options for creating an organization -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct CreateOrgOption { - #[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 = "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, - email: 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/src/models/create_pull_request_option.rs b/src/models/create_pull_request_option.rs deleted file mode 100644 index f73f069..0000000 --- a/src/models/create_pull_request_option.rs +++ /dev/null @@ -1,52 +0,0 @@ -/* - * Forgejo API - * - * This documentation describes the Forgejo API. - * - * The version of the OpenAPI document: 14.0.2-2-84240ce3a2+gitea-1.22.0 - * - * Generated by: https://openapi-generator.tech - */ - -use crate::models; -use serde::{Deserialize, Serialize}; - -/// CreatePullRequestOption : CreatePullRequestOption options when creating a pull request -#[derive(Clone, Default, Debug, PartialEq, 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/src/models/create_pull_review_comment.rs b/src/models/create_pull_review_comment.rs deleted file mode 100644 index 952dd67..0000000 --- a/src/models/create_pull_review_comment.rs +++ /dev/null @@ -1,40 +0,0 @@ -/* - * Forgejo API - * - * This documentation describes the Forgejo API. - * - * The version of the OpenAPI document: 14.0.2-2-84240ce3a2+gitea-1.22.0 - * - * Generated by: https://openapi-generator.tech - */ - -use crate::models; -use serde::{Deserialize, Serialize}; - -/// CreatePullReviewComment : CreatePullReviewComment represent a review comment for creation api -#[derive(Clone, Default, Debug, PartialEq, 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/src/models/create_pull_review_options.rs b/src/models/create_pull_review_options.rs deleted file mode 100644 index 31eed95..0000000 --- a/src/models/create_pull_review_options.rs +++ /dev/null @@ -1,38 +0,0 @@ -/* - * Forgejo API - * - * This documentation describes the Forgejo API. - * - * The version of the OpenAPI document: 14.0.2-2-84240ce3a2+gitea-1.22.0 - * - * Generated by: https://openapi-generator.tech - */ - -use crate::models; -use serde::{Deserialize, Serialize}; - -/// CreatePullReviewOptions : CreatePullReviewOptions are options to create a pull review -#[derive(Clone, Default, Debug, PartialEq, 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/src/models/create_push_mirror_option.rs b/src/models/create_push_mirror_option.rs deleted file mode 100644 index 41818f9..0000000 --- a/src/models/create_push_mirror_option.rs +++ /dev/null @@ -1,44 +0,0 @@ -/* - * Forgejo API - * - * This documentation describes the Forgejo API. - * - * The version of the OpenAPI document: 14.0.2-2-84240ce3a2+gitea-1.22.0 - * - * Generated by: https://openapi-generator.tech - */ - -use crate::models; -use serde::{Deserialize, Serialize}; - -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct CreatePushMirrorOption { - #[serde(rename = "branch_filter", skip_serializing_if = "Option::is_none")] - pub branch_filter: Option, - #[serde(rename = "interval", skip_serializing_if = "Option::is_none")] - pub interval: Option, - #[serde(rename = "remote_address", skip_serializing_if = "Option::is_none")] - pub remote_address: Option, - #[serde(rename = "remote_password", skip_serializing_if = "Option::is_none")] - pub remote_password: Option, - #[serde(rename = "remote_username", skip_serializing_if = "Option::is_none")] - pub remote_username: Option, - #[serde(rename = "sync_on_commit", skip_serializing_if = "Option::is_none")] - pub sync_on_commit: Option, - #[serde(rename = "use_ssh", skip_serializing_if = "Option::is_none")] - pub use_ssh: Option, -} - -impl CreatePushMirrorOption { - pub fn new() -> CreatePushMirrorOption { - CreatePushMirrorOption { - branch_filter: None, - interval: None, - remote_address: None, - remote_password: None, - remote_username: None, - sync_on_commit: None, - use_ssh: None, - } - } -} diff --git a/src/models/create_quota_group_options.rs b/src/models/create_quota_group_options.rs deleted file mode 100644 index a42f070..0000000 --- a/src/models/create_quota_group_options.rs +++ /dev/null @@ -1,33 +0,0 @@ -/* - * Forgejo API - * - * This documentation describes the Forgejo API. - * - * The version of the OpenAPI document: 14.0.2-2-84240ce3a2+gitea-1.22.0 - * - * Generated by: https://openapi-generator.tech - */ - -use crate::models; -use serde::{Deserialize, Serialize}; - -/// CreateQuotaGroupOptions : CreateQutaGroupOptions represents the options for creating a quota group -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct CreateQuotaGroupOptions { - /// Name of the quota group to create - #[serde(rename = "name", skip_serializing_if = "Option::is_none")] - pub name: Option, - /// Rules to add to the newly created group. If a rule does not exist, it will be created. - #[serde(rename = "rules", skip_serializing_if = "Option::is_none")] - pub rules: Option>, -} - -impl CreateQuotaGroupOptions { - /// CreateQutaGroupOptions represents the options for creating a quota group - pub fn new() -> CreateQuotaGroupOptions { - CreateQuotaGroupOptions { - name: None, - rules: None, - } - } -} diff --git a/src/models/create_quota_rule_options.rs b/src/models/create_quota_rule_options.rs deleted file mode 100644 index 67815b1..0000000 --- a/src/models/create_quota_rule_options.rs +++ /dev/null @@ -1,37 +0,0 @@ -/* - * Forgejo API - * - * This documentation describes the Forgejo API. - * - * The version of the OpenAPI document: 14.0.2-2-84240ce3a2+gitea-1.22.0 - * - * Generated by: https://openapi-generator.tech - */ - -use crate::models; -use serde::{Deserialize, Serialize}; - -/// CreateQuotaRuleOptions : CreateQuotaRuleOptions represents the options for creating a quota rule -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct CreateQuotaRuleOptions { - /// The limit set by the rule - #[serde(rename = "limit", skip_serializing_if = "Option::is_none")] - pub limit: Option, - /// Name of the rule to create - #[serde(rename = "name", skip_serializing_if = "Option::is_none")] - pub name: Option, - /// The subjects affected by the rule - #[serde(rename = "subjects", skip_serializing_if = "Option::is_none")] - pub subjects: Option>, -} - -impl CreateQuotaRuleOptions { - /// CreateQuotaRuleOptions represents the options for creating a quota rule - pub fn new() -> CreateQuotaRuleOptions { - CreateQuotaRuleOptions { - limit: None, - name: None, - subjects: None, - } - } -} diff --git a/src/models/create_release_option.rs b/src/models/create_release_option.rs deleted file mode 100644 index 1c7d999..0000000 --- a/src/models/create_release_option.rs +++ /dev/null @@ -1,46 +0,0 @@ -/* - * Forgejo API - * - * This documentation describes the Forgejo API. - * - * The version of the OpenAPI document: 14.0.2-2-84240ce3a2+gitea-1.22.0 - * - * Generated by: https://openapi-generator.tech - */ - -use crate::models; -use serde::{Deserialize, Serialize}; - -/// CreateReleaseOption : CreateReleaseOption options when creating a release -#[derive(Clone, Default, Debug, PartialEq, 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 = "hide_archive_links", skip_serializing_if = "Option::is_none")] - pub hide_archive_links: 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, - hide_archive_links: None, - name: None, - prerelease: None, - tag_name, - target_commitish: None, - } - } -} diff --git a/src/models/create_repo_option.rs b/src/models/create_repo_option.rs deleted file mode 100644 index e9eecbc..0000000 --- a/src/models/create_repo_option.rs +++ /dev/null @@ -1,105 +0,0 @@ -/* - * Forgejo API - * - * This documentation describes the Forgejo API. - * - * The version of the OpenAPI document: 14.0.2-2-84240ce3a2+gitea-1.22.0 - * - * Generated by: https://openapi-generator.tech - */ - -use crate::models; -use serde::{Deserialize, Serialize}; - -/// CreateRepoOption : CreateRepoOption options when creating repository -#[derive(Clone, Default, Debug, PartialEq, 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, - /// ObjectFormatName of the underlying git repository - #[serde(rename = "object_format_name", skip_serializing_if = "Option::is_none")] - pub object_format_name: Option, - /// 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, - object_format_name: None, - private: None, - readme: None, - template: None, - trust_model: None, - } - } -} -/// ObjectFormatName of the underlying git repository -#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)] -pub enum ObjectFormatName { - #[serde(rename = "sha1")] - Sha1, - #[serde(rename = "sha256")] - Sha256, -} - -impl Default for ObjectFormatName { - fn default() -> ObjectFormatName { - Self::Sha1 - } -} -/// 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/src/models/create_status_option.rs b/src/models/create_status_option.rs deleted file mode 100644 index 6e8cbc8..0000000 --- a/src/models/create_status_option.rs +++ /dev/null @@ -1,38 +0,0 @@ -/* - * Forgejo API - * - * This documentation describes the Forgejo API. - * - * The version of the OpenAPI document: 14.0.2-2-84240ce3a2+gitea-1.22.0 - * - * Generated by: https://openapi-generator.tech - */ - -use crate::models; -use serde::{Deserialize, Serialize}; - -/// CreateStatusOption : CreateStatusOption holds the information needed to create a new CommitStatus for a Commit -#[derive(Clone, Default, Debug, PartialEq, 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/src/models/create_tag_option.rs b/src/models/create_tag_option.rs deleted file mode 100644 index b708f86..0000000 --- a/src/models/create_tag_option.rs +++ /dev/null @@ -1,34 +0,0 @@ -/* - * Forgejo API - * - * This documentation describes the Forgejo API. - * - * The version of the OpenAPI document: 14.0.2-2-84240ce3a2+gitea-1.22.0 - * - * Generated by: https://openapi-generator.tech - */ - -use crate::models; -use serde::{Deserialize, Serialize}; - -/// CreateTagOption : CreateTagOption options when creating a tag -#[derive(Clone, Default, Debug, PartialEq, 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/src/models/create_tag_protection_option.rs b/src/models/create_tag_protection_option.rs deleted file mode 100644 index 28c2443..0000000 --- a/src/models/create_tag_protection_option.rs +++ /dev/null @@ -1,37 +0,0 @@ -/* - * Forgejo API - * - * This documentation describes the Forgejo API. - * - * The version of the OpenAPI document: 14.0.2-2-84240ce3a2+gitea-1.22.0 - * - * Generated by: https://openapi-generator.tech - */ - -use crate::models; -use serde::{Deserialize, Serialize}; - -/// CreateTagProtectionOption : CreateTagProtectionOption options for creating a tag protection -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct CreateTagProtectionOption { - #[serde(rename = "name_pattern", skip_serializing_if = "Option::is_none")] - pub name_pattern: Option, - #[serde(rename = "whitelist_teams", skip_serializing_if = "Option::is_none")] - pub whitelist_teams: Option>, - #[serde( - rename = "whitelist_usernames", - skip_serializing_if = "Option::is_none" - )] - pub whitelist_usernames: Option>, -} - -impl CreateTagProtectionOption { - /// CreateTagProtectionOption options for creating a tag protection - pub fn new() -> CreateTagProtectionOption { - CreateTagProtectionOption { - name_pattern: None, - whitelist_teams: None, - whitelist_usernames: None, - } - } -} diff --git a/src/models/create_team_option.rs b/src/models/create_team_option.rs deleted file mode 100644 index 70c8800..0000000 --- a/src/models/create_team_option.rs +++ /dev/null @@ -1,68 +0,0 @@ -/* - * Forgejo API - * - * This documentation describes the Forgejo API. - * - * The version of the OpenAPI document: 14.0.2-2-84240ce3a2+gitea-1.22.0 - * - * Generated by: https://openapi-generator.tech - */ - -use crate::models; -use serde::{Deserialize, Serialize}; - -/// CreateTeamOption : CreateTeamOption options for creating a team -#[derive(Clone, Default, Debug, PartialEq, 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>, -} - -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/src/models/create_user_option.rs b/src/models/create_user_option.rs deleted file mode 100644 index 70c3ef3..0000000 --- a/src/models/create_user_option.rs +++ /dev/null @@ -1,62 +0,0 @@ -/* - * Forgejo API - * - * This documentation describes the Forgejo API. - * - * The version of the OpenAPI document: 14.0.2-2-84240ce3a2+gitea-1.22.0 - * - * Generated by: https://openapi-generator.tech - */ - -use crate::models; -use serde::{Deserialize, Serialize}; - -/// CreateUserOption : CreateUserOption create user options -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct CreateUserOption { - /// For explicitly setting the user creation timestamp. Useful when users are migrated from other systems. When omitted, the user's creation timestamp will be set to \"now\". - #[serde(rename = "created_at", skip_serializing_if = "Option::is_none")] - pub created_at: Option, - #[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", skip_serializing_if = "Option::is_none")] - pub password: Option, - #[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, username: String) -> CreateUserOption { - CreateUserOption { - created_at: None, - email, - full_name: None, - login_name: None, - must_change_password: None, - password: None, - restricted: None, - send_notify: None, - source_id: None, - username, - visibility: None, - } - } -} diff --git a/src/models/create_variable_option.rs b/src/models/create_variable_option.rs deleted file mode 100644 index bf05abc..0000000 --- a/src/models/create_variable_option.rs +++ /dev/null @@ -1,27 +0,0 @@ -/* - * Forgejo API - * - * This documentation describes the Forgejo API. - * - * The version of the OpenAPI document: 14.0.2-2-84240ce3a2+gitea-1.22.0 - * - * Generated by: https://openapi-generator.tech - */ - -use crate::models; -use serde::{Deserialize, Serialize}; - -/// CreateVariableOption : CreateVariableOption the option when creating variable -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct CreateVariableOption { - /// Value of the variable to create - #[serde(rename = "value")] - pub value: String, -} - -impl CreateVariableOption { - /// CreateVariableOption the option when creating variable - pub fn new(value: String) -> CreateVariableOption { - CreateVariableOption { value } - } -} diff --git a/src/models/create_wiki_page_options.rs b/src/models/create_wiki_page_options.rs deleted file mode 100644 index 04861b8..0000000 --- a/src/models/create_wiki_page_options.rs +++ /dev/null @@ -1,37 +0,0 @@ -/* - * Forgejo API - * - * This documentation describes the Forgejo API. - * - * The version of the OpenAPI document: 14.0.2-2-84240ce3a2+gitea-1.22.0 - * - * Generated by: https://openapi-generator.tech - */ - -use crate::models; -use serde::{Deserialize, Serialize}; - -/// CreateWikiPageOptions : CreateWikiPageOptions form for creating wiki -#[derive(Clone, Default, Debug, PartialEq, 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/src/models/cron.rs b/src/models/cron.rs deleted file mode 100644 index 85bc752..0000000 --- a/src/models/cron.rs +++ /dev/null @@ -1,40 +0,0 @@ -/* - * Forgejo API - * - * This documentation describes the Forgejo API. - * - * The version of the OpenAPI document: 14.0.2-2-84240ce3a2+gitea-1.22.0 - * - * Generated by: https://openapi-generator.tech - */ - -use crate::models; -use serde::{Deserialize, Serialize}; - -/// Cron : Cron represents a Cron task -#[derive(Clone, Default, Debug, PartialEq, 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/src/models/delete_email_option.rs b/src/models/delete_email_option.rs deleted file mode 100644 index 2f84336..0000000 --- a/src/models/delete_email_option.rs +++ /dev/null @@ -1,27 +0,0 @@ -/* - * Forgejo API - * - * This documentation describes the Forgejo API. - * - * The version of the OpenAPI document: 14.0.2-2-84240ce3a2+gitea-1.22.0 - * - * Generated by: https://openapi-generator.tech - */ - -use crate::models; -use serde::{Deserialize, Serialize}; - -/// DeleteEmailOption : DeleteEmailOption options when deleting email addresses -#[derive(Clone, Default, Debug, PartialEq, 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/src/models/delete_file_options.rs b/src/models/delete_file_options.rs deleted file mode 100644 index 9d8421b..0000000 --- a/src/models/delete_file_options.rs +++ /dev/null @@ -1,54 +0,0 @@ -/* - * Forgejo API - * - * This documentation describes the Forgejo API. - * - * The version of the OpenAPI document: 14.0.2-2-84240ce3a2+gitea-1.22.0 - * - * Generated by: https://openapi-generator.tech - */ - -use crate::models; -use serde::{Deserialize, Serialize}; - -/// 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, Default, Debug, PartialEq, 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/src/models/delete_labels_option.rs b/src/models/delete_labels_option.rs deleted file mode 100644 index 0326d48..0000000 --- a/src/models/delete_labels_option.rs +++ /dev/null @@ -1,26 +0,0 @@ -/* - * Forgejo API - * - * This documentation describes the Forgejo API. - * - * The version of the OpenAPI document: 14.0.2-2-84240ce3a2+gitea-1.22.0 - * - * Generated by: https://openapi-generator.tech - */ - -use crate::models; -use serde::{Deserialize, Serialize}; - -/// DeleteLabelsOption : DeleteLabelOption options for deleting a label -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct DeleteLabelsOption { - #[serde(rename = "updated_at", skip_serializing_if = "Option::is_none")] - pub updated_at: Option, -} - -impl DeleteLabelsOption { - /// DeleteLabelOption options for deleting a label - pub fn new() -> DeleteLabelsOption { - DeleteLabelsOption { updated_at: None } - } -} diff --git a/src/models/deploy_key.rs b/src/models/deploy_key.rs deleted file mode 100644 index 9d7da1d..0000000 --- a/src/models/deploy_key.rs +++ /dev/null @@ -1,52 +0,0 @@ -/* - * Forgejo API - * - * This documentation describes the Forgejo API. - * - * The version of the OpenAPI document: 14.0.2-2-84240ce3a2+gitea-1.22.0 - * - * Generated by: https://openapi-generator.tech - */ - -use crate::models; -use serde::{Deserialize, Serialize}; - -/// DeployKey : DeployKey a deploy key -#[derive(Clone, Default, Debug, PartialEq, 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/src/models/dismiss_pull_review_options.rs b/src/models/dismiss_pull_review_options.rs deleted file mode 100644 index b62225f..0000000 --- a/src/models/dismiss_pull_review_options.rs +++ /dev/null @@ -1,31 +0,0 @@ -/* - * Forgejo API - * - * This documentation describes the Forgejo API. - * - * The version of the OpenAPI document: 14.0.2-2-84240ce3a2+gitea-1.22.0 - * - * Generated by: https://openapi-generator.tech - */ - -use crate::models; -use serde::{Deserialize, Serialize}; - -/// DismissPullReviewOptions : DismissPullReviewOptions are options to dismiss a pull review -#[derive(Clone, Default, Debug, PartialEq, 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/src/models/dispatch_workflow_option.rs b/src/models/dispatch_workflow_option.rs deleted file mode 100644 index b0a31e2..0000000 --- a/src/models/dispatch_workflow_option.rs +++ /dev/null @@ -1,37 +0,0 @@ -/* - * Forgejo API - * - * This documentation describes the Forgejo API. - * - * The version of the OpenAPI document: 14.0.2-2-84240ce3a2+gitea-1.22.0 - * - * Generated by: https://openapi-generator.tech - */ - -use crate::models; -use serde::{Deserialize, Serialize}; - -/// DispatchWorkflowOption : DispatchWorkflowOption options when dispatching a workflow -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct DispatchWorkflowOption { - /// Input keys and values configured in the workflow file. - #[serde(rename = "inputs", skip_serializing_if = "Option::is_none")] - pub inputs: Option>, - /// Git reference for the workflow - #[serde(rename = "ref")] - pub r#ref: String, - /// Flag to return the run info - #[serde(rename = "return_run_info", skip_serializing_if = "Option::is_none")] - pub return_run_info: Option, -} - -impl DispatchWorkflowOption { - /// DispatchWorkflowOption options when dispatching a workflow - pub fn new(r#ref: String) -> DispatchWorkflowOption { - DispatchWorkflowOption { - inputs: None, - r#ref, - return_run_info: None, - } - } -} diff --git a/src/models/dispatch_workflow_run.rs b/src/models/dispatch_workflow_run.rs deleted file mode 100644 index 80f3c9f..0000000 --- a/src/models/dispatch_workflow_run.rs +++ /dev/null @@ -1,37 +0,0 @@ -/* - * Forgejo API - * - * This documentation describes the Forgejo API. - * - * The version of the OpenAPI document: 14.0.2-2-84240ce3a2+gitea-1.22.0 - * - * Generated by: https://openapi-generator.tech - */ - -use crate::models; -use serde::{Deserialize, Serialize}; - -/// DispatchWorkflowRun : DispatchWorkflowRun represents a workflow run -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct DispatchWorkflowRun { - /// the workflow run id - #[serde(rename = "id", skip_serializing_if = "Option::is_none")] - pub id: Option, - /// the jobs name - #[serde(rename = "jobs", skip_serializing_if = "Option::is_none")] - pub jobs: Option>, - /// a unique number for each run of a repository - #[serde(rename = "run_number", skip_serializing_if = "Option::is_none")] - pub run_number: Option, -} - -impl DispatchWorkflowRun { - /// DispatchWorkflowRun represents a workflow run - pub fn new() -> DispatchWorkflowRun { - DispatchWorkflowRun { - id: None, - jobs: None, - run_number: None, - } - } -} diff --git a/src/models/edit_attachment_options.rs b/src/models/edit_attachment_options.rs deleted file mode 100644 index f74a1eb..0000000 --- a/src/models/edit_attachment_options.rs +++ /dev/null @@ -1,35 +0,0 @@ -/* - * Forgejo API - * - * This documentation describes the Forgejo API. - * - * The version of the OpenAPI document: 14.0.2-2-84240ce3a2+gitea-1.22.0 - * - * Generated by: https://openapi-generator.tech - */ - -use crate::models; -use serde::{Deserialize, Serialize}; - -/// EditAttachmentOptions : EditAttachmentOptions options for editing attachments -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct EditAttachmentOptions { - /// (Can only be set if existing attachment is of external type) - #[serde( - rename = "browser_download_url", - skip_serializing_if = "Option::is_none" - )] - pub browser_download_url: Option, - #[serde(rename = "name", skip_serializing_if = "Option::is_none")] - pub name: Option, -} - -impl EditAttachmentOptions { - /// EditAttachmentOptions options for editing attachments - pub fn new() -> EditAttachmentOptions { - EditAttachmentOptions { - browser_download_url: None, - name: None, - } - } -} diff --git a/src/models/edit_branch_protection_option.rs b/src/models/edit_branch_protection_option.rs deleted file mode 100644 index 5a4cfc9..0000000 --- a/src/models/edit_branch_protection_option.rs +++ /dev/null @@ -1,154 +0,0 @@ -/* - * Forgejo API - * - * This documentation describes the Forgejo API. - * - * The version of the OpenAPI document: 14.0.2-2-84240ce3a2+gitea-1.22.0 - * - * Generated by: https://openapi-generator.tech - */ - -use crate::models; -use serde::{Deserialize, Serialize}; - -/// EditBranchProtectionOption : EditBranchProtectionOption options for editing a branch protection -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct EditBranchProtectionOption { - #[serde(rename = "apply_to_admins", skip_serializing_if = "Option::is_none")] - pub apply_to_admins: Option, - #[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 = "ignore_stale_approvals", - skip_serializing_if = "Option::is_none" - )] - pub ignore_stale_approvals: 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 { - apply_to_admins: None, - 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, - ignore_stale_approvals: 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/src/models/edit_deadline_option.rs b/src/models/edit_deadline_option.rs deleted file mode 100644 index 4e5f65b..0000000 --- a/src/models/edit_deadline_option.rs +++ /dev/null @@ -1,26 +0,0 @@ -/* - * Forgejo API - * - * This documentation describes the Forgejo API. - * - * The version of the OpenAPI document: 14.0.2-2-84240ce3a2+gitea-1.22.0 - * - * Generated by: https://openapi-generator.tech - */ - -use crate::models; -use serde::{Deserialize, Serialize}; - -/// EditDeadlineOption : EditDeadlineOption options for creating a deadline -#[derive(Clone, Default, Debug, PartialEq, 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/src/models/edit_git_hook_option.rs b/src/models/edit_git_hook_option.rs deleted file mode 100644 index 05515de..0000000 --- a/src/models/edit_git_hook_option.rs +++ /dev/null @@ -1,26 +0,0 @@ -/* - * Forgejo API - * - * This documentation describes the Forgejo API. - * - * The version of the OpenAPI document: 14.0.2-2-84240ce3a2+gitea-1.22.0 - * - * Generated by: https://openapi-generator.tech - */ - -use crate::models; -use serde::{Deserialize, Serialize}; - -/// EditGitHookOption : EditGitHookOption options when modifying one Git hook -#[derive(Clone, Default, Debug, PartialEq, 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/src/models/edit_hook_option.rs b/src/models/edit_hook_option.rs deleted file mode 100644 index c7fae37..0000000 --- a/src/models/edit_hook_option.rs +++ /dev/null @@ -1,43 +0,0 @@ -/* - * Forgejo API - * - * This documentation describes the Forgejo API. - * - * The version of the OpenAPI document: 14.0.2-2-84240ce3a2+gitea-1.22.0 - * - * Generated by: https://openapi-generator.tech - */ - -use crate::models; -use serde::{Deserialize, Serialize}; - -/// EditHookOption : EditHookOption options when modify one hook -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct EditHookOption { - #[serde(rename = "active", skip_serializing_if = "Option::is_none")] - pub active: Option, - #[serde( - rename = "authorization_header", - skip_serializing_if = "Option::is_none" - )] - pub authorization_header: 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>, - #[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, - authorization_header: None, - branch_filter: None, - config: None, - events: None, - } - } -} diff --git a/src/models/edit_issue_comment_option.rs b/src/models/edit_issue_comment_option.rs deleted file mode 100644 index b72089e..0000000 --- a/src/models/edit_issue_comment_option.rs +++ /dev/null @@ -1,31 +0,0 @@ -/* - * Forgejo API - * - * This documentation describes the Forgejo API. - * - * The version of the OpenAPI document: 14.0.2-2-84240ce3a2+gitea-1.22.0 - * - * Generated by: https://openapi-generator.tech - */ - -use crate::models; -use serde::{Deserialize, Serialize}; - -/// EditIssueCommentOption : EditIssueCommentOption options for editing a comment -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct EditIssueCommentOption { - #[serde(rename = "body")] - pub body: String, - #[serde(rename = "updated_at", skip_serializing_if = "Option::is_none")] - pub updated_at: Option, -} - -impl EditIssueCommentOption { - /// EditIssueCommentOption options for editing a comment - pub fn new(body: String) -> EditIssueCommentOption { - EditIssueCommentOption { - body, - updated_at: None, - } - } -} diff --git a/src/models/edit_issue_option.rs b/src/models/edit_issue_option.rs deleted file mode 100644 index e116a17..0000000 --- a/src/models/edit_issue_option.rs +++ /dev/null @@ -1,56 +0,0 @@ -/* - * Forgejo API - * - * This documentation describes the Forgejo API. - * - * The version of the OpenAPI document: 14.0.2-2-84240ce3a2+gitea-1.22.0 - * - * Generated by: https://openapi-generator.tech - */ - -use crate::models; -use serde::{Deserialize, Serialize}; - -/// EditIssueOption : EditIssueOption options for editing an issue -#[derive(Clone, Default, Debug, PartialEq, 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, - #[serde(rename = "updated_at", skip_serializing_if = "Option::is_none")] - pub updated_at: 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, - updated_at: None, - } - } -} diff --git a/src/models/edit_label_option.rs b/src/models/edit_label_option.rs deleted file mode 100644 index 24f3bd0..0000000 --- a/src/models/edit_label_option.rs +++ /dev/null @@ -1,40 +0,0 @@ -/* - * Forgejo API - * - * This documentation describes the Forgejo API. - * - * The version of the OpenAPI document: 14.0.2-2-84240ce3a2+gitea-1.22.0 - * - * Generated by: https://openapi-generator.tech - */ - -use crate::models; -use serde::{Deserialize, Serialize}; - -/// EditLabelOption : EditLabelOption options for editing a label -#[derive(Clone, Default, Debug, PartialEq, 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 = "exclusive", skip_serializing_if = "Option::is_none")] - pub exclusive: Option, - #[serde(rename = "is_archived", skip_serializing_if = "Option::is_none")] - pub is_archived: 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, - exclusive: None, - is_archived: None, - name: None, - } - } -} diff --git a/src/models/edit_milestone_option.rs b/src/models/edit_milestone_option.rs deleted file mode 100644 index 7330d6f..0000000 --- a/src/models/edit_milestone_option.rs +++ /dev/null @@ -1,37 +0,0 @@ -/* - * Forgejo API - * - * This documentation describes the Forgejo API. - * - * The version of the OpenAPI document: 14.0.2-2-84240ce3a2+gitea-1.22.0 - * - * Generated by: https://openapi-generator.tech - */ - -use crate::models; -use serde::{Deserialize, Serialize}; - -/// EditMilestoneOption : EditMilestoneOption options for editing a milestone -#[derive(Clone, Default, Debug, PartialEq, 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/src/models/edit_org_option.rs b/src/models/edit_org_option.rs deleted file mode 100644 index 5341602..0000000 --- a/src/models/edit_org_option.rs +++ /dev/null @@ -1,66 +0,0 @@ -/* - * Forgejo API - * - * This documentation describes the Forgejo API. - * - * The version of the OpenAPI document: 14.0.2-2-84240ce3a2+gitea-1.22.0 - * - * Generated by: https://openapi-generator.tech - */ - -use crate::models; -use serde::{Deserialize, Serialize}; - -/// EditOrgOption : EditOrgOption options for editing an organization -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct EditOrgOption { - #[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 = "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, - email: 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/src/models/edit_pull_request_option.rs b/src/models/edit_pull_request_option.rs deleted file mode 100644 index 26de34e..0000000 --- a/src/models/edit_pull_request_option.rs +++ /dev/null @@ -1,61 +0,0 @@ -/* - * Forgejo API - * - * This documentation describes the Forgejo API. - * - * The version of the OpenAPI document: 14.0.2-2-84240ce3a2+gitea-1.22.0 - * - * Generated by: https://openapi-generator.tech - */ - -use crate::models; -use serde::{Deserialize, Serialize}; - -/// EditPullRequestOption : EditPullRequestOption options when modify pull request -#[derive(Clone, Default, Debug, PartialEq, 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/src/models/edit_quota_rule_options.rs b/src/models/edit_quota_rule_options.rs deleted file mode 100644 index ddd5da9..0000000 --- a/src/models/edit_quota_rule_options.rs +++ /dev/null @@ -1,33 +0,0 @@ -/* - * Forgejo API - * - * This documentation describes the Forgejo API. - * - * The version of the OpenAPI document: 14.0.2-2-84240ce3a2+gitea-1.22.0 - * - * Generated by: https://openapi-generator.tech - */ - -use crate::models; -use serde::{Deserialize, Serialize}; - -/// EditQuotaRuleOptions : EditQuotaRuleOptions represents the options for editing a quota rule -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct EditQuotaRuleOptions { - /// The limit set by the rule - #[serde(rename = "limit", skip_serializing_if = "Option::is_none")] - pub limit: Option, - /// The subjects affected by the rule - #[serde(rename = "subjects", skip_serializing_if = "Option::is_none")] - pub subjects: Option>, -} - -impl EditQuotaRuleOptions { - /// EditQuotaRuleOptions represents the options for editing a quota rule - pub fn new() -> EditQuotaRuleOptions { - EditQuotaRuleOptions { - limit: None, - subjects: None, - } - } -} diff --git a/src/models/edit_reaction_option.rs b/src/models/edit_reaction_option.rs deleted file mode 100644 index 2d0daee..0000000 --- a/src/models/edit_reaction_option.rs +++ /dev/null @@ -1,26 +0,0 @@ -/* - * Forgejo API - * - * This documentation describes the Forgejo API. - * - * The version of the OpenAPI document: 14.0.2-2-84240ce3a2+gitea-1.22.0 - * - * Generated by: https://openapi-generator.tech - */ - -use crate::models; -use serde::{Deserialize, Serialize}; - -/// EditReactionOption : EditReactionOption contain the reaction type -#[derive(Clone, Default, Debug, PartialEq, 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/src/models/edit_release_option.rs b/src/models/edit_release_option.rs deleted file mode 100644 index edc3fb2..0000000 --- a/src/models/edit_release_option.rs +++ /dev/null @@ -1,46 +0,0 @@ -/* - * Forgejo API - * - * This documentation describes the Forgejo API. - * - * The version of the OpenAPI document: 14.0.2-2-84240ce3a2+gitea-1.22.0 - * - * Generated by: https://openapi-generator.tech - */ - -use crate::models; -use serde::{Deserialize, Serialize}; - -/// EditReleaseOption : EditReleaseOption options when editing a release -#[derive(Clone, Default, Debug, PartialEq, 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 = "hide_archive_links", skip_serializing_if = "Option::is_none")] - pub hide_archive_links: 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, - hide_archive_links: None, - name: None, - prerelease: None, - tag_name: None, - target_commitish: None, - } - } -} diff --git a/src/models/edit_repo_option.rs b/src/models/edit_repo_option.rs deleted file mode 100644 index 892b250..0000000 --- a/src/models/edit_repo_option.rs +++ /dev/null @@ -1,191 +0,0 @@ -/* - * Forgejo API - * - * This documentation describes the Forgejo API. - * - * The version of the OpenAPI document: 14.0.2-2-84240ce3a2+gitea-1.22.0 - * - * Generated by: https://openapi-generator.tech - */ - -use crate::models; -use serde::{Deserialize, Serialize}; - -/// EditRepoOption : EditRepoOption options when editing a repository's properties -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct EditRepoOption { - /// either `true` to allow fast-forward-only merging pull requests, or `false` to prevent fast-forward-only merging. - #[serde( - rename = "allow_fast_forward_only_merge", - skip_serializing_if = "Option::is_none" - )] - pub allow_fast_forward_only_merge: Option, - /// either `true` to allow mark pr as merged manually, or `false` to prevent it. - #[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. - #[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. - #[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. - #[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. - #[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. - #[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. Note: In some special cases, misjudgments can occur. - #[serde( - rename = "autodetect_manual_merge", - skip_serializing_if = "Option::is_none" - )] - pub autodetect_manual_merge: Option, - /// set to `true` to allow edits from maintainers by default - #[serde( - rename = "default_allow_maintainer_edit", - skip_serializing_if = "Option::is_none" - )] - pub default_allow_maintainer_edit: 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\", \"squash\", \"fast-forward-only\", \"manually-merged\", or \"rebase-update-only\". - #[serde( - rename = "default_merge_style", - skip_serializing_if = "Option::is_none" - )] - pub default_merge_style: Option, - /// set to a update style to be used by this repository: \"rebase\" or \"merge\" - #[serde( - rename = "default_update_style", - skip_serializing_if = "Option::is_none" - )] - pub default_update_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 when mirroring - #[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>, - /// set the globally editable state of the wiki - #[serde( - rename = "globally_editable_wiki", - skip_serializing_if = "Option::is_none" - )] - pub globally_editable_wiki: Option, - /// either `true` to enable actions unit, or `false` to disable them. - #[serde(rename = "has_actions", skip_serializing_if = "Option::is_none")] - pub has_actions: 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 packages unit, or `false` to disable them. - #[serde(rename = "has_packages", skip_serializing_if = "Option::is_none")] - pub has_packages: 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 releases unit, or `false` to disable them. - #[serde(rename = "has_releases", skip_serializing_if = "Option::is_none")] - pub has_releases: 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. - #[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, - /// sets the branch used for this repository's wiki. - #[serde(rename = "wiki_branch", skip_serializing_if = "Option::is_none")] - pub wiki_branch: Option, -} - -impl EditRepoOption { - /// EditRepoOption options when editing a repository's properties - pub fn new() -> EditRepoOption { - EditRepoOption { - allow_fast_forward_only_merge: None, - 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_allow_maintainer_edit: None, - default_branch: None, - default_delete_branch_after_merge: None, - default_merge_style: None, - default_update_style: None, - description: None, - enable_prune: None, - external_tracker: None, - external_wiki: None, - globally_editable_wiki: None, - has_actions: None, - has_issues: None, - has_packages: None, - has_projects: None, - has_pull_requests: None, - has_releases: None, - has_wiki: None, - ignore_whitespace_conflicts: None, - internal_tracker: None, - mirror_interval: None, - name: None, - private: None, - template: None, - website: None, - wiki_branch: None, - } - } -} diff --git a/src/models/edit_tag_protection_option.rs b/src/models/edit_tag_protection_option.rs deleted file mode 100644 index 692c1de..0000000 --- a/src/models/edit_tag_protection_option.rs +++ /dev/null @@ -1,37 +0,0 @@ -/* - * Forgejo API - * - * This documentation describes the Forgejo API. - * - * The version of the OpenAPI document: 14.0.2-2-84240ce3a2+gitea-1.22.0 - * - * Generated by: https://openapi-generator.tech - */ - -use crate::models; -use serde::{Deserialize, Serialize}; - -/// EditTagProtectionOption : EditTagProtectionOption options for editing a tag protection -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct EditTagProtectionOption { - #[serde(rename = "name_pattern", skip_serializing_if = "Option::is_none")] - pub name_pattern: Option, - #[serde(rename = "whitelist_teams", skip_serializing_if = "Option::is_none")] - pub whitelist_teams: Option>, - #[serde( - rename = "whitelist_usernames", - skip_serializing_if = "Option::is_none" - )] - pub whitelist_usernames: Option>, -} - -impl EditTagProtectionOption { - /// EditTagProtectionOption options for editing a tag protection - pub fn new() -> EditTagProtectionOption { - EditTagProtectionOption { - name_pattern: None, - whitelist_teams: None, - whitelist_usernames: None, - } - } -} diff --git a/src/models/edit_team_option.rs b/src/models/edit_team_option.rs deleted file mode 100644 index 871e3e0..0000000 --- a/src/models/edit_team_option.rs +++ /dev/null @@ -1,68 +0,0 @@ -/* - * Forgejo API - * - * This documentation describes the Forgejo API. - * - * The version of the OpenAPI document: 14.0.2-2-84240ce3a2+gitea-1.22.0 - * - * Generated by: https://openapi-generator.tech - */ - -use crate::models; -use serde::{Deserialize, Serialize}; - -/// EditTeamOption : EditTeamOption options for editing a team -#[derive(Clone, Default, Debug, PartialEq, 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>, -} - -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/src/models/edit_user_option.rs b/src/models/edit_user_option.rs deleted file mode 100644 index a8a5d88..0000000 --- a/src/models/edit_user_option.rs +++ /dev/null @@ -1,91 +0,0 @@ -/* - * Forgejo API - * - * This documentation describes the Forgejo API. - * - * The version of the OpenAPI document: 14.0.2-2-84240ce3a2+gitea-1.22.0 - * - * Generated by: https://openapi-generator.tech - */ - -use crate::models; -use serde::{Deserialize, Serialize}; - -/// EditUserOption : EditUserOption edit user options -#[derive(Clone, Default, Debug, PartialEq, 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 = "hide_email", skip_serializing_if = "Option::is_none")] - pub hide_email: Option, - #[serde(rename = "location", skip_serializing_if = "Option::is_none")] - pub location: Option, - #[serde(rename = "login_name", skip_serializing_if = "Option::is_none")] - pub login_name: Option, - #[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 = "pronouns", skip_serializing_if = "Option::is_none")] - pub pronouns: Option, - #[serde(rename = "restricted", skip_serializing_if = "Option::is_none")] - pub restricted: Option, - #[serde(rename = "source_id", skip_serializing_if = "Option::is_none")] - pub source_id: 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 EditUserOption { - /// EditUserOption edit user options - pub fn new() -> 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, - hide_email: None, - location: None, - login_name: None, - max_repo_creation: None, - must_change_password: None, - password: None, - prohibit_login: None, - pronouns: None, - restricted: None, - source_id: None, - visibility: None, - website: None, - } - } -} diff --git a/src/models/email.rs b/src/models/email.rs deleted file mode 100644 index af44a70..0000000 --- a/src/models/email.rs +++ /dev/null @@ -1,40 +0,0 @@ -/* - * Forgejo API - * - * This documentation describes the Forgejo API. - * - * The version of the OpenAPI document: 14.0.2-2-84240ce3a2+gitea-1.22.0 - * - * Generated by: https://openapi-generator.tech - */ - -use crate::models; -use serde::{Deserialize, Serialize}; - -/// Email : Email an email address belonging to a user -#[derive(Clone, Default, Debug, PartialEq, 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 = "user_id", skip_serializing_if = "Option::is_none")] - pub user_id: Option, - #[serde(rename = "username", skip_serializing_if = "Option::is_none")] - pub username: 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, - user_id: None, - username: None, - verified: None, - } - } -} diff --git a/src/models/external_tracker.rs b/src/models/external_tracker.rs deleted file mode 100644 index 0c14600..0000000 --- a/src/models/external_tracker.rs +++ /dev/null @@ -1,53 +0,0 @@ -/* - * Forgejo API - * - * This documentation describes the Forgejo API. - * - * The version of the OpenAPI document: 14.0.2-2-84240ce3a2+gitea-1.22.0 - * - * Generated by: https://openapi-generator.tech - */ - -use crate::models; -use serde::{Deserialize, Serialize}; - -/// ExternalTracker : ExternalTracker represents settings for external tracker -#[derive(Clone, Default, Debug, PartialEq, 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 issue regular expression - #[serde( - rename = "external_tracker_regexp_pattern", - skip_serializing_if = "Option::is_none" - )] - pub external_tracker_regexp_pattern: Option, - /// External Issue Tracker Number Format, either `numeric`, `alphanumeric`, or `regexp` - #[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_regexp_pattern: None, - external_tracker_style: None, - external_tracker_url: None, - } - } -} diff --git a/src/models/external_wiki.rs b/src/models/external_wiki.rs deleted file mode 100644 index 01a772a..0000000 --- a/src/models/external_wiki.rs +++ /dev/null @@ -1,29 +0,0 @@ -/* - * Forgejo API - * - * This documentation describes the Forgejo API. - * - * The version of the OpenAPI document: 14.0.2-2-84240ce3a2+gitea-1.22.0 - * - * Generated by: https://openapi-generator.tech - */ - -use crate::models; -use serde::{Deserialize, Serialize}; - -/// ExternalWiki : ExternalWiki represents setting for external wiki -#[derive(Clone, Default, Debug, PartialEq, 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/src/models/file_commit_response.rs b/src/models/file_commit_response.rs deleted file mode 100644 index 800816e..0000000 --- a/src/models/file_commit_response.rs +++ /dev/null @@ -1,50 +0,0 @@ -/* - * Forgejo API - * - * This documentation describes the Forgejo API. - * - * The version of the OpenAPI document: 14.0.2-2-84240ce3a2+gitea-1.22.0 - * - * Generated by: https://openapi-generator.tech - */ - -use crate::models; -use serde::{Deserialize, Serialize}; - -#[derive(Clone, Default, Debug, PartialEq, 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/src/models/file_delete_response.rs b/src/models/file_delete_response.rs deleted file mode 100644 index df11e15..0000000 --- a/src/models/file_delete_response.rs +++ /dev/null @@ -1,34 +0,0 @@ -/* - * Forgejo API - * - * This documentation describes the Forgejo API. - * - * The version of the OpenAPI document: 14.0.2-2-84240ce3a2+gitea-1.22.0 - * - * Generated by: https://openapi-generator.tech - */ - -use crate::models; -use serde::{Deserialize, Serialize}; - -/// FileDeleteResponse : FileDeleteResponse contains information about a repo's file that was deleted -#[derive(Clone, Default, Debug, PartialEq, 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/src/models/file_links_response.rs b/src/models/file_links_response.rs deleted file mode 100644 index 7e14e2a..0000000 --- a/src/models/file_links_response.rs +++ /dev/null @@ -1,34 +0,0 @@ -/* - * Forgejo API - * - * This documentation describes the Forgejo API. - * - * The version of the OpenAPI document: 14.0.2-2-84240ce3a2+gitea-1.22.0 - * - * Generated by: https://openapi-generator.tech - */ - -use crate::models; -use serde::{Deserialize, Serialize}; - -/// FileLinksResponse : FileLinksResponse contains the links for a repo's file -#[derive(Clone, Default, Debug, PartialEq, 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/src/models/file_response.rs b/src/models/file_response.rs deleted file mode 100644 index 4c3e376..0000000 --- a/src/models/file_response.rs +++ /dev/null @@ -1,34 +0,0 @@ -/* - * Forgejo API - * - * This documentation describes the Forgejo API. - * - * The version of the OpenAPI document: 14.0.2-2-84240ce3a2+gitea-1.22.0 - * - * Generated by: https://openapi-generator.tech - */ - -use crate::models; -use serde::{Deserialize, Serialize}; - -/// FileResponse : FileResponse contains information about a repo's file -#[derive(Clone, Default, Debug, PartialEq, 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/src/models/files_response.rs b/src/models/files_response.rs deleted file mode 100644 index f7c7095..0000000 --- a/src/models/files_response.rs +++ /dev/null @@ -1,34 +0,0 @@ -/* - * Forgejo API - * - * This documentation describes the Forgejo API. - * - * The version of the OpenAPI document: 14.0.2-2-84240ce3a2+gitea-1.22.0 - * - * Generated by: https://openapi-generator.tech - */ - -use crate::models; -use serde::{Deserialize, Serialize}; - -/// FilesResponse : FilesResponse contains information about multiple files from a repo -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct FilesResponse { - #[serde(rename = "commit", skip_serializing_if = "Option::is_none")] - pub commit: Option>, - #[serde(rename = "files", skip_serializing_if = "Option::is_none")] - pub files: Option>, - #[serde(rename = "verification", skip_serializing_if = "Option::is_none")] - pub verification: Option>, -} - -impl FilesResponse { - /// FilesResponse contains information about multiple files from a repo - pub fn new() -> FilesResponse { - FilesResponse { - commit: None, - files: None, - verification: None, - } - } -} diff --git a/src/models/general_api_settings.rs b/src/models/general_api_settings.rs deleted file mode 100644 index 3ca1b42..0000000 --- a/src/models/general_api_settings.rs +++ /dev/null @@ -1,43 +0,0 @@ -/* - * Forgejo API - * - * This documentation describes the Forgejo API. - * - * The version of the OpenAPI document: 14.0.2-2-84240ce3a2+gitea-1.22.0 - * - * Generated by: https://openapi-generator.tech - */ - -use crate::models; -use serde::{Deserialize, Serialize}; - -/// GeneralApiSettings : GeneralAPISettings contains global api settings exposed by it -#[derive(Clone, Default, Debug, PartialEq, 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/src/models/general_attachment_settings.rs b/src/models/general_attachment_settings.rs deleted file mode 100644 index 455ce7b..0000000 --- a/src/models/general_attachment_settings.rs +++ /dev/null @@ -1,37 +0,0 @@ -/* - * Forgejo API - * - * This documentation describes the Forgejo API. - * - * The version of the OpenAPI document: 14.0.2-2-84240ce3a2+gitea-1.22.0 - * - * Generated by: https://openapi-generator.tech - */ - -use crate::models; -use serde::{Deserialize, Serialize}; - -/// GeneralAttachmentSettings : GeneralAttachmentSettings contains global Attachment settings exposed by API -#[derive(Clone, Default, Debug, PartialEq, 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/src/models/general_repo_settings.rs b/src/models/general_repo_settings.rs deleted file mode 100644 index db3fc03..0000000 --- a/src/models/general_repo_settings.rs +++ /dev/null @@ -1,52 +0,0 @@ -/* - * Forgejo API - * - * This documentation describes the Forgejo API. - * - * The version of the OpenAPI document: 14.0.2-2-84240ce3a2+gitea-1.22.0 - * - * Generated by: https://openapi-generator.tech - */ - -use crate::models; -use serde::{Deserialize, Serialize}; - -/// GeneralRepoSettings : GeneralRepoSettings contains global repository settings exposed by API -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct GeneralRepoSettings { - #[serde(rename = "forks_disabled", skip_serializing_if = "Option::is_none")] - pub forks_disabled: Option, - #[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 { - forks_disabled: None, - http_git_disabled: None, - lfs_disabled: None, - migrations_disabled: None, - mirrors_disabled: None, - stars_disabled: None, - time_tracking_disabled: None, - } - } -} diff --git a/src/models/general_ui_settings.rs b/src/models/general_ui_settings.rs deleted file mode 100644 index cfe6d80..0000000 --- a/src/models/general_ui_settings.rs +++ /dev/null @@ -1,34 +0,0 @@ -/* - * Forgejo API - * - * This documentation describes the Forgejo API. - * - * The version of the OpenAPI document: 14.0.2-2-84240ce3a2+gitea-1.22.0 - * - * Generated by: https://openapi-generator.tech - */ - -use crate::models; -use serde::{Deserialize, Serialize}; - -/// GeneralUiSettings : GeneralUISettings contains global ui settings exposed by API -#[derive(Clone, Default, Debug, PartialEq, 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/src/models/generate_repo_option.rs b/src/models/generate_repo_option.rs deleted file mode 100644 index 593f83d..0000000 --- a/src/models/generate_repo_option.rs +++ /dev/null @@ -1,73 +0,0 @@ -/* - * Forgejo API - * - * This documentation describes the Forgejo API. - * - * The version of the OpenAPI document: 14.0.2-2-84240ce3a2+gitea-1.22.0 - * - * Generated by: https://openapi-generator.tech - */ - -use crate::models; -use serde::{Deserialize, Serialize}; - -/// GenerateRepoOption : GenerateRepoOption options when creating repository using a template -#[derive(Clone, Default, Debug, PartialEq, 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 protected branches in template repo - #[serde(rename = "protected_branch", skip_serializing_if = "Option::is_none")] - pub protected_branch: 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, - protected_branch: None, - topics: None, - webhooks: None, - } - } -} diff --git a/src/models/git_blob.rs b/src/models/git_blob.rs deleted file mode 100644 index 5967ca5..0000000 --- a/src/models/git_blob.rs +++ /dev/null @@ -1,40 +0,0 @@ -/* - * Forgejo API - * - * This documentation describes the Forgejo API. - * - * The version of the OpenAPI document: 14.0.2-2-84240ce3a2+gitea-1.22.0 - * - * Generated by: https://openapi-generator.tech - */ - -use crate::models; -use serde::{Deserialize, Serialize}; - -/// GitBlob : GitBlob represents a git blob -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct GitBlob { - #[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 GitBlob { - /// GitBlob represents a git blob - pub fn new() -> GitBlob { - GitBlob { - content: None, - encoding: None, - sha: None, - size: None, - url: None, - } - } -} diff --git a/src/models/git_entry.rs b/src/models/git_entry.rs deleted file mode 100644 index 52eb521..0000000 --- a/src/models/git_entry.rs +++ /dev/null @@ -1,43 +0,0 @@ -/* - * Forgejo API - * - * This documentation describes the Forgejo API. - * - * The version of the OpenAPI document: 14.0.2-2-84240ce3a2+gitea-1.22.0 - * - * Generated by: https://openapi-generator.tech - */ - -use crate::models; -use serde::{Deserialize, Serialize}; - -/// GitEntry : GitEntry represents a git tree -#[derive(Clone, Default, Debug, PartialEq, 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/src/models/git_hook.rs b/src/models/git_hook.rs deleted file mode 100644 index b87ccd0..0000000 --- a/src/models/git_hook.rs +++ /dev/null @@ -1,34 +0,0 @@ -/* - * Forgejo API - * - * This documentation describes the Forgejo API. - * - * The version of the OpenAPI document: 14.0.2-2-84240ce3a2+gitea-1.22.0 - * - * Generated by: https://openapi-generator.tech - */ - -use crate::models; -use serde::{Deserialize, Serialize}; - -/// GitHook : GitHook represents a Git repository hook -#[derive(Clone, Default, Debug, PartialEq, 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/src/models/git_object.rs b/src/models/git_object.rs deleted file mode 100644 index 2a9d722..0000000 --- a/src/models/git_object.rs +++ /dev/null @@ -1,32 +0,0 @@ -/* - * Forgejo API - * - * This documentation describes the Forgejo API. - * - * The version of the OpenAPI document: 14.0.2-2-84240ce3a2+gitea-1.22.0 - * - * Generated by: https://openapi-generator.tech - */ - -use crate::models; -use serde::{Deserialize, Serialize}; - -#[derive(Clone, Default, Debug, PartialEq, 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/src/models/git_tree_response.rs b/src/models/git_tree_response.rs deleted file mode 100644 index 8bc98df..0000000 --- a/src/models/git_tree_response.rs +++ /dev/null @@ -1,43 +0,0 @@ -/* - * Forgejo API - * - * This documentation describes the Forgejo API. - * - * The version of the OpenAPI document: 14.0.2-2-84240ce3a2+gitea-1.22.0 - * - * Generated by: https://openapi-generator.tech - */ - -use crate::models; -use serde::{Deserialize, Serialize}; - -/// GitTreeResponse : GitTreeResponse returns a git tree -#[derive(Clone, Default, Debug, PartialEq, 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/src/models/gitignore_template_info.rs b/src/models/gitignore_template_info.rs deleted file mode 100644 index b41e6f1..0000000 --- a/src/models/gitignore_template_info.rs +++ /dev/null @@ -1,31 +0,0 @@ -/* - * Forgejo API - * - * This documentation describes the Forgejo API. - * - * The version of the OpenAPI document: 14.0.2-2-84240ce3a2+gitea-1.22.0 - * - * Generated by: https://openapi-generator.tech - */ - -use crate::models; -use serde::{Deserialize, Serialize}; - -/// GitignoreTemplateInfo : GitignoreTemplateInfo name and text of a gitignore template -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct GitignoreTemplateInfo { - #[serde(rename = "name", skip_serializing_if = "Option::is_none")] - pub name: Option, - #[serde(rename = "source", skip_serializing_if = "Option::is_none")] - pub source: Option, -} - -impl GitignoreTemplateInfo { - /// GitignoreTemplateInfo name and text of a gitignore template - pub fn new() -> GitignoreTemplateInfo { - GitignoreTemplateInfo { - name: None, - source: None, - } - } -} diff --git a/src/models/gpg_key.rs b/src/models/gpg_key.rs deleted file mode 100644 index f3449eb..0000000 --- a/src/models/gpg_key.rs +++ /dev/null @@ -1,67 +0,0 @@ -/* - * Forgejo API - * - * This documentation describes the Forgejo API. - * - * The version of the OpenAPI document: 14.0.2-2-84240ce3a2+gitea-1.22.0 - * - * Generated by: https://openapi-generator.tech - */ - -use crate::models; -use serde::{Deserialize, Serialize}; - -/// GpgKey : GPGKey a user GPG key to sign commit and tag in repository -#[derive(Clone, Default, Debug, PartialEq, 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/src/models/gpg_key_email.rs b/src/models/gpg_key_email.rs deleted file mode 100644 index 503f499..0000000 --- a/src/models/gpg_key_email.rs +++ /dev/null @@ -1,31 +0,0 @@ -/* - * Forgejo API - * - * This documentation describes the Forgejo API. - * - * The version of the OpenAPI document: 14.0.2-2-84240ce3a2+gitea-1.22.0 - * - * Generated by: https://openapi-generator.tech - */ - -use crate::models; -use serde::{Deserialize, Serialize}; - -/// GpgKeyEmail : GPGKeyEmail an email attached to a GPGKey -#[derive(Clone, Default, Debug, PartialEq, 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/src/models/hook.rs b/src/models/hook.rs deleted file mode 100644 index bd5a1ae..0000000 --- a/src/models/hook.rs +++ /dev/null @@ -1,65 +0,0 @@ -/* - * Forgejo API - * - * This documentation describes the Forgejo API. - * - * The version of the OpenAPI document: 14.0.2-2-84240ce3a2+gitea-1.22.0 - * - * Generated by: https://openapi-generator.tech - */ - -use crate::models; -use serde::{Deserialize, Serialize}; - -/// Hook : Hook a hook is a web hook when one repository changed -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct Hook { - #[serde(rename = "active", skip_serializing_if = "Option::is_none")] - pub active: Option, - #[serde( - rename = "authorization_header", - skip_serializing_if = "Option::is_none" - )] - pub authorization_header: Option, - #[serde(rename = "branch_filter", skip_serializing_if = "Option::is_none")] - pub branch_filter: Option, - /// Deprecated: use Metadata instead - #[serde(rename = "config", skip_serializing_if = "Option::is_none")] - pub config: Option>, - #[serde(rename = "content_type", skip_serializing_if = "Option::is_none")] - pub content_type: Option, - #[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 = "metadata", skip_serializing_if = "Option::is_none")] - pub metadata: 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 = "url", skip_serializing_if = "Option::is_none")] - pub url: Option, -} - -impl Hook { - /// Hook a hook is a web hook when one repository changed - pub fn new() -> Hook { - Hook { - active: None, - authorization_header: None, - branch_filter: None, - config: None, - content_type: None, - created_at: None, - events: None, - id: None, - metadata: None, - r#type: None, - updated_at: None, - url: None, - } - } -} diff --git a/src/models/identity.rs b/src/models/identity.rs deleted file mode 100644 index 879f9c4..0000000 --- a/src/models/identity.rs +++ /dev/null @@ -1,31 +0,0 @@ -/* - * Forgejo API - * - * This documentation describes the Forgejo API. - * - * The version of the OpenAPI document: 14.0.2-2-84240ce3a2+gitea-1.22.0 - * - * Generated by: https://openapi-generator.tech - */ - -use crate::models; -use serde::{Deserialize, Serialize}; - -/// Identity : Identity for a person's identity like an author or committer -#[derive(Clone, Default, Debug, PartialEq, 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/src/models/internal_tracker.rs b/src/models/internal_tracker.rs deleted file mode 100644 index b6d8ad5..0000000 --- a/src/models/internal_tracker.rs +++ /dev/null @@ -1,46 +0,0 @@ -/* - * Forgejo API - * - * This documentation describes the Forgejo API. - * - * The version of the OpenAPI document: 14.0.2-2-84240ce3a2+gitea-1.22.0 - * - * Generated by: https://openapi-generator.tech - */ - -use crate::models; -use serde::{Deserialize, Serialize}; - -/// InternalTracker : InternalTracker represents settings for internal tracker -#[derive(Clone, Default, Debug, PartialEq, 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/src/models/issue.rs b/src/models/issue.rs deleted file mode 100644 index cbda0ad..0000000 --- a/src/models/issue.rs +++ /dev/null @@ -1,101 +0,0 @@ -/* - * Forgejo API - * - * This documentation describes the Forgejo API. - * - * The version of the OpenAPI document: 14.0.2-2-84240ce3a2+gitea-1.22.0 - * - * Generated by: https://openapi-generator.tech - */ - -use crate::models; -use serde::{Deserialize, Serialize}; - -/// Issue : Issue represents an issue in a repository -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct Issue { - #[serde(rename = "assets", skip_serializing_if = "Option::is_none")] - pub assets: 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 = "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 = "pin_order", skip_serializing_if = "Option::is_none")] - pub pin_order: 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 { - assets: None, - 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, - pin_order: None, - pull_request: None, - r#ref: None, - repository: None, - state: None, - title: None, - updated_at: None, - url: None, - user: None, - } - } -} diff --git a/src/models/issue_config.rs b/src/models/issue_config.rs deleted file mode 100644 index 564b4e4..0000000 --- a/src/models/issue_config.rs +++ /dev/null @@ -1,32 +0,0 @@ -/* - * Forgejo API - * - * This documentation describes the Forgejo API. - * - * The version of the OpenAPI document: 14.0.2-2-84240ce3a2+gitea-1.22.0 - * - * Generated by: https://openapi-generator.tech - */ - -use crate::models; -use serde::{Deserialize, Serialize}; - -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct IssueConfig { - #[serde( - rename = "blank_issues_enabled", - skip_serializing_if = "Option::is_none" - )] - pub blank_issues_enabled: Option, - #[serde(rename = "contact_links", skip_serializing_if = "Option::is_none")] - pub contact_links: Option>, -} - -impl IssueConfig { - pub fn new() -> IssueConfig { - IssueConfig { - blank_issues_enabled: None, - contact_links: None, - } - } -} diff --git a/src/models/issue_config_contact_link.rs b/src/models/issue_config_contact_link.rs deleted file mode 100644 index 9bfc950..0000000 --- a/src/models/issue_config_contact_link.rs +++ /dev/null @@ -1,32 +0,0 @@ -/* - * Forgejo API - * - * This documentation describes the Forgejo API. - * - * The version of the OpenAPI document: 14.0.2-2-84240ce3a2+gitea-1.22.0 - * - * Generated by: https://openapi-generator.tech - */ - -use crate::models; -use serde::{Deserialize, Serialize}; - -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct IssueConfigContactLink { - #[serde(rename = "about", skip_serializing_if = "Option::is_none")] - pub about: 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 IssueConfigContactLink { - pub fn new() -> IssueConfigContactLink { - IssueConfigContactLink { - about: None, - name: None, - url: None, - } - } -} diff --git a/src/models/issue_config_validation.rs b/src/models/issue_config_validation.rs deleted file mode 100644 index 7aafa49..0000000 --- a/src/models/issue_config_validation.rs +++ /dev/null @@ -1,29 +0,0 @@ -/* - * Forgejo API - * - * This documentation describes the Forgejo API. - * - * The version of the OpenAPI document: 14.0.2-2-84240ce3a2+gitea-1.22.0 - * - * Generated by: https://openapi-generator.tech - */ - -use crate::models; -use serde::{Deserialize, Serialize}; - -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct IssueConfigValidation { - #[serde(rename = "message", skip_serializing_if = "Option::is_none")] - pub message: Option, - #[serde(rename = "valid", skip_serializing_if = "Option::is_none")] - pub valid: Option, -} - -impl IssueConfigValidation { - pub fn new() -> IssueConfigValidation { - IssueConfigValidation { - message: None, - valid: None, - } - } -} diff --git a/src/models/issue_deadline.rs b/src/models/issue_deadline.rs deleted file mode 100644 index 5bda4c2..0000000 --- a/src/models/issue_deadline.rs +++ /dev/null @@ -1,26 +0,0 @@ -/* - * Forgejo API - * - * This documentation describes the Forgejo API. - * - * The version of the OpenAPI document: 14.0.2-2-84240ce3a2+gitea-1.22.0 - * - * Generated by: https://openapi-generator.tech - */ - -use crate::models; -use serde::{Deserialize, Serialize}; - -/// IssueDeadline : IssueDeadline represents an issue deadline -#[derive(Clone, Default, Debug, PartialEq, 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/src/models/issue_form_field.rs b/src/models/issue_form_field.rs deleted file mode 100644 index a369768..0000000 --- a/src/models/issue_form_field.rs +++ /dev/null @@ -1,40 +0,0 @@ -/* - * Forgejo API - * - * This documentation describes the Forgejo API. - * - * The version of the OpenAPI document: 14.0.2-2-84240ce3a2+gitea-1.22.0 - * - * Generated by: https://openapi-generator.tech - */ - -use crate::models; -use serde::{Deserialize, Serialize}; - -/// IssueFormField : IssueFormField represents a form field -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct IssueFormField { - #[serde(rename = "attributes", skip_serializing_if = "Option::is_none")] - pub attributes: 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 = "validations", skip_serializing_if = "Option::is_none")] - pub validations: Option>, - #[serde(rename = "visible", skip_serializing_if = "Option::is_none")] - pub visible: Option>, -} - -impl IssueFormField { - /// IssueFormField represents a form field - pub fn new() -> IssueFormField { - IssueFormField { - attributes: None, - id: None, - r#type: None, - validations: None, - visible: None, - } - } -} diff --git a/src/models/issue_labels_option.rs b/src/models/issue_labels_option.rs deleted file mode 100644 index 236f284..0000000 --- a/src/models/issue_labels_option.rs +++ /dev/null @@ -1,32 +0,0 @@ -/* - * Forgejo API - * - * This documentation describes the Forgejo API. - * - * The version of the OpenAPI document: 14.0.2-2-84240ce3a2+gitea-1.22.0 - * - * Generated by: https://openapi-generator.tech - */ - -use crate::models; -use serde::{Deserialize, Serialize}; - -/// IssueLabelsOption : IssueLabelsOption a collection of labels -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct IssueLabelsOption { - /// Labels can be a list of integers representing label IDs or a list of strings representing label names - #[serde(rename = "labels", skip_serializing_if = "Option::is_none")] - pub labels: Option>, - #[serde(rename = "updated_at", skip_serializing_if = "Option::is_none")] - pub updated_at: Option, -} - -impl IssueLabelsOption { - /// IssueLabelsOption a collection of labels - pub fn new() -> IssueLabelsOption { - IssueLabelsOption { - labels: None, - updated_at: None, - } - } -} diff --git a/src/models/issue_meta.rs b/src/models/issue_meta.rs deleted file mode 100644 index b302064..0000000 --- a/src/models/issue_meta.rs +++ /dev/null @@ -1,34 +0,0 @@ -/* - * Forgejo API - * - * This documentation describes the Forgejo API. - * - * The version of the OpenAPI document: 14.0.2-2-84240ce3a2+gitea-1.22.0 - * - * Generated by: https://openapi-generator.tech - */ - -use crate::models; -use serde::{Deserialize, Serialize}; - -/// IssueMeta : IssueMeta basic issue information -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct IssueMeta { - #[serde(rename = "index", skip_serializing_if = "Option::is_none")] - pub index: Option, - #[serde(rename = "owner", skip_serializing_if = "Option::is_none")] - pub owner: Option, - #[serde(rename = "repo", skip_serializing_if = "Option::is_none")] - pub repo: Option, -} - -impl IssueMeta { - /// IssueMeta basic issue information - pub fn new() -> IssueMeta { - IssueMeta { - index: None, - owner: None, - repo: None, - } - } -} diff --git a/src/models/issue_template.rs b/src/models/issue_template.rs deleted file mode 100644 index c41ca18..0000000 --- a/src/models/issue_template.rs +++ /dev/null @@ -1,49 +0,0 @@ -/* - * Forgejo API - * - * This documentation describes the Forgejo API. - * - * The version of the OpenAPI document: 14.0.2-2-84240ce3a2+gitea-1.22.0 - * - * Generated by: https://openapi-generator.tech - */ - -use crate::models; -use serde::{Deserialize, Serialize}; - -/// IssueTemplate : IssueTemplate represents an issue template for a repository -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct IssueTemplate { - #[serde(rename = "about", skip_serializing_if = "Option::is_none")] - pub about: Option, - #[serde(rename = "body", skip_serializing_if = "Option::is_none")] - pub body: 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, - body: None, - content: None, - file_name: None, - labels: None, - name: None, - r#ref: None, - title: None, - } - } -} diff --git a/src/models/label.rs b/src/models/label.rs deleted file mode 100644 index 51061d4..0000000 --- a/src/models/label.rs +++ /dev/null @@ -1,46 +0,0 @@ -/* - * Forgejo API - * - * This documentation describes the Forgejo API. - * - * The version of the OpenAPI document: 14.0.2-2-84240ce3a2+gitea-1.22.0 - * - * Generated by: https://openapi-generator.tech - */ - -use crate::models; -use serde::{Deserialize, Serialize}; - -/// Label : Label a label to an issue or a pr -#[derive(Clone, Default, Debug, PartialEq, 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 = "exclusive", skip_serializing_if = "Option::is_none")] - pub exclusive: Option, - #[serde(rename = "id", skip_serializing_if = "Option::is_none")] - pub id: Option, - #[serde(rename = "is_archived", skip_serializing_if = "Option::is_none")] - pub is_archived: 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, - exclusive: None, - id: None, - is_archived: None, - name: None, - url: None, - } - } -} diff --git a/src/models/label_template.rs b/src/models/label_template.rs deleted file mode 100644 index 06d9411..0000000 --- a/src/models/label_template.rs +++ /dev/null @@ -1,37 +0,0 @@ -/* - * Forgejo API - * - * This documentation describes the Forgejo API. - * - * The version of the OpenAPI document: 14.0.2-2-84240ce3a2+gitea-1.22.0 - * - * Generated by: https://openapi-generator.tech - */ - -use crate::models; -use serde::{Deserialize, Serialize}; - -/// LabelTemplate : LabelTemplate info of a Label template -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct LabelTemplate { - #[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 = "exclusive", skip_serializing_if = "Option::is_none")] - pub exclusive: Option, - #[serde(rename = "name", skip_serializing_if = "Option::is_none")] - pub name: Option, -} - -impl LabelTemplate { - /// LabelTemplate info of a Label template - pub fn new() -> LabelTemplate { - LabelTemplate { - color: None, - description: None, - exclusive: None, - name: None, - } - } -} diff --git a/src/models/license_template_info.rs b/src/models/license_template_info.rs deleted file mode 100644 index 59d1a21..0000000 --- a/src/models/license_template_info.rs +++ /dev/null @@ -1,40 +0,0 @@ -/* - * Forgejo API - * - * This documentation describes the Forgejo API. - * - * The version of the OpenAPI document: 14.0.2-2-84240ce3a2+gitea-1.22.0 - * - * Generated by: https://openapi-generator.tech - */ - -use crate::models; -use serde::{Deserialize, Serialize}; - -/// LicenseTemplateInfo : LicensesInfo contains information about a License -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct LicenseTemplateInfo { - #[serde(rename = "body", skip_serializing_if = "Option::is_none")] - pub body: Option, - #[serde(rename = "implementation", skip_serializing_if = "Option::is_none")] - pub implementation: Option, - #[serde(rename = "key", skip_serializing_if = "Option::is_none")] - pub key: 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 LicenseTemplateInfo { - /// LicensesInfo contains information about a License - pub fn new() -> LicenseTemplateInfo { - LicenseTemplateInfo { - body: None, - implementation: None, - key: None, - name: None, - url: None, - } - } -} diff --git a/src/models/licenses_template_list_entry.rs b/src/models/licenses_template_list_entry.rs deleted file mode 100644 index 7d21fe4..0000000 --- a/src/models/licenses_template_list_entry.rs +++ /dev/null @@ -1,34 +0,0 @@ -/* - * Forgejo API - * - * This documentation describes the Forgejo API. - * - * The version of the OpenAPI document: 14.0.2-2-84240ce3a2+gitea-1.22.0 - * - * Generated by: https://openapi-generator.tech - */ - -use crate::models; -use serde::{Deserialize, Serialize}; - -/// LicensesTemplateListEntry : LicensesListEntry is used for the API -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct LicensesTemplateListEntry { - #[serde(rename = "key", skip_serializing_if = "Option::is_none")] - pub key: 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 LicensesTemplateListEntry { - /// LicensesListEntry is used for the API - pub fn new() -> LicensesTemplateListEntry { - LicensesTemplateListEntry { - key: None, - name: None, - url: None, - } - } -} diff --git a/src/models/list_action_run_response.rs b/src/models/list_action_run_response.rs deleted file mode 100644 index c919f86..0000000 --- a/src/models/list_action_run_response.rs +++ /dev/null @@ -1,31 +0,0 @@ -/* - * Forgejo API - * - * This documentation describes the Forgejo API. - * - * The version of the OpenAPI document: 14.0.2-2-84240ce3a2+gitea-1.22.0 - * - * Generated by: https://openapi-generator.tech - */ - -use crate::models; -use serde::{Deserialize, Serialize}; - -/// ListActionRunResponse : ListActionRunResponse return a list of ActionRun -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct ListActionRunResponse { - #[serde(rename = "total_count", skip_serializing_if = "Option::is_none")] - pub total_count: Option, - #[serde(rename = "workflow_runs", skip_serializing_if = "Option::is_none")] - pub workflow_runs: Option>, -} - -impl ListActionRunResponse { - /// ListActionRunResponse return a list of ActionRun - pub fn new() -> ListActionRunResponse { - ListActionRunResponse { - total_count: None, - workflow_runs: None, - } - } -} diff --git a/src/models/markdown_option.rs b/src/models/markdown_option.rs deleted file mode 100644 index eb7e416..0000000 --- a/src/models/markdown_option.rs +++ /dev/null @@ -1,41 +0,0 @@ -/* - * Forgejo API - * - * This documentation describes the Forgejo API. - * - * The version of the OpenAPI document: 14.0.2-2-84240ce3a2+gitea-1.22.0 - * - * Generated by: https://openapi-generator.tech - */ - -use crate::models; -use serde::{Deserialize, Serialize}; - -/// MarkdownOption : MarkdownOption markdown options -#[derive(Clone, Default, Debug, PartialEq, 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 (comment, gfm, markdown) 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/src/models/markup_option.rs b/src/models/markup_option.rs deleted file mode 100644 index aaeb4cc..0000000 --- a/src/models/markup_option.rs +++ /dev/null @@ -1,49 +0,0 @@ -/* - * Forgejo API - * - * This documentation describes the Forgejo API. - * - * The version of the OpenAPI document: 14.0.2-2-84240ce3a2+gitea-1.22.0 - * - * Generated by: https://openapi-generator.tech - */ - -use crate::models; -use serde::{Deserialize, Serialize}; - -/// MarkupOption : MarkupOption markup options -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct MarkupOption { - /// The current branch path where the form gets posted in: body - #[serde(rename = "BranchPath", skip_serializing_if = "Option::is_none")] - pub branch_path: Option, - /// Context to render in: body - #[serde(rename = "Context", skip_serializing_if = "Option::is_none")] - pub context: Option, - /// File path for detecting extension in file mode in: body - #[serde(rename = "FilePath", skip_serializing_if = "Option::is_none")] - pub file_path: Option, - /// Mode to render (comment, gfm, markdown, file) in: body - #[serde(rename = "Mode", skip_serializing_if = "Option::is_none")] - pub mode: Option, - /// Text markup 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 MarkupOption { - /// MarkupOption markup options - pub fn new() -> MarkupOption { - MarkupOption { - branch_path: None, - context: None, - file_path: None, - mode: None, - text: None, - wiki: None, - } - } -} diff --git a/src/models/merge_pull_request_option.rs b/src/models/merge_pull_request_option.rs deleted file mode 100644 index 1597e5b..0000000 --- a/src/models/merge_pull_request_option.rs +++ /dev/null @@ -1,77 +0,0 @@ -/* - * Forgejo API - * - * This documentation describes the Forgejo API. - * - * The version of the OpenAPI document: 14.0.2-2-84240ce3a2+gitea-1.22.0 - * - * Generated by: https://openapi-generator.tech - */ - -use crate::models; -use serde::{Deserialize, Serialize}; - -/// MergePullRequestOption : MergePullRequestForm form for merging Pull Request -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct MergePullRequestOption { - #[serde(rename = "Do")] - pub r#do: Do, - #[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: Do) -> 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 Do { - #[serde(rename = "merge")] - Merge, - #[serde(rename = "rebase")] - Rebase, - #[serde(rename = "rebase-merge")] - RebaseMerge, - #[serde(rename = "squash")] - Squash, - #[serde(rename = "fast-forward-only")] - FastForwardOnly, - #[serde(rename = "manually-merged")] - ManuallyMerged, -} - -impl Default for Do { - fn default() -> Do { - Self::Merge - } -} diff --git a/src/models/migrate_repo_options.rs b/src/models/migrate_repo_options.rs deleted file mode 100644 index 77bc92c..0000000 --- a/src/models/migrate_repo_options.rs +++ /dev/null @@ -1,113 +0,0 @@ -/* - * Forgejo API - * - * This documentation describes the Forgejo API. - * - * The version of the OpenAPI document: 14.0.2-2-84240ce3a2+gitea-1.22.0 - * - * Generated by: https://openapi-generator.tech - */ - -use crate::models; -use serde::{Deserialize, Serialize}; - -/// MigrateRepoOptions : MigrateRepoOptions options for migrating repository's this is used to interact with api v1 -#[derive(Clone, Default, Debug, PartialEq, 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, - #[serde(rename = "gogs")] - Gogs, - #[serde(rename = "onedev")] - Onedev, - #[serde(rename = "gitbucket")] - Gitbucket, - #[serde(rename = "codebase")] - Codebase, -} - -impl Default for Service { - fn default() -> Service { - Self::Git - } -} diff --git a/src/models/milestone.rs b/src/models/milestone.rs deleted file mode 100644 index ae6d6d0..0000000 --- a/src/models/milestone.rs +++ /dev/null @@ -1,56 +0,0 @@ -/* - * Forgejo API - * - * This documentation describes the Forgejo API. - * - * The version of the OpenAPI document: 14.0.2-2-84240ce3a2+gitea-1.22.0 - * - * Generated by: https://openapi-generator.tech - */ - -use crate::models; -use serde::{Deserialize, Serialize}; - -/// Milestone : Milestone milestone is a collection of issues on one repository -#[derive(Clone, Default, Debug, PartialEq, 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/src/models/mod.rs b/src/models/mod.rs deleted file mode 100644 index c4a24ec..0000000 --- a/src/models/mod.rs +++ /dev/null @@ -1,456 +0,0 @@ -pub mod access_token; -pub use self::access_token::AccessToken; -pub mod action_run; -pub use self::action_run::ActionRun; -pub mod action_run_job; -pub use self::action_run_job::ActionRunJob; -pub mod action_task; -pub use self::action_task::ActionTask; -pub mod action_task_response; -pub use self::action_task_response::ActionTaskResponse; -pub mod action_variable; -pub use self::action_variable::ActionVariable; -pub mod activity; -pub use self::activity::Activity; -pub mod activity_pub; -pub use self::activity_pub::ActivityPub; -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 api_forbidden_error; -pub use self::api_forbidden_error::ApiForbiddenError; -pub mod api_internal_server_error; -pub use self::api_internal_server_error::ApiInternalServerError; -pub mod api_invalid_topics_error; -pub use self::api_invalid_topics_error::ApiInvalidTopicsError; -pub mod api_not_found; -pub use self::api_not_found::ApiNotFound; -pub mod api_repo_archived_error; -pub use self::api_repo_archived_error::ApiRepoArchivedError; -pub mod api_unauthorized_error; -pub use self::api_unauthorized_error::ApiUnauthorizedError; -pub mod api_validation_error; -pub use self::api_validation_error::ApiValidationError; -pub mod attachment; -pub use self::attachment::Attachment; -pub mod blocked_user; -pub use self::blocked_user::BlockedUser; -pub mod branch; -pub use self::branch::Branch; -pub mod branch_protection; -pub use self::branch_protection::BranchProtection; -pub mod change_file_operation; -pub use self::change_file_operation::ChangeFileOperation; -pub mod change_files_options; -pub use self::change_files_options::ChangeFilesOptions; -pub mod changed_file; -pub use self::changed_file::ChangedFile; -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 compare; -pub use self::compare::Compare; -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_or_update_secret_option; -pub use self::create_or_update_secret_option::CreateOrUpdateSecretOption; -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_push_mirror_option; -pub use self::create_push_mirror_option::CreatePushMirrorOption; -pub mod create_quota_group_options; -pub use self::create_quota_group_options::CreateQuotaGroupOptions; -pub mod create_quota_rule_options; -pub use self::create_quota_rule_options::CreateQuotaRuleOptions; -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_tag_protection_option; -pub use self::create_tag_protection_option::CreateTagProtectionOption; -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_variable_option; -pub use self::create_variable_option::CreateVariableOption; -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 delete_labels_option; -pub use self::delete_labels_option::DeleteLabelsOption; -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 dispatch_workflow_option; -pub use self::dispatch_workflow_option::DispatchWorkflowOption; -pub mod dispatch_workflow_run; -pub use self::dispatch_workflow_run::DispatchWorkflowRun; -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_quota_rule_options; -pub use self::edit_quota_rule_options::EditQuotaRuleOptions; -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_tag_protection_option; -pub use self::edit_tag_protection_option::EditTagProtectionOption; -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 files_response; -pub use self::files_response::FilesResponse; -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; -pub use self::git_blob::GitBlob; -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 gitignore_template_info; -pub use self::gitignore_template_info::GitignoreTemplateInfo; -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_config; -pub use self::issue_config::IssueConfig; -pub mod issue_config_contact_link; -pub use self::issue_config_contact_link::IssueConfigContactLink; -pub mod issue_config_validation; -pub use self::issue_config_validation::IssueConfigValidation; -pub mod issue_deadline; -pub use self::issue_deadline::IssueDeadline; -pub mod issue_form_field; -pub use self::issue_form_field::IssueFormField; -pub mod issue_labels_option; -pub use self::issue_labels_option::IssueLabelsOption; -pub mod issue_meta; -pub use self::issue_meta::IssueMeta; -pub mod issue_template; -pub use self::issue_template::IssueTemplate; -pub mod label; -pub use self::label::Label; -pub mod label_template; -pub use self::label_template::LabelTemplate; -pub mod license_template_info; -pub use self::license_template_info::LicenseTemplateInfo; -pub mod licenses_template_list_entry; -pub use self::licenses_template_list_entry::LicensesTemplateListEntry; -pub mod list_action_run_response; -pub use self::list_action_run_response::ListActionRunResponse; -pub mod markdown_option; -pub use self::markdown_option::MarkdownOption; -pub mod markup_option; -pub use self::markup_option::MarkupOption; -pub mod merge_pull_request_option; -pub use self::merge_pull_request_option::MergePullRequestOption; -pub mod migrate_repo_options; -pub use self::migrate_repo_options::MigrateRepoOptions; -pub mod milestone; -pub use self::milestone::Milestone; -pub mod new_issue_pins_allowed; -pub use self::new_issue_pins_allowed::NewIssuePinsAllowed; -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 note_options; -pub use self::note_options::NoteOptions; -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 push_mirror; -pub use self::push_mirror::PushMirror; -pub mod quota_group; -pub use self::quota_group::QuotaGroup; -pub mod quota_info; -pub use self::quota_info::QuotaInfo; -pub mod quota_rule_info; -pub use self::quota_rule_info::QuotaRuleInfo; -pub mod quota_used; -pub use self::quota_used::QuotaUsed; -pub mod quota_used_artifact; -pub use self::quota_used_artifact::QuotaUsedArtifact; -pub mod quota_used_attachment; -pub use self::quota_used_attachment::QuotaUsedAttachment; -pub mod quota_used_attachment_contained_in; -pub use self::quota_used_attachment_contained_in::QuotaUsedAttachmentContainedIn; -pub mod quota_used_package; -pub use self::quota_used_package::QuotaUsedPackage; -pub mod quota_used_size; -pub use self::quota_used_size::QuotaUsedSize; -pub mod quota_used_size_assets; -pub use self::quota_used_size_assets::QuotaUsedSizeAssets; -pub mod quota_used_size_assets_attachments; -pub use self::quota_used_size_assets_attachments::QuotaUsedSizeAssetsAttachments; -pub mod quota_used_size_assets_packages; -pub use self::quota_used_size_assets_packages::QuotaUsedSizeAssetsPackages; -pub mod quota_used_size_git; -pub use self::quota_used_size_git::QuotaUsedSizeGit; -pub mod quota_used_size_repos; -pub use self::quota_used_size_repos::QuotaUsedSizeRepos; -pub mod reaction; -pub use self::reaction::Reaction; -pub mod reference; -pub use self::reference::Reference; -pub mod registration_token; -pub use self::registration_token::RegistrationToken; -pub mod release; -pub use self::release::Release; -pub mod rename_org_option; -pub use self::rename_org_option::RenameOrgOption; -pub mod rename_user_option; -pub use self::rename_user_option::RenameUserOption; -pub mod replace_flags_option; -pub use self::replace_flags_option::ReplaceFlagsOption; -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_create_release_attachment_request; -pub use self::repo_create_release_attachment_request::RepoCreateReleaseAttachmentRequest; -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 secret; -pub use self::secret::Secret; -pub mod server_version; -pub use self::server_version::ServerVersion; -pub mod set_user_quota_groups_options; -pub use self::set_user_quota_groups_options::SetUserQuotaGroupsOptions; -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 sync_fork_info; -pub use self::sync_fork_info::SyncForkInfo; -pub mod tag; -pub use self::tag::Tag; -pub mod tag_archive_download_count; -pub use self::tag_archive_download_count::TagArchiveDownloadCount; -pub mod tag_protection; -pub use self::tag_protection::TagProtection; -pub mod team; -pub use self::team::Team; -pub mod team_search_results; -pub use self::team_search_results::TeamSearchResults; -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 topic_search_results; -pub use self::topic_search_results::TopicSearchResults; -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_branch_repo_option; -pub use self::update_branch_repo_option::UpdateBranchRepoOption; -pub mod update_file_options; -pub use self::update_file_options::UpdateFileOptions; -pub mod update_repo_avatar_option; -pub use self::update_repo_avatar_option::UpdateRepoAvatarOption; -pub mod update_user_avatar_option; -pub use self::update_user_avatar_option::UpdateUserAvatarOption; -pub mod update_variable_option; -pub use self::update_variable_option::UpdateVariableOption; -pub mod user; -pub use self::user::User; -pub mod user_heatmap_data; -pub use self::user_heatmap_data::UserHeatmapData; -pub mod user_search_results; -pub use self::user_search_results::UserSearchResults; -pub mod user_settings; -pub use self::user_settings::UserSettings; -pub mod user_settings_options; -pub use self::user_settings_options::UserSettingsOptions; -pub mod verify_gpg_key_option; -pub use self::verify_gpg_key_option::VerifyGpgKeyOption; -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/src/models/new_issue_pins_allowed.rs b/src/models/new_issue_pins_allowed.rs deleted file mode 100644 index ee29a7e..0000000 --- a/src/models/new_issue_pins_allowed.rs +++ /dev/null @@ -1,31 +0,0 @@ -/* - * Forgejo API - * - * This documentation describes the Forgejo API. - * - * The version of the OpenAPI document: 14.0.2-2-84240ce3a2+gitea-1.22.0 - * - * Generated by: https://openapi-generator.tech - */ - -use crate::models; -use serde::{Deserialize, Serialize}; - -/// NewIssuePinsAllowed : NewIssuePinsAllowed represents an API response that says if new Issue Pins are allowed -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct NewIssuePinsAllowed { - #[serde(rename = "issues", skip_serializing_if = "Option::is_none")] - pub issues: Option, - #[serde(rename = "pull_requests", skip_serializing_if = "Option::is_none")] - pub pull_requests: Option, -} - -impl NewIssuePinsAllowed { - /// NewIssuePinsAllowed represents an API response that says if new Issue Pins are allowed - pub fn new() -> NewIssuePinsAllowed { - NewIssuePinsAllowed { - issues: None, - pull_requests: None, - } - } -} diff --git a/src/models/node_info.rs b/src/models/node_info.rs deleted file mode 100644 index 96adb12..0000000 --- a/src/models/node_info.rs +++ /dev/null @@ -1,46 +0,0 @@ -/* - * Forgejo API - * - * This documentation describes the Forgejo API. - * - * The version of the OpenAPI document: 14.0.2-2-84240ce3a2+gitea-1.22.0 - * - * Generated by: https://openapi-generator.tech - */ - -use crate::models; -use serde::{Deserialize, Serialize}; - -/// NodeInfo : NodeInfo contains standardized way of exposing metadata about a server running one of the distributed social networks -#[derive(Clone, Default, Debug, PartialEq, 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/src/models/node_info_services.rs b/src/models/node_info_services.rs deleted file mode 100644 index 46141e4..0000000 --- a/src/models/node_info_services.rs +++ /dev/null @@ -1,31 +0,0 @@ -/* - * Forgejo API - * - * This documentation describes the Forgejo API. - * - * The version of the OpenAPI document: 14.0.2-2-84240ce3a2+gitea-1.22.0 - * - * Generated by: https://openapi-generator.tech - */ - -use crate::models; -use serde::{Deserialize, Serialize}; - -/// NodeInfoServices : NodeInfoServices contains the third party sites this server can connect to via their application API -#[derive(Clone, Default, Debug, PartialEq, 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/src/models/node_info_software.rs b/src/models/node_info_software.rs deleted file mode 100644 index eea46e9..0000000 --- a/src/models/node_info_software.rs +++ /dev/null @@ -1,37 +0,0 @@ -/* - * Forgejo API - * - * This documentation describes the Forgejo API. - * - * The version of the OpenAPI document: 14.0.2-2-84240ce3a2+gitea-1.22.0 - * - * Generated by: https://openapi-generator.tech - */ - -use crate::models; -use serde::{Deserialize, Serialize}; - -/// NodeInfoSoftware : NodeInfoSoftware contains Metadata about server software in use -#[derive(Clone, Default, Debug, PartialEq, 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/src/models/node_info_usage.rs b/src/models/node_info_usage.rs deleted file mode 100644 index a7011de..0000000 --- a/src/models/node_info_usage.rs +++ /dev/null @@ -1,34 +0,0 @@ -/* - * Forgejo API - * - * This documentation describes the Forgejo API. - * - * The version of the OpenAPI document: 14.0.2-2-84240ce3a2+gitea-1.22.0 - * - * Generated by: https://openapi-generator.tech - */ - -use crate::models; -use serde::{Deserialize, Serialize}; - -/// NodeInfoUsage : NodeInfoUsage contains usage statistics for this server -#[derive(Clone, Default, Debug, PartialEq, 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/src/models/node_info_usage_users.rs b/src/models/node_info_usage_users.rs deleted file mode 100644 index fb08f49..0000000 --- a/src/models/node_info_usage_users.rs +++ /dev/null @@ -1,34 +0,0 @@ -/* - * Forgejo API - * - * This documentation describes the Forgejo API. - * - * The version of the OpenAPI document: 14.0.2-2-84240ce3a2+gitea-1.22.0 - * - * Generated by: https://openapi-generator.tech - */ - -use crate::models; -use serde::{Deserialize, Serialize}; - -/// NodeInfoUsageUsers : NodeInfoUsageUsers contains statistics about the users of this server -#[derive(Clone, Default, Debug, PartialEq, 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/src/models/note.rs b/src/models/note.rs deleted file mode 100644 index adebb0d..0000000 --- a/src/models/note.rs +++ /dev/null @@ -1,31 +0,0 @@ -/* - * Forgejo API - * - * This documentation describes the Forgejo API. - * - * The version of the OpenAPI document: 14.0.2-2-84240ce3a2+gitea-1.22.0 - * - * Generated by: https://openapi-generator.tech - */ - -use crate::models; -use serde::{Deserialize, Serialize}; - -/// Note : Note contains information related to a git note -#[derive(Clone, Default, Debug, PartialEq, 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/src/models/note_options.rs b/src/models/note_options.rs deleted file mode 100644 index ca2465f..0000000 --- a/src/models/note_options.rs +++ /dev/null @@ -1,24 +0,0 @@ -/* - * Forgejo API - * - * This documentation describes the Forgejo API. - * - * The version of the OpenAPI document: 14.0.2-2-84240ce3a2+gitea-1.22.0 - * - * Generated by: https://openapi-generator.tech - */ - -use crate::models; -use serde::{Deserialize, Serialize}; - -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct NoteOptions { - #[serde(rename = "message", skip_serializing_if = "Option::is_none")] - pub message: Option, -} - -impl NoteOptions { - pub fn new() -> NoteOptions { - NoteOptions { message: None } - } -} diff --git a/src/models/notification_count.rs b/src/models/notification_count.rs deleted file mode 100644 index 260c160..0000000 --- a/src/models/notification_count.rs +++ /dev/null @@ -1,26 +0,0 @@ -/* - * Forgejo API - * - * This documentation describes the Forgejo API. - * - * The version of the OpenAPI document: 14.0.2-2-84240ce3a2+gitea-1.22.0 - * - * Generated by: https://openapi-generator.tech - */ - -use crate::models; -use serde::{Deserialize, Serialize}; - -/// NotificationCount : NotificationCount number of unread notifications -#[derive(Clone, Default, Debug, PartialEq, 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/src/models/notification_subject.rs b/src/models/notification_subject.rs deleted file mode 100644 index 77fd2fd..0000000 --- a/src/models/notification_subject.rs +++ /dev/null @@ -1,51 +0,0 @@ -/* - * Forgejo API - * - * This documentation describes the Forgejo API. - * - * The version of the OpenAPI document: 14.0.2-2-84240ce3a2+gitea-1.22.0 - * - * Generated by: https://openapi-generator.tech - */ - -use crate::models; -use serde::{Deserialize, Serialize}; - -/// NotificationSubject : NotificationSubject contains the notification subject (Issue/Pull/Commit) -#[derive(Clone, Default, Debug, PartialEq, 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/src/models/notification_thread.rs b/src/models/notification_thread.rs deleted file mode 100644 index 6afc33c..0000000 --- a/src/models/notification_thread.rs +++ /dev/null @@ -1,46 +0,0 @@ -/* - * Forgejo API - * - * This documentation describes the Forgejo API. - * - * The version of the OpenAPI document: 14.0.2-2-84240ce3a2+gitea-1.22.0 - * - * Generated by: https://openapi-generator.tech - */ - -use crate::models; -use serde::{Deserialize, Serialize}; - -/// NotificationThread : NotificationThread expose Notification on API -#[derive(Clone, Default, Debug, PartialEq, 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/src/models/o_auth2_application.rs b/src/models/o_auth2_application.rs deleted file mode 100644 index 40a66ab..0000000 --- a/src/models/o_auth2_application.rs +++ /dev/null @@ -1,47 +0,0 @@ -/* - * Forgejo API - * - * This documentation describes the Forgejo API. - * - * The version of the OpenAPI document: 14.0.2-2-84240ce3a2+gitea-1.22.0 - * - * Generated by: https://openapi-generator.tech - */ - -use crate::models; -use serde::{Deserialize, Serialize}; - -#[derive(Clone, Default, Debug, PartialEq, 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 = "confidential_client", - skip_serializing_if = "Option::is_none" - )] - pub confidential_client: 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, - confidential_client: None, - created: None, - id: None, - name: None, - redirect_uris: None, - } - } -} diff --git a/src/models/organization.rs b/src/models/organization.rs deleted file mode 100644 index ccdaf31..0000000 --- a/src/models/organization.rs +++ /dev/null @@ -1,62 +0,0 @@ -/* - * Forgejo API - * - * This documentation describes the Forgejo API. - * - * The version of the OpenAPI document: 14.0.2-2-84240ce3a2+gitea-1.22.0 - * - * Generated by: https://openapi-generator.tech - */ - -use crate::models; -use serde::{Deserialize, Serialize}; - -/// Organization : Organization represents an organization -#[derive(Clone, Default, Debug, PartialEq, 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 = "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 = "id", skip_serializing_if = "Option::is_none")] - pub id: Option, - #[serde(rename = "location", skip_serializing_if = "Option::is_none")] - pub location: Option, - #[serde(rename = "name", skip_serializing_if = "Option::is_none")] - pub name: Option, - #[serde( - rename = "repo_admin_change_team_access", - skip_serializing_if = "Option::is_none" - )] - pub repo_admin_change_team_access: Option, - /// deprecated - #[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, - email: None, - full_name: None, - id: None, - location: None, - name: None, - repo_admin_change_team_access: None, - username: None, - visibility: None, - website: None, - } - } -} diff --git a/src/models/organization_permissions.rs b/src/models/organization_permissions.rs deleted file mode 100644 index fc07b92..0000000 --- a/src/models/organization_permissions.rs +++ /dev/null @@ -1,43 +0,0 @@ -/* - * Forgejo API - * - * This documentation describes the Forgejo API. - * - * The version of the OpenAPI document: 14.0.2-2-84240ce3a2+gitea-1.22.0 - * - * Generated by: https://openapi-generator.tech - */ - -use crate::models; -use serde::{Deserialize, Serialize}; - -/// OrganizationPermissions : OrganizationPermissions list different users permissions on an organization -#[derive(Clone, Default, Debug, PartialEq, 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/src/models/package.rs b/src/models/package.rs deleted file mode 100644 index 685d00b..0000000 --- a/src/models/package.rs +++ /dev/null @@ -1,52 +0,0 @@ -/* - * Forgejo API - * - * This documentation describes the Forgejo API. - * - * The version of the OpenAPI document: 14.0.2-2-84240ce3a2+gitea-1.22.0 - * - * Generated by: https://openapi-generator.tech - */ - -use crate::models; -use serde::{Deserialize, Serialize}; - -/// Package : Package represents a package -#[derive(Clone, Default, Debug, PartialEq, 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 = "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 = "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, - html_url: None, - id: None, - name: None, - owner: None, - repository: None, - r#type: None, - version: None, - } - } -} diff --git a/src/models/package_file.rs b/src/models/package_file.rs deleted file mode 100644 index 59ae6ab..0000000 --- a/src/models/package_file.rs +++ /dev/null @@ -1,46 +0,0 @@ -/* - * Forgejo API - * - * This documentation describes the Forgejo API. - * - * The version of the OpenAPI document: 14.0.2-2-84240ce3a2+gitea-1.22.0 - * - * Generated by: https://openapi-generator.tech - */ - -use crate::models; -use serde::{Deserialize, Serialize}; - -/// PackageFile : PackageFile represents a package file -#[derive(Clone, Default, Debug, PartialEq, 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/src/models/payload_commit.rs b/src/models/payload_commit.rs deleted file mode 100644 index acb91c1..0000000 --- a/src/models/payload_commit.rs +++ /dev/null @@ -1,56 +0,0 @@ -/* - * Forgejo API - * - * This documentation describes the Forgejo API. - * - * The version of the OpenAPI document: 14.0.2-2-84240ce3a2+gitea-1.22.0 - * - * Generated by: https://openapi-generator.tech - */ - -use crate::models; -use serde::{Deserialize, Serialize}; - -/// PayloadCommit : PayloadCommit represents a commit -#[derive(Clone, Default, Debug, PartialEq, 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/src/models/payload_commit_verification.rs b/src/models/payload_commit_verification.rs deleted file mode 100644 index f24eefc..0000000 --- a/src/models/payload_commit_verification.rs +++ /dev/null @@ -1,40 +0,0 @@ -/* - * Forgejo API - * - * This documentation describes the Forgejo API. - * - * The version of the OpenAPI document: 14.0.2-2-84240ce3a2+gitea-1.22.0 - * - * Generated by: https://openapi-generator.tech - */ - -use crate::models; -use serde::{Deserialize, Serialize}; - -/// PayloadCommitVerification : PayloadCommitVerification represents the GPG verification of a commit -#[derive(Clone, Default, Debug, PartialEq, 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/src/models/payload_user.rs b/src/models/payload_user.rs deleted file mode 100644 index af14dae..0000000 --- a/src/models/payload_user.rs +++ /dev/null @@ -1,35 +0,0 @@ -/* - * Forgejo API - * - * This documentation describes the Forgejo API. - * - * The version of the OpenAPI document: 14.0.2-2-84240ce3a2+gitea-1.22.0 - * - * Generated by: https://openapi-generator.tech - */ - -use crate::models; -use serde::{Deserialize, Serialize}; - -/// PayloadUser : PayloadUser represents the author or committer of a commit -#[derive(Clone, Default, Debug, PartialEq, 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/src/models/permission.rs b/src/models/permission.rs deleted file mode 100644 index 1c8a059..0000000 --- a/src/models/permission.rs +++ /dev/null @@ -1,34 +0,0 @@ -/* - * Forgejo API - * - * This documentation describes the Forgejo API. - * - * The version of the OpenAPI document: 14.0.2-2-84240ce3a2+gitea-1.22.0 - * - * Generated by: https://openapi-generator.tech - */ - -use crate::models; -use serde::{Deserialize, Serialize}; - -/// Permission : Permission represents a set of permissions -#[derive(Clone, Default, Debug, PartialEq, 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/src/models/pr_branch_info.rs b/src/models/pr_branch_info.rs deleted file mode 100644 index 015cadf..0000000 --- a/src/models/pr_branch_info.rs +++ /dev/null @@ -1,40 +0,0 @@ -/* - * Forgejo API - * - * This documentation describes the Forgejo API. - * - * The version of the OpenAPI document: 14.0.2-2-84240ce3a2+gitea-1.22.0 - * - * Generated by: https://openapi-generator.tech - */ - -use crate::models; -use serde::{Deserialize, Serialize}; - -/// PrBranchInfo : PRBranchInfo information about a branch -#[derive(Clone, Default, Debug, PartialEq, 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/src/models/public_key.rs b/src/models/public_key.rs deleted file mode 100644 index 8224e70..0000000 --- a/src/models/public_key.rs +++ /dev/null @@ -1,52 +0,0 @@ -/* - * Forgejo API - * - * This documentation describes the Forgejo API. - * - * The version of the OpenAPI document: 14.0.2-2-84240ce3a2+gitea-1.22.0 - * - * Generated by: https://openapi-generator.tech - */ - -use crate::models; -use serde::{Deserialize, Serialize}; - -/// PublicKey : PublicKey publickey is a user key to push code to repository -#[derive(Clone, Default, Debug, PartialEq, 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/src/models/pull_request.rs b/src/models/pull_request.rs deleted file mode 100644 index 8cd99c5..0000000 --- a/src/models/pull_request.rs +++ /dev/null @@ -1,150 +0,0 @@ -/* - * Forgejo API - * - * This documentation describes the Forgejo API. - * - * The version of the OpenAPI document: 14.0.2-2-84240ce3a2+gitea-1.22.0 - * - * Generated by: https://openapi-generator.tech - */ - -use crate::models; -use serde::{Deserialize, Serialize}; - -/// PullRequest : PullRequest represents a pull request -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct PullRequest { - #[serde(rename = "additions", skip_serializing_if = "Option::is_none")] - pub additions: Option, - #[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 = "changed_files", skip_serializing_if = "Option::is_none")] - pub changed_files: 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 = "deletions", skip_serializing_if = "Option::is_none")] - pub deletions: Option, - #[serde(rename = "diff_url", skip_serializing_if = "Option::is_none")] - pub diff_url: Option, - #[serde(rename = "draft", skip_serializing_if = "Option::is_none")] - pub draft: Option, - #[serde(rename = "due_date", skip_serializing_if = "Option::is_none")] - pub due_date: Option, - #[serde(rename = "flow", skip_serializing_if = "Option::is_none")] - pub flow: 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, - #[serde(rename = "pin_order", skip_serializing_if = "Option::is_none")] - pub pin_order: Option, - #[serde( - rename = "requested_reviewers", - skip_serializing_if = "Option::is_none" - )] - pub requested_reviewers: Option>, - #[serde( - rename = "requested_reviewers_teams", - skip_serializing_if = "Option::is_none" - )] - pub requested_reviewers_teams: Option>, - /// number of review comments made on the diff of a PR review (not including comments on commits or issues in a PR) - #[serde(rename = "review_comments", skip_serializing_if = "Option::is_none")] - pub review_comments: 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 { - additions: None, - allow_maintainer_edit: None, - assignee: None, - assignees: None, - base: None, - body: None, - changed_files: None, - closed_at: None, - comments: None, - created_at: None, - deletions: None, - diff_url: None, - draft: None, - due_date: None, - flow: 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, - pin_order: None, - requested_reviewers: None, - requested_reviewers_teams: None, - review_comments: None, - state: None, - title: None, - updated_at: None, - url: None, - user: None, - } - } -} diff --git a/src/models/pull_request_meta.rs b/src/models/pull_request_meta.rs deleted file mode 100644 index a683737..0000000 --- a/src/models/pull_request_meta.rs +++ /dev/null @@ -1,37 +0,0 @@ -/* - * Forgejo API - * - * This documentation describes the Forgejo API. - * - * The version of the OpenAPI document: 14.0.2-2-84240ce3a2+gitea-1.22.0 - * - * Generated by: https://openapi-generator.tech - */ - -use crate::models; -use serde::{Deserialize, Serialize}; - -/// PullRequestMeta : PullRequestMeta PR info if an issue is a PR -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct PullRequestMeta { - #[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 = "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 { - draft: None, - html_url: None, - merged: None, - merged_at: None, - } - } -} diff --git a/src/models/pull_review.rs b/src/models/pull_review.rs deleted file mode 100644 index c73dbcf..0000000 --- a/src/models/pull_review.rs +++ /dev/null @@ -1,68 +0,0 @@ -/* - * Forgejo API - * - * This documentation describes the Forgejo API. - * - * The version of the OpenAPI document: 14.0.2-2-84240ce3a2+gitea-1.22.0 - * - * Generated by: https://openapi-generator.tech - */ - -use crate::models; -use serde::{Deserialize, Serialize}; - -/// PullReview : PullReview represents a pull request review -#[derive(Clone, Default, Debug, PartialEq, 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 = "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 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, - updated_at: None, - user: None, - } - } -} diff --git a/src/models/pull_review_comment.rs b/src/models/pull_review_comment.rs deleted file mode 100644 index 09e208e..0000000 --- a/src/models/pull_review_comment.rs +++ /dev/null @@ -1,73 +0,0 @@ -/* - * Forgejo API - * - * This documentation describes the Forgejo API. - * - * The version of the OpenAPI document: 14.0.2-2-84240ce3a2+gitea-1.22.0 - * - * Generated by: https://openapi-generator.tech - */ - -use crate::models; -use serde::{Deserialize, Serialize}; - -/// PullReviewComment : PullReviewComment represents a comment on a pull request review -#[derive(Clone, Default, Debug, PartialEq, 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/src/models/pull_review_request_options.rs b/src/models/pull_review_request_options.rs deleted file mode 100644 index ec21ee1..0000000 --- a/src/models/pull_review_request_options.rs +++ /dev/null @@ -1,31 +0,0 @@ -/* - * Forgejo API - * - * This documentation describes the Forgejo API. - * - * The version of the OpenAPI document: 14.0.2-2-84240ce3a2+gitea-1.22.0 - * - * Generated by: https://openapi-generator.tech - */ - -use crate::models; -use serde::{Deserialize, Serialize}; - -/// PullReviewRequestOptions : PullReviewRequestOptions are options to add or remove pull review requests -#[derive(Clone, Default, Debug, PartialEq, 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/src/models/push_mirror.rs b/src/models/push_mirror.rs deleted file mode 100644 index 00c978e..0000000 --- a/src/models/push_mirror.rs +++ /dev/null @@ -1,55 +0,0 @@ -/* - * Forgejo API - * - * This documentation describes the Forgejo API. - * - * The version of the OpenAPI document: 14.0.2-2-84240ce3a2+gitea-1.22.0 - * - * Generated by: https://openapi-generator.tech - */ - -use crate::models; -use serde::{Deserialize, Serialize}; - -/// PushMirror : PushMirror represents information of a push mirror -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct PushMirror { - #[serde(rename = "branch_filter", skip_serializing_if = "Option::is_none")] - pub branch_filter: Option, - #[serde(rename = "created", skip_serializing_if = "Option::is_none")] - pub created: Option, - #[serde(rename = "interval", skip_serializing_if = "Option::is_none")] - pub interval: Option, - #[serde(rename = "last_error", skip_serializing_if = "Option::is_none")] - pub last_error: Option, - #[serde(rename = "last_update", skip_serializing_if = "Option::is_none")] - pub last_update: Option, - #[serde(rename = "public_key", skip_serializing_if = "Option::is_none")] - pub public_key: Option, - #[serde(rename = "remote_address", skip_serializing_if = "Option::is_none")] - pub remote_address: Option, - #[serde(rename = "remote_name", skip_serializing_if = "Option::is_none")] - pub remote_name: Option, - #[serde(rename = "repo_name", skip_serializing_if = "Option::is_none")] - pub repo_name: Option, - #[serde(rename = "sync_on_commit", skip_serializing_if = "Option::is_none")] - pub sync_on_commit: Option, -} - -impl PushMirror { - /// PushMirror represents information of a push mirror - pub fn new() -> PushMirror { - PushMirror { - branch_filter: None, - created: None, - interval: None, - last_error: None, - last_update: None, - public_key: None, - remote_address: None, - remote_name: None, - repo_name: None, - sync_on_commit: None, - } - } -} diff --git a/src/models/quota_group.rs b/src/models/quota_group.rs deleted file mode 100644 index feab054..0000000 --- a/src/models/quota_group.rs +++ /dev/null @@ -1,33 +0,0 @@ -/* - * Forgejo API - * - * This documentation describes the Forgejo API. - * - * The version of the OpenAPI document: 14.0.2-2-84240ce3a2+gitea-1.22.0 - * - * Generated by: https://openapi-generator.tech - */ - -use crate::models; -use serde::{Deserialize, Serialize}; - -/// QuotaGroup : QuotaGroup represents a quota group -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct QuotaGroup { - /// Name of the group - #[serde(rename = "name", skip_serializing_if = "Option::is_none")] - pub name: Option, - /// Rules associated with the group - #[serde(rename = "rules", skip_serializing_if = "Option::is_none")] - pub rules: Option>, -} - -impl QuotaGroup { - /// QuotaGroup represents a quota group - pub fn new() -> QuotaGroup { - QuotaGroup { - name: None, - rules: None, - } - } -} diff --git a/src/models/quota_info.rs b/src/models/quota_info.rs deleted file mode 100644 index dcf2f64..0000000 --- a/src/models/quota_info.rs +++ /dev/null @@ -1,32 +0,0 @@ -/* - * Forgejo API - * - * This documentation describes the Forgejo API. - * - * The version of the OpenAPI document: 14.0.2-2-84240ce3a2+gitea-1.22.0 - * - * Generated by: https://openapi-generator.tech - */ - -use crate::models; -use serde::{Deserialize, Serialize}; - -/// QuotaInfo : QuotaInfo represents information about a user's quota -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct QuotaInfo { - /// QuotaGroupList represents a list of quota groups - #[serde(rename = "groups", skip_serializing_if = "Option::is_none")] - pub groups: Option>, - #[serde(rename = "used", skip_serializing_if = "Option::is_none")] - pub used: Option>, -} - -impl QuotaInfo { - /// QuotaInfo represents information about a user's quota - pub fn new() -> QuotaInfo { - QuotaInfo { - groups: None, - used: None, - } - } -} diff --git a/src/models/quota_rule_info.rs b/src/models/quota_rule_info.rs deleted file mode 100644 index 7cb5c98..0000000 --- a/src/models/quota_rule_info.rs +++ /dev/null @@ -1,37 +0,0 @@ -/* - * Forgejo API - * - * This documentation describes the Forgejo API. - * - * The version of the OpenAPI document: 14.0.2-2-84240ce3a2+gitea-1.22.0 - * - * Generated by: https://openapi-generator.tech - */ - -use crate::models; -use serde::{Deserialize, Serialize}; - -/// QuotaRuleInfo : QuotaRuleInfo contains information about a quota rule -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct QuotaRuleInfo { - /// The limit set by the rule - #[serde(rename = "limit", skip_serializing_if = "Option::is_none")] - pub limit: Option, - /// Name of the rule (only shown to admins) - #[serde(rename = "name", skip_serializing_if = "Option::is_none")] - pub name: Option, - /// Subjects the rule affects - #[serde(rename = "subjects", skip_serializing_if = "Option::is_none")] - pub subjects: Option>, -} - -impl QuotaRuleInfo { - /// QuotaRuleInfo contains information about a quota rule - pub fn new() -> QuotaRuleInfo { - QuotaRuleInfo { - limit: None, - name: None, - subjects: None, - } - } -} diff --git a/src/models/quota_used.rs b/src/models/quota_used.rs deleted file mode 100644 index c9f05d1..0000000 --- a/src/models/quota_used.rs +++ /dev/null @@ -1,26 +0,0 @@ -/* - * Forgejo API - * - * This documentation describes the Forgejo API. - * - * The version of the OpenAPI document: 14.0.2-2-84240ce3a2+gitea-1.22.0 - * - * Generated by: https://openapi-generator.tech - */ - -use crate::models; -use serde::{Deserialize, Serialize}; - -/// QuotaUsed : QuotaUsed represents the quota usage of a user -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct QuotaUsed { - #[serde(rename = "size", skip_serializing_if = "Option::is_none")] - pub size: Option>, -} - -impl QuotaUsed { - /// QuotaUsed represents the quota usage of a user - pub fn new() -> QuotaUsed { - QuotaUsed { size: None } - } -} diff --git a/src/models/quota_used_artifact.rs b/src/models/quota_used_artifact.rs deleted file mode 100644 index 8ff2dda..0000000 --- a/src/models/quota_used_artifact.rs +++ /dev/null @@ -1,37 +0,0 @@ -/* - * Forgejo API - * - * This documentation describes the Forgejo API. - * - * The version of the OpenAPI document: 14.0.2-2-84240ce3a2+gitea-1.22.0 - * - * Generated by: https://openapi-generator.tech - */ - -use crate::models; -use serde::{Deserialize, Serialize}; - -/// QuotaUsedArtifact : QuotaUsedArtifact represents an artifact counting towards a user's quota -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct QuotaUsedArtifact { - /// HTML URL to the action run containing the artifact - #[serde(rename = "html_url", skip_serializing_if = "Option::is_none")] - pub html_url: Option, - /// Name of the artifact - #[serde(rename = "name", skip_serializing_if = "Option::is_none")] - pub name: Option, - /// Size of the artifact (compressed) - #[serde(rename = "size", skip_serializing_if = "Option::is_none")] - pub size: Option, -} - -impl QuotaUsedArtifact { - /// QuotaUsedArtifact represents an artifact counting towards a user's quota - pub fn new() -> QuotaUsedArtifact { - QuotaUsedArtifact { - html_url: None, - name: None, - size: None, - } - } -} diff --git a/src/models/quota_used_attachment.rs b/src/models/quota_used_attachment.rs deleted file mode 100644 index 3ebc9aa..0000000 --- a/src/models/quota_used_attachment.rs +++ /dev/null @@ -1,40 +0,0 @@ -/* - * Forgejo API - * - * This documentation describes the Forgejo API. - * - * The version of the OpenAPI document: 14.0.2-2-84240ce3a2+gitea-1.22.0 - * - * Generated by: https://openapi-generator.tech - */ - -use crate::models; -use serde::{Deserialize, Serialize}; - -/// QuotaUsedAttachment : QuotaUsedAttachment represents an attachment counting towards a user's quota -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct QuotaUsedAttachment { - /// API URL for the attachment - #[serde(rename = "api_url", skip_serializing_if = "Option::is_none")] - pub api_url: Option, - #[serde(rename = "contained_in", skip_serializing_if = "Option::is_none")] - pub contained_in: Option>, - /// Filename of the attachment - #[serde(rename = "name", skip_serializing_if = "Option::is_none")] - pub name: Option, - /// Size of the attachment (in bytes) - #[serde(rename = "size", skip_serializing_if = "Option::is_none")] - pub size: Option, -} - -impl QuotaUsedAttachment { - /// QuotaUsedAttachment represents an attachment counting towards a user's quota - pub fn new() -> QuotaUsedAttachment { - QuotaUsedAttachment { - api_url: None, - contained_in: None, - name: None, - size: None, - } - } -} diff --git a/src/models/quota_used_attachment_contained_in.rs b/src/models/quota_used_attachment_contained_in.rs deleted file mode 100644 index f32149f..0000000 --- a/src/models/quota_used_attachment_contained_in.rs +++ /dev/null @@ -1,33 +0,0 @@ -/* - * Forgejo API - * - * This documentation describes the Forgejo API. - * - * The version of the OpenAPI document: 14.0.2-2-84240ce3a2+gitea-1.22.0 - * - * Generated by: https://openapi-generator.tech - */ - -use crate::models; -use serde::{Deserialize, Serialize}; - -/// QuotaUsedAttachmentContainedIn : Context for the attachment: URLs to the containing object -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct QuotaUsedAttachmentContainedIn { - /// API URL for the object that contains this attachment - #[serde(rename = "api_url", skip_serializing_if = "Option::is_none")] - pub api_url: Option, - /// HTML URL for the object that contains this attachment - #[serde(rename = "html_url", skip_serializing_if = "Option::is_none")] - pub html_url: Option, -} - -impl QuotaUsedAttachmentContainedIn { - /// Context for the attachment: URLs to the containing object - pub fn new() -> QuotaUsedAttachmentContainedIn { - QuotaUsedAttachmentContainedIn { - api_url: None, - html_url: None, - } - } -} diff --git a/src/models/quota_used_package.rs b/src/models/quota_used_package.rs deleted file mode 100644 index da01156..0000000 --- a/src/models/quota_used_package.rs +++ /dev/null @@ -1,45 +0,0 @@ -/* - * Forgejo API - * - * This documentation describes the Forgejo API. - * - * The version of the OpenAPI document: 14.0.2-2-84240ce3a2+gitea-1.22.0 - * - * Generated by: https://openapi-generator.tech - */ - -use crate::models; -use serde::{Deserialize, Serialize}; - -/// QuotaUsedPackage : QuotaUsedPackage represents a package counting towards a user's quota -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct QuotaUsedPackage { - /// HTML URL to the package version - #[serde(rename = "html_url", skip_serializing_if = "Option::is_none")] - pub html_url: Option, - /// Name of the package - #[serde(rename = "name", skip_serializing_if = "Option::is_none")] - pub name: Option, - /// Size of the package version - #[serde(rename = "size", skip_serializing_if = "Option::is_none")] - pub size: Option, - /// Type of the package - #[serde(rename = "type", skip_serializing_if = "Option::is_none")] - pub r#type: Option, - /// Version of the package - #[serde(rename = "version", skip_serializing_if = "Option::is_none")] - pub version: Option, -} - -impl QuotaUsedPackage { - /// QuotaUsedPackage represents a package counting towards a user's quota - pub fn new() -> QuotaUsedPackage { - QuotaUsedPackage { - html_url: None, - name: None, - size: None, - r#type: None, - version: None, - } - } -} diff --git a/src/models/quota_used_size.rs b/src/models/quota_used_size.rs deleted file mode 100644 index 1333541..0000000 --- a/src/models/quota_used_size.rs +++ /dev/null @@ -1,34 +0,0 @@ -/* - * Forgejo API - * - * This documentation describes the Forgejo API. - * - * The version of the OpenAPI document: 14.0.2-2-84240ce3a2+gitea-1.22.0 - * - * Generated by: https://openapi-generator.tech - */ - -use crate::models; -use serde::{Deserialize, Serialize}; - -/// QuotaUsedSize : QuotaUsedSize represents the size-based quota usage of a user -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct QuotaUsedSize { - #[serde(rename = "assets", skip_serializing_if = "Option::is_none")] - pub assets: Option>, - #[serde(rename = "git", skip_serializing_if = "Option::is_none")] - pub git: Option>, - #[serde(rename = "repos", skip_serializing_if = "Option::is_none")] - pub repos: Option>, -} - -impl QuotaUsedSize { - /// QuotaUsedSize represents the size-based quota usage of a user - pub fn new() -> QuotaUsedSize { - QuotaUsedSize { - assets: None, - git: None, - repos: None, - } - } -} diff --git a/src/models/quota_used_size_assets.rs b/src/models/quota_used_size_assets.rs deleted file mode 100644 index 7679e07..0000000 --- a/src/models/quota_used_size_assets.rs +++ /dev/null @@ -1,35 +0,0 @@ -/* - * Forgejo API - * - * This documentation describes the Forgejo API. - * - * The version of the OpenAPI document: 14.0.2-2-84240ce3a2+gitea-1.22.0 - * - * Generated by: https://openapi-generator.tech - */ - -use crate::models; -use serde::{Deserialize, Serialize}; - -/// QuotaUsedSizeAssets : QuotaUsedSizeAssets represents the size-based asset usage of a user -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct QuotaUsedSizeAssets { - /// Storage size used for the user's artifacts - #[serde(rename = "artifacts", skip_serializing_if = "Option::is_none")] - pub artifacts: Option, - #[serde(rename = "attachments", skip_serializing_if = "Option::is_none")] - pub attachments: Option>, - #[serde(rename = "packages", skip_serializing_if = "Option::is_none")] - pub packages: Option>, -} - -impl QuotaUsedSizeAssets { - /// QuotaUsedSizeAssets represents the size-based asset usage of a user - pub fn new() -> QuotaUsedSizeAssets { - QuotaUsedSizeAssets { - artifacts: None, - attachments: None, - packages: None, - } - } -} diff --git a/src/models/quota_used_size_assets_attachments.rs b/src/models/quota_used_size_assets_attachments.rs deleted file mode 100644 index ff3995f..0000000 --- a/src/models/quota_used_size_assets_attachments.rs +++ /dev/null @@ -1,33 +0,0 @@ -/* - * Forgejo API - * - * This documentation describes the Forgejo API. - * - * The version of the OpenAPI document: 14.0.2-2-84240ce3a2+gitea-1.22.0 - * - * Generated by: https://openapi-generator.tech - */ - -use crate::models; -use serde::{Deserialize, Serialize}; - -/// QuotaUsedSizeAssetsAttachments : QuotaUsedSizeAssetsAttachments represents the size-based attachment quota usage of a user -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct QuotaUsedSizeAssetsAttachments { - /// Storage size used for the user's issue & comment attachments - #[serde(rename = "issues", skip_serializing_if = "Option::is_none")] - pub issues: Option, - /// Storage size used for the user's release attachments - #[serde(rename = "releases", skip_serializing_if = "Option::is_none")] - pub releases: Option, -} - -impl QuotaUsedSizeAssetsAttachments { - /// QuotaUsedSizeAssetsAttachments represents the size-based attachment quota usage of a user - pub fn new() -> QuotaUsedSizeAssetsAttachments { - QuotaUsedSizeAssetsAttachments { - issues: None, - releases: None, - } - } -} diff --git a/src/models/quota_used_size_assets_packages.rs b/src/models/quota_used_size_assets_packages.rs deleted file mode 100644 index 33aa821..0000000 --- a/src/models/quota_used_size_assets_packages.rs +++ /dev/null @@ -1,27 +0,0 @@ -/* - * Forgejo API - * - * This documentation describes the Forgejo API. - * - * The version of the OpenAPI document: 14.0.2-2-84240ce3a2+gitea-1.22.0 - * - * Generated by: https://openapi-generator.tech - */ - -use crate::models; -use serde::{Deserialize, Serialize}; - -/// QuotaUsedSizeAssetsPackages : QuotaUsedSizeAssetsPackages represents the size-based package quota usage of a user -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct QuotaUsedSizeAssetsPackages { - /// Storage suze used for the user's packages - #[serde(rename = "all", skip_serializing_if = "Option::is_none")] - pub all: Option, -} - -impl QuotaUsedSizeAssetsPackages { - /// QuotaUsedSizeAssetsPackages represents the size-based package quota usage of a user - pub fn new() -> QuotaUsedSizeAssetsPackages { - QuotaUsedSizeAssetsPackages { all: None } - } -} diff --git a/src/models/quota_used_size_git.rs b/src/models/quota_used_size_git.rs deleted file mode 100644 index d91eede..0000000 --- a/src/models/quota_used_size_git.rs +++ /dev/null @@ -1,27 +0,0 @@ -/* - * Forgejo API - * - * This documentation describes the Forgejo API. - * - * The version of the OpenAPI document: 14.0.2-2-84240ce3a2+gitea-1.22.0 - * - * Generated by: https://openapi-generator.tech - */ - -use crate::models; -use serde::{Deserialize, Serialize}; - -/// QuotaUsedSizeGit : QuotaUsedSizeGit represents the size-based git (lfs) quota usage of a user -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct QuotaUsedSizeGit { - /// Storage size of the user's Git LFS objects - #[serde(rename = "LFS", skip_serializing_if = "Option::is_none")] - pub lfs: Option, -} - -impl QuotaUsedSizeGit { - /// QuotaUsedSizeGit represents the size-based git (lfs) quota usage of a user - pub fn new() -> QuotaUsedSizeGit { - QuotaUsedSizeGit { lfs: None } - } -} diff --git a/src/models/quota_used_size_repos.rs b/src/models/quota_used_size_repos.rs deleted file mode 100644 index 0a7ea59..0000000 --- a/src/models/quota_used_size_repos.rs +++ /dev/null @@ -1,33 +0,0 @@ -/* - * Forgejo API - * - * This documentation describes the Forgejo API. - * - * The version of the OpenAPI document: 14.0.2-2-84240ce3a2+gitea-1.22.0 - * - * Generated by: https://openapi-generator.tech - */ - -use crate::models; -use serde::{Deserialize, Serialize}; - -/// QuotaUsedSizeRepos : QuotaUsedSizeRepos represents the size-based repository quota usage of a user -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct QuotaUsedSizeRepos { - /// Storage size of the user's private repositories - #[serde(rename = "private", skip_serializing_if = "Option::is_none")] - pub private: Option, - /// Storage size of the user's public repositories - #[serde(rename = "public", skip_serializing_if = "Option::is_none")] - pub public: Option, -} - -impl QuotaUsedSizeRepos { - /// QuotaUsedSizeRepos represents the size-based repository quota usage of a user - pub fn new() -> QuotaUsedSizeRepos { - QuotaUsedSizeRepos { - private: None, - public: None, - } - } -} diff --git a/src/models/reaction.rs b/src/models/reaction.rs deleted file mode 100644 index b54f666..0000000 --- a/src/models/reaction.rs +++ /dev/null @@ -1,34 +0,0 @@ -/* - * Forgejo API - * - * This documentation describes the Forgejo API. - * - * The version of the OpenAPI document: 14.0.2-2-84240ce3a2+gitea-1.22.0 - * - * Generated by: https://openapi-generator.tech - */ - -use crate::models; -use serde::{Deserialize, Serialize}; - -/// Reaction : Reaction contain one reaction -#[derive(Clone, Default, Debug, PartialEq, 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/src/models/reference.rs b/src/models/reference.rs deleted file mode 100644 index 39d4338..0000000 --- a/src/models/reference.rs +++ /dev/null @@ -1,32 +0,0 @@ -/* - * Forgejo API - * - * This documentation describes the Forgejo API. - * - * The version of the OpenAPI document: 14.0.2-2-84240ce3a2+gitea-1.22.0 - * - * Generated by: https://openapi-generator.tech - */ - -use crate::models; -use serde::{Deserialize, Serialize}; - -#[derive(Clone, Default, Debug, PartialEq, 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/src/models/registration_token.rs b/src/models/registration_token.rs deleted file mode 100644 index f3ca223..0000000 --- a/src/models/registration_token.rs +++ /dev/null @@ -1,26 +0,0 @@ -/* - * Forgejo API - * - * This documentation describes the Forgejo API. - * - * The version of the OpenAPI document: 14.0.2-2-84240ce3a2+gitea-1.22.0 - * - * Generated by: https://openapi-generator.tech - */ - -use crate::models; -use serde::{Deserialize, Serialize}; - -/// RegistrationToken : RegistrationToken is a string used to register a runner with a server -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct RegistrationToken { - #[serde(rename = "token", skip_serializing_if = "Option::is_none")] - pub token: Option, -} - -impl RegistrationToken { - /// RegistrationToken is a string used to register a runner with a server - pub fn new() -> RegistrationToken { - RegistrationToken { token: None } - } -} diff --git a/src/models/release.rs b/src/models/release.rs deleted file mode 100644 index dec7a1a..0000000 --- a/src/models/release.rs +++ /dev/null @@ -1,82 +0,0 @@ -/* - * Forgejo API - * - * This documentation describes the Forgejo API. - * - * The version of the OpenAPI document: 14.0.2-2-84240ce3a2+gitea-1.22.0 - * - * Generated by: https://openapi-generator.tech - */ - -use crate::models; -use serde::{Deserialize, Serialize}; - -/// Release : Release represents a repository release -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct Release { - #[serde( - rename = "archive_download_count", - skip_serializing_if = "Option::is_none" - )] - pub archive_download_count: Option>, - #[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 = "hide_archive_links", skip_serializing_if = "Option::is_none")] - pub hide_archive_links: 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 = "upload_url", skip_serializing_if = "Option::is_none")] - pub upload_url: 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 { - archive_download_count: None, - assets: None, - author: None, - body: None, - created_at: None, - draft: None, - hide_archive_links: None, - html_url: None, - id: None, - name: None, - prerelease: None, - published_at: None, - tag_name: None, - tarball_url: None, - target_commitish: None, - upload_url: None, - url: None, - zipball_url: None, - } - } -} diff --git a/src/models/rename_org_option.rs b/src/models/rename_org_option.rs deleted file mode 100644 index 6fec7c6..0000000 --- a/src/models/rename_org_option.rs +++ /dev/null @@ -1,27 +0,0 @@ -/* - * Forgejo API - * - * This documentation describes the Forgejo API. - * - * The version of the OpenAPI document: 14.0.2-2-84240ce3a2+gitea-1.22.0 - * - * Generated by: https://openapi-generator.tech - */ - -use crate::models; -use serde::{Deserialize, Serialize}; - -/// RenameOrgOption : RenameOrgOption options when renaming an organization -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct RenameOrgOption { - /// New username for this org. This name cannot be in use yet by any other user. - #[serde(rename = "new_name")] - pub new_name: String, -} - -impl RenameOrgOption { - /// RenameOrgOption options when renaming an organization - pub fn new(new_name: String) -> RenameOrgOption { - RenameOrgOption { new_name } - } -} diff --git a/src/models/rename_user_option.rs b/src/models/rename_user_option.rs deleted file mode 100644 index 4ec6334..0000000 --- a/src/models/rename_user_option.rs +++ /dev/null @@ -1,27 +0,0 @@ -/* - * Forgejo API - * - * This documentation describes the Forgejo API. - * - * The version of the OpenAPI document: 14.0.2-2-84240ce3a2+gitea-1.22.0 - * - * Generated by: https://openapi-generator.tech - */ - -use crate::models; -use serde::{Deserialize, Serialize}; - -/// RenameUserOption : RenameUserOption options when renaming a user -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct RenameUserOption { - /// New username for this user. This name cannot be in use yet by any other user. - #[serde(rename = "new_username")] - pub new_username: String, -} - -impl RenameUserOption { - /// RenameUserOption options when renaming a user - pub fn new(new_username: String) -> RenameUserOption { - RenameUserOption { new_username } - } -} diff --git a/src/models/replace_flags_option.rs b/src/models/replace_flags_option.rs deleted file mode 100644 index 313862a..0000000 --- a/src/models/replace_flags_option.rs +++ /dev/null @@ -1,26 +0,0 @@ -/* - * Forgejo API - * - * This documentation describes the Forgejo API. - * - * The version of the OpenAPI document: 14.0.2-2-84240ce3a2+gitea-1.22.0 - * - * Generated by: https://openapi-generator.tech - */ - -use crate::models; -use serde::{Deserialize, Serialize}; - -/// ReplaceFlagsOption : ReplaceFlagsOption options when replacing the flags of a repository -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct ReplaceFlagsOption { - #[serde(rename = "flags", skip_serializing_if = "Option::is_none")] - pub flags: Option>, -} - -impl ReplaceFlagsOption { - /// ReplaceFlagsOption options when replacing the flags of a repository - pub fn new() -> ReplaceFlagsOption { - ReplaceFlagsOption { flags: None } - } -} diff --git a/src/models/repo_collaborator_permission.rs b/src/models/repo_collaborator_permission.rs deleted file mode 100644 index 6f3b2fe..0000000 --- a/src/models/repo_collaborator_permission.rs +++ /dev/null @@ -1,34 +0,0 @@ -/* - * Forgejo API - * - * This documentation describes the Forgejo API. - * - * The version of the OpenAPI document: 14.0.2-2-84240ce3a2+gitea-1.22.0 - * - * Generated by: https://openapi-generator.tech - */ - -use crate::models; -use serde::{Deserialize, Serialize}; - -/// RepoCollaboratorPermission : RepoCollaboratorPermission to get repository permission for a collaborator -#[derive(Clone, Default, Debug, PartialEq, 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/src/models/repo_commit.rs b/src/models/repo_commit.rs deleted file mode 100644 index 461f536..0000000 --- a/src/models/repo_commit.rs +++ /dev/null @@ -1,41 +0,0 @@ -/* - * Forgejo API - * - * This documentation describes the Forgejo API. - * - * The version of the OpenAPI document: 14.0.2-2-84240ce3a2+gitea-1.22.0 - * - * Generated by: https://openapi-generator.tech - */ - -use crate::models; -use serde::{Deserialize, Serialize}; - -#[derive(Clone, Default, Debug, PartialEq, 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/src/models/repo_create_release_attachment_request.rs b/src/models/repo_create_release_attachment_request.rs deleted file mode 100644 index 116f9da..0000000 --- a/src/models/repo_create_release_attachment_request.rs +++ /dev/null @@ -1,31 +0,0 @@ -/* - * Forgejo API - * - * This documentation describes the Forgejo API. - * - * The version of the OpenAPI document: 14.0.2-2-84240ce3a2+gitea-1.22.0 - * - * Generated by: https://openapi-generator.tech - */ - -use crate::models; -use serde::{Deserialize, Serialize}; - -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct RepoCreateReleaseAttachmentRequest { - /// attachment to upload (this parameter is incompatible with `external_url`) - #[serde(rename = "attachment", skip_serializing_if = "Option::is_none")] - pub attachment: Option, - /// url to external asset (this parameter is incompatible with `attachment`) - #[serde(rename = "external_url", skip_serializing_if = "Option::is_none")] - pub external_url: Option, -} - -impl RepoCreateReleaseAttachmentRequest { - pub fn new() -> RepoCreateReleaseAttachmentRequest { - RepoCreateReleaseAttachmentRequest { - attachment: None, - external_url: None, - } - } -} diff --git a/src/models/repo_topic_options.rs b/src/models/repo_topic_options.rs deleted file mode 100644 index 849bf4b..0000000 --- a/src/models/repo_topic_options.rs +++ /dev/null @@ -1,27 +0,0 @@ -/* - * Forgejo API - * - * This documentation describes the Forgejo API. - * - * The version of the OpenAPI document: 14.0.2-2-84240ce3a2+gitea-1.22.0 - * - * Generated by: https://openapi-generator.tech - */ - -use crate::models; -use serde::{Deserialize, Serialize}; - -/// RepoTopicOptions : RepoTopicOptions a collection of repo topic names -#[derive(Clone, Default, Debug, PartialEq, 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/src/models/repo_transfer.rs b/src/models/repo_transfer.rs deleted file mode 100644 index a72fc91..0000000 --- a/src/models/repo_transfer.rs +++ /dev/null @@ -1,34 +0,0 @@ -/* - * Forgejo API - * - * This documentation describes the Forgejo API. - * - * The version of the OpenAPI document: 14.0.2-2-84240ce3a2+gitea-1.22.0 - * - * Generated by: https://openapi-generator.tech - */ - -use crate::models; -use serde::{Deserialize, Serialize}; - -/// RepoTransfer : RepoTransfer represents a pending repo transfer -#[derive(Clone, Default, Debug, PartialEq, 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/src/models/repository.rs b/src/models/repository.rs deleted file mode 100644 index 6ec4d3f..0000000 --- a/src/models/repository.rs +++ /dev/null @@ -1,259 +0,0 @@ -/* - * Forgejo API - * - * This documentation describes the Forgejo API. - * - * The version of the OpenAPI document: 14.0.2-2-84240ce3a2+gitea-1.22.0 - * - * Generated by: https://openapi-generator.tech - */ - -use crate::models; -use serde::{Deserialize, Serialize}; - -/// Repository : Repository represents a repository -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct Repository { - #[serde( - rename = "allow_fast_forward_only_merge", - skip_serializing_if = "Option::is_none" - )] - pub allow_fast_forward_only_merge: Option, - #[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_rebase_update", - skip_serializing_if = "Option::is_none" - )] - pub allow_rebase_update: 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 = "archived_at", skip_serializing_if = "Option::is_none")] - pub archived_at: 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_allow_maintainer_edit", - skip_serializing_if = "Option::is_none" - )] - pub default_allow_maintainer_edit: Option, - #[serde(rename = "default_branch", skip_serializing_if = "Option::is_none")] - pub default_branch: Option, - #[serde( - rename = "default_delete_branch_after_merge", - skip_serializing_if = "Option::is_none" - )] - pub default_delete_branch_after_merge: Option, - #[serde( - rename = "default_merge_style", - skip_serializing_if = "Option::is_none" - )] - pub default_merge_style: Option, - #[serde( - rename = "default_update_style", - skip_serializing_if = "Option::is_none" - )] - pub default_update_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 = "globally_editable_wiki", - skip_serializing_if = "Option::is_none" - )] - pub globally_editable_wiki: Option, - #[serde(rename = "has_actions", skip_serializing_if = "Option::is_none")] - pub has_actions: Option, - #[serde(rename = "has_issues", skip_serializing_if = "Option::is_none")] - pub has_issues: Option, - #[serde(rename = "has_packages", skip_serializing_if = "Option::is_none")] - pub has_packages: 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_releases", skip_serializing_if = "Option::is_none")] - pub has_releases: 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 = "link", skip_serializing_if = "Option::is_none")] - pub link: 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, - /// ObjectFormatName of the underlying git repository - #[serde(rename = "object_format_name", skip_serializing_if = "Option::is_none")] - pub object_format_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 = "topics", skip_serializing_if = "Option::is_none")] - pub topics: 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 = "watchers_count", skip_serializing_if = "Option::is_none")] - pub watchers_count: Option, - #[serde(rename = "website", skip_serializing_if = "Option::is_none")] - pub website: Option, - #[serde(rename = "wiki_branch", skip_serializing_if = "Option::is_none")] - pub wiki_branch: Option, -} - -impl Repository { - /// Repository represents a repository - pub fn new() -> Repository { - Repository { - allow_fast_forward_only_merge: None, - allow_merge_commits: None, - allow_rebase: None, - allow_rebase_explicit: None, - allow_rebase_update: None, - allow_squash_merge: None, - archived: None, - archived_at: None, - avatar_url: None, - clone_url: None, - created_at: None, - default_allow_maintainer_edit: None, - default_branch: None, - default_delete_branch_after_merge: None, - default_merge_style: None, - default_update_style: None, - description: None, - empty: None, - external_tracker: None, - external_wiki: None, - fork: None, - forks_count: None, - full_name: None, - globally_editable_wiki: None, - has_actions: None, - has_issues: None, - has_packages: None, - has_projects: None, - has_pull_requests: None, - has_releases: None, - has_wiki: None, - html_url: None, - id: None, - ignore_whitespace_conflicts: None, - internal: None, - internal_tracker: None, - language: None, - languages_url: None, - link: None, - mirror: None, - mirror_interval: None, - mirror_updated: None, - name: None, - object_format_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, - topics: None, - updated_at: None, - url: None, - watchers_count: None, - website: None, - wiki_branch: None, - } - } -} -/// ObjectFormatName of the underlying git repository -#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)] -pub enum ObjectFormatName { - #[serde(rename = "sha1")] - Sha1, - #[serde(rename = "sha256")] - Sha256, -} - -impl Default for ObjectFormatName { - fn default() -> ObjectFormatName { - Self::Sha1 - } -} diff --git a/src/models/repository_meta.rs b/src/models/repository_meta.rs deleted file mode 100644 index 2a321a4..0000000 --- a/src/models/repository_meta.rs +++ /dev/null @@ -1,37 +0,0 @@ -/* - * Forgejo API - * - * This documentation describes the Forgejo API. - * - * The version of the OpenAPI document: 14.0.2-2-84240ce3a2+gitea-1.22.0 - * - * Generated by: https://openapi-generator.tech - */ - -use crate::models; -use serde::{Deserialize, Serialize}; - -/// RepositoryMeta : RepositoryMeta basic repository information -#[derive(Clone, Default, Debug, PartialEq, 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/src/models/search_results.rs b/src/models/search_results.rs deleted file mode 100644 index b9e7e92..0000000 --- a/src/models/search_results.rs +++ /dev/null @@ -1,31 +0,0 @@ -/* - * Forgejo API - * - * This documentation describes the Forgejo API. - * - * The version of the OpenAPI document: 14.0.2-2-84240ce3a2+gitea-1.22.0 - * - * Generated by: https://openapi-generator.tech - */ - -use crate::models; -use serde::{Deserialize, Serialize}; - -/// SearchResults : SearchResults results of a successful search -#[derive(Clone, Default, Debug, PartialEq, 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/src/models/secret.rs b/src/models/secret.rs deleted file mode 100644 index 2e195c0..0000000 --- a/src/models/secret.rs +++ /dev/null @@ -1,32 +0,0 @@ -/* - * Forgejo API - * - * This documentation describes the Forgejo API. - * - * The version of the OpenAPI document: 14.0.2-2-84240ce3a2+gitea-1.22.0 - * - * Generated by: https://openapi-generator.tech - */ - -use crate::models; -use serde::{Deserialize, Serialize}; - -/// Secret : Secret represents a secret -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct Secret { - #[serde(rename = "created_at", skip_serializing_if = "Option::is_none")] - pub created_at: Option, - /// the secret's name - #[serde(rename = "name", skip_serializing_if = "Option::is_none")] - pub name: Option, -} - -impl Secret { - /// Secret represents a secret - pub fn new() -> Secret { - Secret { - created_at: None, - name: None, - } - } -} diff --git a/src/models/server_version.rs b/src/models/server_version.rs deleted file mode 100644 index 901fd33..0000000 --- a/src/models/server_version.rs +++ /dev/null @@ -1,26 +0,0 @@ -/* - * Forgejo API - * - * This documentation describes the Forgejo API. - * - * The version of the OpenAPI document: 14.0.2-2-84240ce3a2+gitea-1.22.0 - * - * Generated by: https://openapi-generator.tech - */ - -use crate::models; -use serde::{Deserialize, Serialize}; - -/// ServerVersion : ServerVersion wraps the version of the server -#[derive(Clone, Default, Debug, PartialEq, 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/src/models/set_user_quota_groups_options.rs b/src/models/set_user_quota_groups_options.rs deleted file mode 100644 index 95f0ac0..0000000 --- a/src/models/set_user_quota_groups_options.rs +++ /dev/null @@ -1,27 +0,0 @@ -/* - * Forgejo API - * - * This documentation describes the Forgejo API. - * - * The version of the OpenAPI document: 14.0.2-2-84240ce3a2+gitea-1.22.0 - * - * Generated by: https://openapi-generator.tech - */ - -use crate::models; -use serde::{Deserialize, Serialize}; - -/// SetUserQuotaGroupsOptions : SetUserQuotaGroupsOptions represents the quota groups of a user -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct SetUserQuotaGroupsOptions { - /// Quota groups the user shall have - #[serde(rename = "groups")] - pub groups: Vec, -} - -impl SetUserQuotaGroupsOptions { - /// SetUserQuotaGroupsOptions represents the quota groups of a user - pub fn new(groups: Vec) -> SetUserQuotaGroupsOptions { - SetUserQuotaGroupsOptions { groups } - } -} diff --git a/src/models/stop_watch.rs b/src/models/stop_watch.rs deleted file mode 100644 index fef35d9..0000000 --- a/src/models/stop_watch.rs +++ /dev/null @@ -1,46 +0,0 @@ -/* - * Forgejo API - * - * This documentation describes the Forgejo API. - * - * The version of the OpenAPI document: 14.0.2-2-84240ce3a2+gitea-1.22.0 - * - * Generated by: https://openapi-generator.tech - */ - -use crate::models; -use serde::{Deserialize, Serialize}; - -/// StopWatch : StopWatch represent a running stopwatch -#[derive(Clone, Default, Debug, PartialEq, 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/src/models/submit_pull_review_options.rs b/src/models/submit_pull_review_options.rs deleted file mode 100644 index 3dff5dc..0000000 --- a/src/models/submit_pull_review_options.rs +++ /dev/null @@ -1,32 +0,0 @@ -/* - * Forgejo API - * - * This documentation describes the Forgejo API. - * - * The version of the OpenAPI document: 14.0.2-2-84240ce3a2+gitea-1.22.0 - * - * Generated by: https://openapi-generator.tech - */ - -use crate::models; -use serde::{Deserialize, Serialize}; - -/// SubmitPullReviewOptions : SubmitPullReviewOptions are options to submit a pending pull review -#[derive(Clone, Default, Debug, PartialEq, 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/src/models/sync_fork_info.rs b/src/models/sync_fork_info.rs deleted file mode 100644 index 5096718..0000000 --- a/src/models/sync_fork_info.rs +++ /dev/null @@ -1,37 +0,0 @@ -/* - * Forgejo API - * - * This documentation describes the Forgejo API. - * - * The version of the OpenAPI document: 14.0.2-2-84240ce3a2+gitea-1.22.0 - * - * Generated by: https://openapi-generator.tech - */ - -use crate::models; -use serde::{Deserialize, Serialize}; - -/// SyncForkInfo : SyncForkInfo information about syncing a fork -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct SyncForkInfo { - #[serde(rename = "allowed", skip_serializing_if = "Option::is_none")] - pub allowed: Option, - #[serde(rename = "base_commit", skip_serializing_if = "Option::is_none")] - pub base_commit: Option, - #[serde(rename = "commits_behind", skip_serializing_if = "Option::is_none")] - pub commits_behind: Option, - #[serde(rename = "fork_commit", skip_serializing_if = "Option::is_none")] - pub fork_commit: Option, -} - -impl SyncForkInfo { - /// SyncForkInfo information about syncing a fork - pub fn new() -> SyncForkInfo { - SyncForkInfo { - allowed: None, - base_commit: None, - commits_behind: None, - fork_commit: None, - } - } -} diff --git a/src/models/tag.rs b/src/models/tag.rs deleted file mode 100644 index e5b3412..0000000 --- a/src/models/tag.rs +++ /dev/null @@ -1,49 +0,0 @@ -/* - * Forgejo API - * - * This documentation describes the Forgejo API. - * - * The version of the OpenAPI document: 14.0.2-2-84240ce3a2+gitea-1.22.0 - * - * Generated by: https://openapi-generator.tech - */ - -use crate::models; -use serde::{Deserialize, Serialize}; - -/// Tag : Tag represents a repository tag -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct Tag { - #[serde( - rename = "archive_download_count", - skip_serializing_if = "Option::is_none" - )] - pub archive_download_count: Option>, - #[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 { - archive_download_count: None, - commit: None, - id: None, - message: None, - name: None, - tarball_url: None, - zipball_url: None, - } - } -} diff --git a/src/models/tag_archive_download_count.rs b/src/models/tag_archive_download_count.rs deleted file mode 100644 index 6cbc44c..0000000 --- a/src/models/tag_archive_download_count.rs +++ /dev/null @@ -1,31 +0,0 @@ -/* - * Forgejo API - * - * This documentation describes the Forgejo API. - * - * The version of the OpenAPI document: 14.0.2-2-84240ce3a2+gitea-1.22.0 - * - * Generated by: https://openapi-generator.tech - */ - -use crate::models; -use serde::{Deserialize, Serialize}; - -/// TagArchiveDownloadCount : TagArchiveDownloadCount counts how many times a archive was downloaded -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct TagArchiveDownloadCount { - #[serde(rename = "tar_gz", skip_serializing_if = "Option::is_none")] - pub tar_gz: Option, - #[serde(rename = "zip", skip_serializing_if = "Option::is_none")] - pub zip: Option, -} - -impl TagArchiveDownloadCount { - /// TagArchiveDownloadCount counts how many times a archive was downloaded - pub fn new() -> TagArchiveDownloadCount { - TagArchiveDownloadCount { - tar_gz: None, - zip: None, - } - } -} diff --git a/src/models/tag_protection.rs b/src/models/tag_protection.rs deleted file mode 100644 index c504319..0000000 --- a/src/models/tag_protection.rs +++ /dev/null @@ -1,46 +0,0 @@ -/* - * Forgejo API - * - * This documentation describes the Forgejo API. - * - * The version of the OpenAPI document: 14.0.2-2-84240ce3a2+gitea-1.22.0 - * - * Generated by: https://openapi-generator.tech - */ - -use crate::models; -use serde::{Deserialize, Serialize}; - -/// TagProtection : TagProtection represents a tag protection -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct TagProtection { - #[serde(rename = "created_at", skip_serializing_if = "Option::is_none")] - pub created_at: Option, - #[serde(rename = "id", skip_serializing_if = "Option::is_none")] - pub id: Option, - #[serde(rename = "name_pattern", skip_serializing_if = "Option::is_none")] - pub name_pattern: Option, - #[serde(rename = "updated_at", skip_serializing_if = "Option::is_none")] - pub updated_at: Option, - #[serde(rename = "whitelist_teams", skip_serializing_if = "Option::is_none")] - pub whitelist_teams: Option>, - #[serde( - rename = "whitelist_usernames", - skip_serializing_if = "Option::is_none" - )] - pub whitelist_usernames: Option>, -} - -impl TagProtection { - /// TagProtection represents a tag protection - pub fn new() -> TagProtection { - TagProtection { - created_at: None, - id: None, - name_pattern: None, - updated_at: None, - whitelist_teams: None, - whitelist_usernames: None, - } - } -} diff --git a/src/models/team.rs b/src/models/team.rs deleted file mode 100644 index 96aa1ef..0000000 --- a/src/models/team.rs +++ /dev/null @@ -1,78 +0,0 @@ -/* - * Forgejo API - * - * This documentation describes the Forgejo API. - * - * The version of the OpenAPI document: 14.0.2-2-84240ce3a2+gitea-1.22.0 - * - * Generated by: https://openapi-generator.tech - */ - -use crate::models; -use serde::{Deserialize, Serialize}; - -/// Team : Team represents a team in an organization -#[derive(Clone, Default, Debug, PartialEq, 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>, -} - -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/src/models/team_search_results.rs b/src/models/team_search_results.rs deleted file mode 100644 index 4ee7b4d..0000000 --- a/src/models/team_search_results.rs +++ /dev/null @@ -1,29 +0,0 @@ -/* - * Forgejo API - * - * This documentation describes the Forgejo API. - * - * The version of the OpenAPI document: 14.0.2-2-84240ce3a2+gitea-1.22.0 - * - * Generated by: https://openapi-generator.tech - */ - -use crate::models; -use serde::{Deserialize, Serialize}; - -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct TeamSearchResults { - #[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 TeamSearchResults { - pub fn new() -> TeamSearchResults { - TeamSearchResults { - data: None, - ok: None, - } - } -} diff --git a/src/models/timeline_comment.rs b/src/models/timeline_comment.rs deleted file mode 100644 index 6d24715..0000000 --- a/src/models/timeline_comment.rs +++ /dev/null @@ -1,114 +0,0 @@ -/* - * Forgejo API - * - * This documentation describes the Forgejo API. - * - * The version of the OpenAPI document: 14.0.2-2-84240ce3a2+gitea-1.22.0 - * - * Generated by: https://openapi-generator.tech - */ - -use crate::models; -use serde::{Deserialize, Serialize}; - -/// TimelineComment : TimelineComment represents a timeline comment (comment of any type) on a commit or issue -#[derive(Clone, Default, Debug, PartialEq, 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/src/models/topic_name.rs b/src/models/topic_name.rs deleted file mode 100644 index 14484c5..0000000 --- a/src/models/topic_name.rs +++ /dev/null @@ -1,26 +0,0 @@ -/* - * Forgejo API - * - * This documentation describes the Forgejo API. - * - * The version of the OpenAPI document: 14.0.2-2-84240ce3a2+gitea-1.22.0 - * - * Generated by: https://openapi-generator.tech - */ - -use crate::models; -use serde::{Deserialize, Serialize}; - -/// TopicName : TopicName a list of repo topic names -#[derive(Clone, Default, Debug, PartialEq, 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/src/models/topic_response.rs b/src/models/topic_response.rs deleted file mode 100644 index 507bd3b..0000000 --- a/src/models/topic_response.rs +++ /dev/null @@ -1,40 +0,0 @@ -/* - * Forgejo API - * - * This documentation describes the Forgejo API. - * - * The version of the OpenAPI document: 14.0.2-2-84240ce3a2+gitea-1.22.0 - * - * Generated by: https://openapi-generator.tech - */ - -use crate::models; -use serde::{Deserialize, Serialize}; - -/// TopicResponse : TopicResponse for returning topics -#[derive(Clone, Default, Debug, PartialEq, 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/src/models/topic_search_results.rs b/src/models/topic_search_results.rs deleted file mode 100644 index 95b7db0..0000000 --- a/src/models/topic_search_results.rs +++ /dev/null @@ -1,24 +0,0 @@ -/* - * Forgejo API - * - * This documentation describes the Forgejo API. - * - * The version of the OpenAPI document: 14.0.2-2-84240ce3a2+gitea-1.22.0 - * - * Generated by: https://openapi-generator.tech - */ - -use crate::models; -use serde::{Deserialize, Serialize}; - -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct TopicSearchResults { - #[serde(rename = "topics", skip_serializing_if = "Option::is_none")] - pub topics: Option>, -} - -impl TopicSearchResults { - pub fn new() -> TopicSearchResults { - TopicSearchResults { topics: None } - } -} diff --git a/src/models/tracked_time.rs b/src/models/tracked_time.rs deleted file mode 100644 index 4ad9b49..0000000 --- a/src/models/tracked_time.rs +++ /dev/null @@ -1,49 +0,0 @@ -/* - * Forgejo API - * - * This documentation describes the Forgejo API. - * - * The version of the OpenAPI document: 14.0.2-2-84240ce3a2+gitea-1.22.0 - * - * Generated by: https://openapi-generator.tech - */ - -use crate::models; -use serde::{Deserialize, Serialize}; - -/// TrackedTime : TrackedTime worked time for an issue / pr -#[derive(Clone, Default, Debug, PartialEq, 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/src/models/transfer_repo_option.rs b/src/models/transfer_repo_option.rs deleted file mode 100644 index 2e02fc2..0000000 --- a/src/models/transfer_repo_option.rs +++ /dev/null @@ -1,32 +0,0 @@ -/* - * Forgejo API - * - * This documentation describes the Forgejo API. - * - * The version of the OpenAPI document: 14.0.2-2-84240ce3a2+gitea-1.22.0 - * - * Generated by: https://openapi-generator.tech - */ - -use crate::models; -use serde::{Deserialize, Serialize}; - -/// TransferRepoOption : TransferRepoOption options when transfer a repository's ownership -#[derive(Clone, Default, Debug, PartialEq, 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/src/models/update_branch_repo_option.rs b/src/models/update_branch_repo_option.rs deleted file mode 100644 index 5e0edb7..0000000 --- a/src/models/update_branch_repo_option.rs +++ /dev/null @@ -1,27 +0,0 @@ -/* - * Forgejo API - * - * This documentation describes the Forgejo API. - * - * The version of the OpenAPI document: 14.0.2-2-84240ce3a2+gitea-1.22.0 - * - * Generated by: https://openapi-generator.tech - */ - -use crate::models; -use serde::{Deserialize, Serialize}; - -/// UpdateBranchRepoOption : UpdateBranchRepoOption options when updating a branch in a repository -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct UpdateBranchRepoOption { - /// New branch name - #[serde(rename = "name")] - pub name: String, -} - -impl UpdateBranchRepoOption { - /// UpdateBranchRepoOption options when updating a branch in a repository - pub fn new(name: String) -> UpdateBranchRepoOption { - UpdateBranchRepoOption { name } - } -} diff --git a/src/models/update_file_options.rs b/src/models/update_file_options.rs deleted file mode 100644 index dc24919..0000000 --- a/src/models/update_file_options.rs +++ /dev/null @@ -1,62 +0,0 @@ -/* - * Forgejo API - * - * This documentation describes the Forgejo API. - * - * The version of the OpenAPI document: 14.0.2-2-84240ce3a2+gitea-1.22.0 - * - * Generated by: https://openapi-generator.tech - */ - -use crate::models; -use serde::{Deserialize, Serialize}; - -/// 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, Default, Debug, PartialEq, 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/src/models/update_repo_avatar_option.rs b/src/models/update_repo_avatar_option.rs deleted file mode 100644 index 77218dc..0000000 --- a/src/models/update_repo_avatar_option.rs +++ /dev/null @@ -1,27 +0,0 @@ -/* - * Forgejo API - * - * This documentation describes the Forgejo API. - * - * The version of the OpenAPI document: 14.0.2-2-84240ce3a2+gitea-1.22.0 - * - * Generated by: https://openapi-generator.tech - */ - -use crate::models; -use serde::{Deserialize, Serialize}; - -/// UpdateRepoAvatarOption : UpdateRepoAvatarUserOption options when updating the repo avatar -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct UpdateRepoAvatarOption { - /// image must be base64 encoded - #[serde(rename = "image", skip_serializing_if = "Option::is_none")] - pub image: Option, -} - -impl UpdateRepoAvatarOption { - /// UpdateRepoAvatarUserOption options when updating the repo avatar - pub fn new() -> UpdateRepoAvatarOption { - UpdateRepoAvatarOption { image: None } - } -} diff --git a/src/models/update_user_avatar_option.rs b/src/models/update_user_avatar_option.rs deleted file mode 100644 index 4730bc4..0000000 --- a/src/models/update_user_avatar_option.rs +++ /dev/null @@ -1,27 +0,0 @@ -/* - * Forgejo API - * - * This documentation describes the Forgejo API. - * - * The version of the OpenAPI document: 14.0.2-2-84240ce3a2+gitea-1.22.0 - * - * Generated by: https://openapi-generator.tech - */ - -use crate::models; -use serde::{Deserialize, Serialize}; - -/// UpdateUserAvatarOption : UpdateUserAvatarUserOption options when updating the user avatar -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct UpdateUserAvatarOption { - /// image must be base64 encoded - #[serde(rename = "image", skip_serializing_if = "Option::is_none")] - pub image: Option, -} - -impl UpdateUserAvatarOption { - /// UpdateUserAvatarUserOption options when updating the user avatar - pub fn new() -> UpdateUserAvatarOption { - UpdateUserAvatarOption { image: None } - } -} diff --git a/src/models/update_variable_option.rs b/src/models/update_variable_option.rs deleted file mode 100644 index 2401f8b..0000000 --- a/src/models/update_variable_option.rs +++ /dev/null @@ -1,30 +0,0 @@ -/* - * Forgejo API - * - * This documentation describes the Forgejo API. - * - * The version of the OpenAPI document: 14.0.2-2-84240ce3a2+gitea-1.22.0 - * - * Generated by: https://openapi-generator.tech - */ - -use crate::models; -use serde::{Deserialize, Serialize}; - -/// UpdateVariableOption : UpdateVariableOption the option when updating variable -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct UpdateVariableOption { - /// New name for the variable. If the field is empty, the variable name won't be updated. - #[serde(rename = "name", skip_serializing_if = "Option::is_none")] - pub name: Option, - /// Value of the variable to update - #[serde(rename = "value")] - pub value: String, -} - -impl UpdateVariableOption { - /// UpdateVariableOption the option when updating variable - pub fn new(value: String) -> UpdateVariableOption { - UpdateVariableOption { name: None, value } - } -} diff --git a/src/models/user.rs b/src/models/user.rs deleted file mode 100644 index 8d22e72..0000000 --- a/src/models/user.rs +++ /dev/null @@ -1,115 +0,0 @@ -/* - * Forgejo API - * - * This documentation describes the Forgejo API. - * - * The version of the OpenAPI document: 14.0.2-2-84240ce3a2+gitea-1.22.0 - * - * Generated by: https://openapi-generator.tech - */ - -use crate::models; -use serde::{Deserialize, Serialize}; - -/// User : User represents a user -#[derive(Clone, Default, Debug, PartialEq, 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, - /// URL to the user's profile page - #[serde(rename = "html_url", skip_serializing_if = "Option::is_none")] - pub html_url: 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, - /// the user's authentication sign-in name. - #[serde(rename = "login_name", skip_serializing_if = "Option::is_none")] - pub login_name: Option, - /// Is user login prohibited - #[serde(rename = "prohibit_login", skip_serializing_if = "Option::is_none")] - pub prohibit_login: Option, - /// the user's pronouns - #[serde(rename = "pronouns", skip_serializing_if = "Option::is_none")] - pub pronouns: Option, - /// Is user restricted - #[serde(rename = "restricted", skip_serializing_if = "Option::is_none")] - pub restricted: Option, - /// The ID of the user's Authentication Source - #[serde(rename = "source_id", skip_serializing_if = "Option::is_none")] - pub source_id: 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, - html_url: None, - id: None, - is_admin: None, - language: None, - last_login: None, - location: None, - login: None, - login_name: None, - prohibit_login: None, - pronouns: None, - restricted: None, - source_id: None, - starred_repos_count: None, - visibility: None, - website: None, - } - } -} diff --git a/src/models/user_heatmap_data.rs b/src/models/user_heatmap_data.rs deleted file mode 100644 index 0c525e4..0000000 --- a/src/models/user_heatmap_data.rs +++ /dev/null @@ -1,32 +0,0 @@ -/* - * Forgejo API - * - * This documentation describes the Forgejo API. - * - * The version of the OpenAPI document: 14.0.2-2-84240ce3a2+gitea-1.22.0 - * - * Generated by: https://openapi-generator.tech - */ - -use crate::models; -use serde::{Deserialize, Serialize}; - -/// UserHeatmapData : UserHeatmapData represents the data needed to create a heatmap -#[derive(Clone, Default, Debug, PartialEq, 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/src/models/user_search_results.rs b/src/models/user_search_results.rs deleted file mode 100644 index d0c9e10..0000000 --- a/src/models/user_search_results.rs +++ /dev/null @@ -1,29 +0,0 @@ -/* - * Forgejo API - * - * This documentation describes the Forgejo API. - * - * The version of the OpenAPI document: 14.0.2-2-84240ce3a2+gitea-1.22.0 - * - * Generated by: https://openapi-generator.tech - */ - -use crate::models; -use serde::{Deserialize, Serialize}; - -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct UserSearchResults { - #[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 UserSearchResults { - pub fn new() -> UserSearchResults { - UserSearchResults { - data: None, - ok: None, - } - } -} diff --git a/src/models/user_settings.rs b/src/models/user_settings.rs deleted file mode 100644 index 4cedcf8..0000000 --- a/src/models/user_settings.rs +++ /dev/null @@ -1,65 +0,0 @@ -/* - * Forgejo API - * - * This documentation describes the Forgejo API. - * - * The version of the OpenAPI document: 14.0.2-2-84240ce3a2+gitea-1.22.0 - * - * Generated by: https://openapi-generator.tech - */ - -use crate::models; -use serde::{Deserialize, Serialize}; - -/// UserSettings : UserSettings represents user settings -#[derive(Clone, Default, Debug, PartialEq, 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 = "enable_repo_unit_hints", - skip_serializing_if = "Option::is_none" - )] - pub enable_repo_unit_hints: 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 = "hide_pronouns", skip_serializing_if = "Option::is_none")] - pub hide_pronouns: 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 = "pronouns", skip_serializing_if = "Option::is_none")] - pub pronouns: 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, - enable_repo_unit_hints: None, - full_name: None, - hide_activity: None, - hide_email: None, - hide_pronouns: None, - language: None, - location: None, - pronouns: None, - theme: None, - website: None, - } - } -} diff --git a/src/models/user_settings_options.rs b/src/models/user_settings_options.rs deleted file mode 100644 index 660001c..0000000 --- a/src/models/user_settings_options.rs +++ /dev/null @@ -1,65 +0,0 @@ -/* - * Forgejo API - * - * This documentation describes the Forgejo API. - * - * The version of the OpenAPI document: 14.0.2-2-84240ce3a2+gitea-1.22.0 - * - * Generated by: https://openapi-generator.tech - */ - -use crate::models; -use serde::{Deserialize, Serialize}; - -/// UserSettingsOptions : UserSettingsOptions represents options to change user settings -#[derive(Clone, Default, Debug, PartialEq, 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 = "enable_repo_unit_hints", - skip_serializing_if = "Option::is_none" - )] - pub enable_repo_unit_hints: 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 = "hide_pronouns", skip_serializing_if = "Option::is_none")] - pub hide_pronouns: 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 = "pronouns", skip_serializing_if = "Option::is_none")] - pub pronouns: 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, - enable_repo_unit_hints: None, - full_name: None, - hide_activity: None, - hide_email: None, - hide_pronouns: None, - language: None, - location: None, - pronouns: None, - theme: None, - website: None, - } - } -} diff --git a/src/models/verify_gpg_key_option.rs b/src/models/verify_gpg_key_option.rs deleted file mode 100644 index 510f192..0000000 --- a/src/models/verify_gpg_key_option.rs +++ /dev/null @@ -1,32 +0,0 @@ -/* - * Forgejo API - * - * This documentation describes the Forgejo API. - * - * The version of the OpenAPI document: 14.0.2-2-84240ce3a2+gitea-1.22.0 - * - * Generated by: https://openapi-generator.tech - */ - -use crate::models; -use serde::{Deserialize, Serialize}; - -/// VerifyGpgKeyOption : VerifyGPGKeyOption options verifies user GPG key -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct VerifyGpgKeyOption { - #[serde(rename = "armored_signature", skip_serializing_if = "Option::is_none")] - pub armored_signature: Option, - /// An Signature for a GPG key token - #[serde(rename = "key_id")] - pub key_id: String, -} - -impl VerifyGpgKeyOption { - /// VerifyGPGKeyOption options verifies user GPG key - pub fn new(key_id: String) -> VerifyGpgKeyOption { - VerifyGpgKeyOption { - armored_signature: None, - key_id, - } - } -} diff --git a/src/models/watch_info.rs b/src/models/watch_info.rs deleted file mode 100644 index 5293b7b..0000000 --- a/src/models/watch_info.rs +++ /dev/null @@ -1,43 +0,0 @@ -/* - * Forgejo API - * - * This documentation describes the Forgejo API. - * - * The version of the OpenAPI document: 14.0.2-2-84240ce3a2+gitea-1.22.0 - * - * Generated by: https://openapi-generator.tech - */ - -use crate::models; -use serde::{Deserialize, Serialize}; - -/// WatchInfo : WatchInfo represents an API watch status of one repository -#[derive(Clone, Default, Debug, PartialEq, 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/src/models/wiki_commit.rs b/src/models/wiki_commit.rs deleted file mode 100644 index b723012..0000000 --- a/src/models/wiki_commit.rs +++ /dev/null @@ -1,37 +0,0 @@ -/* - * Forgejo API - * - * This documentation describes the Forgejo API. - * - * The version of the OpenAPI document: 14.0.2-2-84240ce3a2+gitea-1.22.0 - * - * Generated by: https://openapi-generator.tech - */ - -use crate::models; -use serde::{Deserialize, Serialize}; - -/// WikiCommit : WikiCommit page commit/revision -#[derive(Clone, Default, Debug, PartialEq, 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/src/models/wiki_commit_list.rs b/src/models/wiki_commit_list.rs deleted file mode 100644 index d7cca73..0000000 --- a/src/models/wiki_commit_list.rs +++ /dev/null @@ -1,31 +0,0 @@ -/* - * Forgejo API - * - * This documentation describes the Forgejo API. - * - * The version of the OpenAPI document: 14.0.2-2-84240ce3a2+gitea-1.22.0 - * - * Generated by: https://openapi-generator.tech - */ - -use crate::models; -use serde::{Deserialize, Serialize}; - -/// WikiCommitList : WikiCommitList commit/revision list -#[derive(Clone, Default, Debug, PartialEq, 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/src/models/wiki_page.rs b/src/models/wiki_page.rs deleted file mode 100644 index e3f617f..0000000 --- a/src/models/wiki_page.rs +++ /dev/null @@ -1,50 +0,0 @@ -/* - * Forgejo API - * - * This documentation describes the Forgejo API. - * - * The version of the OpenAPI document: 14.0.2-2-84240ce3a2+gitea-1.22.0 - * - * Generated by: https://openapi-generator.tech - */ - -use crate::models; -use serde::{Deserialize, Serialize}; - -/// WikiPage : WikiPage a wiki page -#[derive(Clone, Default, Debug, PartialEq, 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/src/models/wiki_page_meta_data.rs b/src/models/wiki_page_meta_data.rs deleted file mode 100644 index 6f68879..0000000 --- a/src/models/wiki_page_meta_data.rs +++ /dev/null @@ -1,37 +0,0 @@ -/* - * Forgejo API - * - * This documentation describes the Forgejo API. - * - * The version of the OpenAPI document: 14.0.2-2-84240ce3a2+gitea-1.22.0 - * - * Generated by: https://openapi-generator.tech - */ - -use crate::models; -use serde::{Deserialize, Serialize}; - -/// WikiPageMetaData : WikiPageMetaData wiki page meta information -#[derive(Clone, Default, Debug, PartialEq, 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, - } - } -}