diff --git a/.cargo_vcs_info.json b/.cargo_vcs_info.json index 8bfb4d2..eac8dbd 100644 --- a/.cargo_vcs_info.json +++ b/.cargo_vcs_info.json @@ -1,6 +1,6 @@ { "git": { - "sha1": "041a56ecea92e78400f8dea7dad2b7f9c175c22a" + "sha1": "6f990c84d4cdffb994f1008cf5dba94c9b3b32ca" }, "path_in_vcs": "" } \ No newline at end of file diff --git a/Cargo.lock b/Cargo.lock new file mode 100644 index 0000000..10eb9b4 --- /dev/null +++ b/Cargo.lock @@ -0,0 +1,1689 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +version = 4 + +[[package]] +name = "addr2line" +version = "0.22.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6e4503c46a5c0c7844e948c9a4d6acd9f50cccb4de1c48eb9e291ea17470c678" +dependencies = [ + "gimli", +] + +[[package]] +name = "adler" +version = "1.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f26201604c87b1e01bd3d98f8d5d9a8fcbb815e8cedb41ffccbeb4bf593a35fe" + +[[package]] +name = "atomic-waker" +version = "1.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1505bd5d3d116872e7271a6d4e16d81d0c8570876c8de68093a09ac269d8aac0" + +[[package]] +name = "autocfg" +version = "1.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0c4b4d0bd25bd0b74681c0ad21497610ce1b7c91b1022cd21c80c6fbdd9476b0" + +[[package]] +name = "backtrace" +version = "0.3.73" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5cc23269a4f8976d0a4d2e7109211a419fe30e8d88d677cd60b6bc79c5732e0a" +dependencies = [ + "addr2line", + "cc", + "cfg-if", + "libc", + "miniz_oxide", + "object", + "rustc-demangle", +] + +[[package]] +name = "base64" +version = "0.22.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "72b3254f16251a8381aa12e40e3c4d2f0199f8c6508fbecb9d91f575e0fbb8c6" + +[[package]] +name = "base64ct" +version = "1.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8c3c1a368f70d6cf7302d78f8f7093da241fb8e8807c05cc9e51a125895a6d5b" + +[[package]] +name = "bitflags" +version = "2.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b048fb63fd8b5923fc5aa7b340d8e156aec7ec02f0c78fa8a6ddc2613f6f71de" + +[[package]] +name = "bumpalo" +version = "3.16.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "79296716171880943b8470b5f8d03aa55eb2e645a4874bdbb28adb49162e012c" + +[[package]] +name = "bytes" +version = "1.6.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a12916984aab3fa6e39d655a33e09c0071eb36d6ab3aea5c2d78551f1df6d952" + +[[package]] +name = "cc" +version = "1.1.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "26a5c3fd7bfa1ce3897a3a3501d362b2d87b7f2583ebcb4a949ec25911025cbc" + +[[package]] +name = "cfg-if" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" + +[[package]] +name = "cookie" +version = "0.18.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4ddef33a339a91ea89fb53151bd0a4689cfce27055c291dfa69945475d22c747" +dependencies = [ + "percent-encoding", + "time", + "version_check", +] + +[[package]] +name = "cookie_store" +version = "0.21.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2eac901828f88a5241ee0600950ab981148a18f2f756900ffba1b125ca6a3ef9" +dependencies = [ + "cookie", + "document-features", + "idna", + "log", + "publicsuffix", + "serde", + "serde_derive", + "serde_json", + "time", + "url", +] + +[[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.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "06ea2b9bc92be3c2baa9334a323ebca2d6f074ff852cd1d7b11064035cd3868f" + +[[package]] +name = "deranged" +version = "0.3.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b42b6fa04a440b495c8b04d0e71b707c585f83cb9cb28cf8cd0d976c315e31b4" +dependencies = [ + "powerfmt", + "serde", +] + +[[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 = "document-features" +version = "0.2.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cb6969eaabd2421f8a2775cfd2471a2b634372b4a25d41e3bd647b79912850a0" +dependencies = [ + "litrs", +] + +[[package]] +name = "encoding_rs" +version = "0.8.34" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b45de904aa0b010bce2ab45264d0631681847fa7b6f2eaa7dab7619943bc4f59" +dependencies = [ + "cfg-if", +] + +[[package]] +name = "equivalent" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5443807d6dff69373d433ab9ef5378ad8df50ca6298caf15de6e52e24aaf54d5" + +[[package]] +name = "errno" +version = "0.3.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "534c5cf6194dfab3db3242765c03bbe257cf92f22b38f6bc0c58d59108a820ba" +dependencies = [ + "libc", + "windows-sys", +] + +[[package]] +name = "eyre" +version = "0.6.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7cd915d99f24784cdc19fd37ef22b97e3ff0ae756c7e492e9fbfe897d61e2aec" +dependencies = [ + "indenter", + "once_cell", +] + +[[package]] +name = "fastrand" +version = "2.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9fc0510504f03c51ada170672ac806f1f105a88aa97a5281117e1ddc3368e51a" + +[[package]] +name = "fnv" +version = "1.0.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1" + +[[package]] +name = "foreign-types" +version = "0.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f6f339eb8adc052cd2ca78910fda869aefa38d22d5cb648e6485e4d3fc06f3b1" +dependencies = [ + "foreign-types-shared", +] + +[[package]] +name = "foreign-types-shared" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "00b0228411908ca8685dba7fc2cdd70ec9990a6e753e89b6ac91a84c40fbaf4b" + +[[package]] +name = "forgejo-api" +version = "0.7.0" +dependencies = [ + "base64ct", + "bytes", + "eyre", + "reqwest", + "serde", + "serde_json", + "soft_assert", + "thiserror", + "time", + "tokio", + "url", + "zeroize", +] + +[[package]] +name = "form_urlencoded" +version = "1.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e13624c2627564efccf4934284bdd98cbaa14e79b0b5a141218e507b3a823456" +dependencies = [ + "percent-encoding", +] + +[[package]] +name = "futures-channel" +version = "0.3.30" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "eac8f7d7865dcb88bd4373ab671c8cf4508703796caa2b1985a9ca867b3fcb78" +dependencies = [ + "futures-core", +] + +[[package]] +name = "futures-core" +version = "0.3.30" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dfc6580bb841c5a68e9ef15c77ccc837b40a7504914d52e47b8b0e9bbda25a1d" + +[[package]] +name = "futures-sink" +version = "0.3.30" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9fb8e00e87438d937621c1c6269e53f536c14d3fbd6a042bb24879e57d474fb5" + +[[package]] +name = "futures-task" +version = "0.3.30" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "38d84fa142264698cdce1a9f9172cf383a0c82de1bddcf3092901442c4097004" + +[[package]] +name = "futures-util" +version = "0.3.30" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3d6401deb83407ab3da39eba7e33987a73c3df0c82b4bb5813ee871c19c41d48" +dependencies = [ + "futures-core", + "futures-task", + "pin-project-lite", + "pin-utils", +] + +[[package]] +name = "getrandom" +version = "0.2.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c4567c8db10ae91089c99af84c68c38da3ec2f087c3f82960bcdbf3656b6f4d7" +dependencies = [ + "cfg-if", + "libc", + "wasi", +] + +[[package]] +name = "gimli" +version = "0.29.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "40ecd4077b5ae9fd2e9e169b102c6c330d0605168eb0e8bf79952b256dbefffd" + +[[package]] +name = "h2" +version = "0.4.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ccae279728d634d083c00f6099cb58f01cc99c145b84b8be2f6c74618d79922e" +dependencies = [ + "atomic-waker", + "bytes", + "fnv", + "futures-core", + "futures-sink", + "http", + "indexmap", + "slab", + "tokio", + "tokio-util", + "tracing", +] + +[[package]] +name = "hashbrown" +version = "0.14.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e5274423e17b7c9fc20b6e7e208532f9b19825d82dfd615708b70edd83df41f1" + +[[package]] +name = "hermit-abi" +version = "0.3.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d231dfb89cfffdbc30e7fc41579ed6066ad03abda9e567ccafae602b97ec5024" + +[[package]] +name = "http" +version = "1.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f16ca2af56261c99fba8bac40a10251ce8188205a4c448fbb745a2e4daa76fea" +dependencies = [ + "bytes", + "fnv", + "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.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "793429d76616a256bcb62c2a2ec2bed781c8307e797e2598c50010f2bee2544f" +dependencies = [ + "bytes", + "futures-util", + "http", + "http-body", + "pin-project-lite", +] + +[[package]] +name = "httparse" +version = "1.9.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0fcc0b4a115bf80b728eb8ea024ad5bd707b615bfed49e0665b6e0f86fd082d9" + +[[package]] +name = "hyper" +version = "1.5.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "256fb8d4bd6413123cc9d91832d78325c48ff41677595be797d90f42969beae0" +dependencies = [ + "bytes", + "futures-channel", + "futures-util", + "h2", + "http", + "http-body", + "httparse", + "itoa", + "pin-project-lite", + "smallvec", + "tokio", + "want", +] + +[[package]] +name = "hyper-rustls" +version = "0.27.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2d191583f3da1305256f22463b9bb0471acad48a4e534a5218b9963e9c1f59b2" +dependencies = [ + "futures-util", + "http", + "hyper", + "hyper-util", + "rustls", + "rustls-pki-types", + "tokio", + "tokio-rustls", + "tower-service", +] + +[[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.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cde7055719c54e36e95e8719f95883f22072a48ede39db7fc17a4e1d5281e9b9" +dependencies = [ + "bytes", + "futures-channel", + "futures-util", + "http", + "http-body", + "hyper", + "pin-project-lite", + "socket2", + "tokio", + "tower", + "tower-service", + "tracing", +] + +[[package]] +name = "icu_collections" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "db2fa452206ebee18c4b5c2274dbf1de17008e874b4dc4f0aea9d01ca79e4526" +dependencies = [ + "displaydoc", + "yoke", + "zerofrom", + "zerovec", +] + +[[package]] +name = "icu_locid" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "13acbb8371917fc971be86fc8057c41a64b521c184808a698c02acc242dbf637" +dependencies = [ + "displaydoc", + "litemap", + "tinystr", + "writeable", + "zerovec", +] + +[[package]] +name = "icu_locid_transform" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "01d11ac35de8e40fdeda00d9e1e9d92525f3f9d887cdd7aa81d727596788b54e" +dependencies = [ + "displaydoc", + "icu_locid", + "icu_locid_transform_data", + "icu_provider", + "tinystr", + "zerovec", +] + +[[package]] +name = "icu_locid_transform_data" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fdc8ff3388f852bede6b579ad4e978ab004f139284d7b28715f773507b946f6e" + +[[package]] +name = "icu_normalizer" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "19ce3e0da2ec68599d193c93d088142efd7f9c5d6fc9b803774855747dc6a84f" +dependencies = [ + "displaydoc", + "icu_collections", + "icu_normalizer_data", + "icu_properties", + "icu_provider", + "smallvec", + "utf16_iter", + "utf8_iter", + "write16", + "zerovec", +] + +[[package]] +name = "icu_normalizer_data" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f8cafbf7aa791e9b22bec55a167906f9e1215fd475cd22adfcf660e03e989516" + +[[package]] +name = "icu_properties" +version = "1.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "93d6020766cfc6302c15dbbc9c8778c37e62c14427cb7f6e601d849e092aeef5" +dependencies = [ + "displaydoc", + "icu_collections", + "icu_locid_transform", + "icu_properties_data", + "icu_provider", + "tinystr", + "zerovec", +] + +[[package]] +name = "icu_properties_data" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "67a8effbc3dd3e4ba1afa8ad918d5684b8868b3b26500753effea8d2eed19569" + +[[package]] +name = "icu_provider" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6ed421c8a8ef78d3e2dbc98a973be2f3770cb42b606e3ab18d6237c4dfde68d9" +dependencies = [ + "displaydoc", + "icu_locid", + "icu_provider_macros", + "stable_deref_trait", + "tinystr", + "writeable", + "yoke", + "zerofrom", + "zerovec", +] + +[[package]] +name = "icu_provider_macros" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1ec89e9337638ecdc08744df490b221a7399bf8d164eb52a665454e60e075ad6" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "idna" +version = "1.0.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "686f825264d630750a544639377bae737628043f20d38bbc029e8f29ea968a7e" +dependencies = [ + "idna_adapter", + "smallvec", + "utf8_iter", +] + +[[package]] +name = "idna_adapter" +version = "1.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "daca1df1c957320b2cf139ac61e7bd64fed304c5040df000a745aa1de3b4ef71" +dependencies = [ + "icu_normalizer", + "icu_properties", +] + +[[package]] +name = "indenter" +version = "0.3.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ce23b50ad8242c51a442f3ff322d56b02f08852c77e4c0b4d3fd684abc89c683" + +[[package]] +name = "indexmap" +version = "2.2.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "168fb715dda47215e360912c096649d23d58bf392ac62f73919e831745e40f26" +dependencies = [ + "equivalent", + "hashbrown", +] + +[[package]] +name = "ipnet" +version = "2.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8f518f335dce6725a761382244631d86cf0ccb2863413590b31338feb467f9c3" + +[[package]] +name = "itoa" +version = "1.0.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "49f1f14873335454500d59611f1cf4a4b0f786f9ac11f4312a78e4cf2566695b" + +[[package]] +name = "js-sys" +version = "0.3.69" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "29c15563dc2726973df627357ce0c9ddddbea194836909d655df6a75d2cf296d" +dependencies = [ + "wasm-bindgen", +] + +[[package]] +name = "libc" +version = "0.2.155" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "97b3888a4aecf77e811145cadf6eef5901f4782c53886191b2f693f24761847c" + +[[package]] +name = "linux-raw-sys" +version = "0.4.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "78b3ae25bc7c8c38cec158d1f2757ee79e9b3740fbc7ccf0e59e4b08d793fa89" + +[[package]] +name = "litemap" +version = "0.7.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4ee93343901ab17bd981295f2cf0026d4ad018c7c31ba84549a4ddbb47a45104" + +[[package]] +name = "litrs" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b4ce301924b7887e9d637144fdade93f9dfff9b60981d4ac161db09720d39aa5" + +[[package]] +name = "log" +version = "0.4.22" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a7a70ba024b9dc04c27ea2f0c0548feb474ec5c54bba33a7f72f873a39d07b24" + +[[package]] +name = "memchr" +version = "2.7.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "78ca9ab1a0babb1e7d5695e3530886289c18cf2f87ec19a575a0abdce112e3a3" + +[[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 = "miniz_oxide" +version = "0.7.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b8a240ddb74feaf34a79a7add65a741f3167852fba007066dcac1ca548d89c08" +dependencies = [ + "adler", +] + +[[package]] +name = "mio" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4569e456d394deccd22ce1c1913e6ea0e54519f577285001215d33557431afe4" +dependencies = [ + "hermit-abi", + "libc", + "wasi", + "windows-sys", +] + +[[package]] +name = "native-tls" +version = "0.2.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a8614eb2c83d59d1c8cc974dd3f920198647674a0a035e1af1fa58707e317466" +dependencies = [ + "libc", + "log", + "openssl", + "openssl-probe", + "openssl-sys", + "schannel", + "security-framework", + "security-framework-sys", + "tempfile", +] + +[[package]] +name = "num-conv" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "51d515d32fb182ee37cda2ccdcb92950d6a3c2893aa280e540671c2cd0f3b1d9" + +[[package]] +name = "object" +version = "0.36.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3f203fa8daa7bb185f760ae12bd8e097f63d17041dcdcaf675ac54cdf863170e" +dependencies = [ + "memchr", +] + +[[package]] +name = "once_cell" +version = "1.19.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3fdb12b2476b595f9358c5161aa467c2438859caa136dec86c26fdd2efe17b92" + +[[package]] +name = "openssl" +version = "0.10.66" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9529f4786b70a3e8c61e11179af17ab6188ad8d0ded78c5529441ed39d4bd9c1" +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.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ff011a302c396a5197692431fc1948019154afc178baf7d8e37367442a4601cf" + +[[package]] +name = "openssl-sys" +version = "0.9.103" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7f9e8deee91df40a943c71b917e5874b951d32a802526c85721ce3b776c929d6" +dependencies = [ + "cc", + "libc", + "pkg-config", + "vcpkg", +] + +[[package]] +name = "percent-encoding" +version = "2.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e3148f5046208a5d56bcfc03053e3ca6334e51da8dfb19b6cdc8b306fae3283e" + +[[package]] +name = "pin-project" +version = "1.1.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "be57f64e946e500c8ee36ef6331845d40a93055567ec57e8fae13efd33759b95" +dependencies = [ + "pin-project-internal", +] + +[[package]] +name = "pin-project-internal" +version = "1.1.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3c0f5fad0874fc7abcd4d750e76917eaebbecaa2c20bde22e1dbeeba8beb758c" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "pin-project-lite" +version = "0.2.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bda66fc9667c18cb2758a2ac84d1167245054bcf85d5d1aaa6923f45801bdd02" + +[[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.30" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d231b230927b5e4ad203db57bbcbee2802f6bce620b1e4a9024a07d94e2907ec" + +[[package]] +name = "powerfmt" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "439ee305def115ba05938db6eb1644ff94165c5ab5e9420d1c1bcedbba909391" + +[[package]] +name = "proc-macro2" +version = "1.0.86" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5e719e8df665df0d1c8fbfd238015744736151d4445ec0836b8e628aae103b77" +dependencies = [ + "unicode-ident", +] + +[[package]] +name = "psl-types" +version = "2.0.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "33cb294fe86a74cbcf50d4445b37da762029549ebeea341421c7c70370f86cac" + +[[package]] +name = "publicsuffix" +version = "2.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6f42ea446cab60335f76979ec15e12619a2165b5ae2c12166bef27d283a9fadf" +dependencies = [ + "idna", + "psl-types", +] + +[[package]] +name = "quote" +version = "1.0.36" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0fa76aaf39101c457836aec0ce2316dbdc3ab723cdda1c6bd4e6ad4208acaca7" +dependencies = [ + "proc-macro2", +] + +[[package]] +name = "reqwest" +version = "0.12.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a77c62af46e79de0a562e1a9849205ffcb7fc1238876e9bd743357570e04046f" +dependencies = [ + "base64", + "bytes", + "cookie", + "cookie_store", + "encoding_rs", + "futures-core", + "futures-util", + "h2", + "http", + "http-body", + "http-body-util", + "hyper", + "hyper-rustls", + "hyper-tls", + "hyper-util", + "ipnet", + "js-sys", + "log", + "mime", + "mime_guess", + "native-tls", + "once_cell", + "percent-encoding", + "pin-project-lite", + "rustls-pemfile", + "serde", + "serde_json", + "serde_urlencoded", + "sync_wrapper", + "system-configuration", + "tokio", + "tokio-native-tls", + "tower-service", + "url", + "wasm-bindgen", + "wasm-bindgen-futures", + "web-sys", + "windows-registry", +] + +[[package]] +name = "ring" +version = "0.17.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c17fa4cb658e3583423e915b9f3acc01cceaee1860e33d59ebae66adc3a2dc0d" +dependencies = [ + "cc", + "cfg-if", + "getrandom", + "libc", + "spin", + "untrusted", + "windows-sys", +] + +[[package]] +name = "rustc-demangle" +version = "0.1.24" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "719b953e2095829ee67db738b3bfa9fa368c94900df327b3f07fe6e794d2fe1f" + +[[package]] +name = "rustix" +version = "0.38.34" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "70dc5ec042f7a43c4a73241207cecc9873a06d45debb38b329f8541d85c2730f" +dependencies = [ + "bitflags", + "errno", + "libc", + "linux-raw-sys", + "windows-sys", +] + +[[package]] +name = "rustls" +version = "0.23.20" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5065c3f250cbd332cd894be57c40fa52387247659b14a2d6041d121547903b1b" +dependencies = [ + "once_cell", + "rustls-pki-types", + "rustls-webpki", + "subtle", + "zeroize", +] + +[[package]] +name = "rustls-pemfile" +version = "2.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dce314e5fee3f39953d46bb63bb8a46d40c2f8fb7cc5a3b6cab2bde9721d6e50" +dependencies = [ + "rustls-pki-types", +] + +[[package]] +name = "rustls-pki-types" +version = "1.10.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d2bf47e6ff922db3825eb750c4e2ff784c6ff8fb9e13046ef6a1d1c5401b0b37" + +[[package]] +name = "rustls-webpki" +version = "0.102.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "64ca1bc8749bd4cf37b5ce386cc146580777b4e8572c7b97baf22c83f444bee9" +dependencies = [ + "ring", + "rustls-pki-types", + "untrusted", +] + +[[package]] +name = "ryu" +version = "1.0.18" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f3cb5ba0dc43242ce17de99c180e96db90b235b8a9fdc9543c96d2209116bd9f" + +[[package]] +name = "schannel" +version = "0.1.23" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fbc91545643bcf3a0bbb6569265615222618bdf33ce4ffbbd13c4bbd4c093534" +dependencies = [ + "windows-sys", +] + +[[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.11.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "75da29fe9b9b08fe9d6b22b5b4bcbc75d8db3aa31e639aa56bb62e9d46bfceaf" +dependencies = [ + "core-foundation-sys", + "libc", +] + +[[package]] +name = "serde" +version = "1.0.204" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bc76f558e0cbb2a839d37354c575f1dc3fdc6546b5be373ba43d95f231bf7c12" +dependencies = [ + "serde_derive", +] + +[[package]] +name = "serde_derive" +version = "1.0.204" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e0cd7e117be63d3c3678776753929474f3b04a43a080c744d6b0ae2a8c28e222" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "serde_json" +version = "1.0.121" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4ab380d7d9f22ef3f21ad3e6c1ebe8e4fc7a2000ccba2e4d71fc96f15b2cb609" +dependencies = [ + "itoa", + "memchr", + "ryu", + "serde", +] + +[[package]] +name = "serde_urlencoded" +version = "0.7.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d3491c14715ca2294c4d6a88f15e84739788c1d030eed8c110436aafdaa2f3fd" +dependencies = [ + "form_urlencoded", + "itoa", + "ryu", + "serde", +] + +[[package]] +name = "slab" +version = "0.4.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8f92a496fb766b417c996b9c5e57daf2f7ad3b0bebe1ccfca4856390e3d3bb67" +dependencies = [ + "autocfg", +] + +[[package]] +name = "smallvec" +version = "1.13.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3c5e1a9a646d36c3599cd173a41282daf47c44583ad367b8e6837255952e5c67" + +[[package]] +name = "socket2" +version = "0.5.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ce305eb0b4296696835b71df73eb912e0f1ffd2556a501fcede6e0c50349191c" +dependencies = [ + "libc", + "windows-sys", +] + +[[package]] +name = "soft_assert" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b5097ec7ea7218135541ad96348f1441d0c616537dd4ed9c47205920c35d7d97" + +[[package]] +name = "spin" +version = "0.9.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6980e8d7511241f8acf4aebddbb1ff938df5eebe98691418c4468d0b72a96a67" + +[[package]] +name = "stable_deref_trait" +version = "1.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a8f112729512f8e442d81f95a8a7ddf2b7c6b8a1a6f509a95864142b30cab2d3" + +[[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.72" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dc4b9b9bf2add8093d3f2c0204471e951b2285580335de42f9d2534f3ae7a8af" +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.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c8af7666ab7b6390ab78131fb5b0fce11d6b7a6951602017c35fa82800708971" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "system-configuration" +version = "0.6.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3c879d448e9d986b661742763247d3693ed13609438cf3d006f51f5368a5ba6b" +dependencies = [ + "bitflags", + "core-foundation", + "system-configuration-sys", +] + +[[package]] +name = "system-configuration-sys" +version = "0.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8e1d1b10ced5ca923a1fcb8d03e96b8d3268065d724548c0211415ff6ac6bac4" +dependencies = [ + "core-foundation-sys", + "libc", +] + +[[package]] +name = "tempfile" +version = "3.10.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "85b77fafb263dd9d05cbeac119526425676db3784113aa9295c88498cbf8bff1" +dependencies = [ + "cfg-if", + "fastrand", + "rustix", + "windows-sys", +] + +[[package]] +name = "thiserror" +version = "1.0.63" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c0342370b38b6a11b6cc11d6a805569958d54cfa061a29969c3b5ce2ea405724" +dependencies = [ + "thiserror-impl", +] + +[[package]] +name = "thiserror-impl" +version = "1.0.63" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a4558b58466b9ad7ca0f102865eccc95938dca1a74a856f2b57b6629050da261" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "time" +version = "0.3.36" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5dfd88e563464686c916c7e46e623e520ddc6d79fa6641390f2e3fa86e83e885" +dependencies = [ + "deranged", + "itoa", + "num-conv", + "powerfmt", + "serde", + "time-core", + "time-macros", +] + +[[package]] +name = "time-core" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ef927ca75afb808a4d64dd374f00a2adf8d0fcff8e7b184af886c3c87ec4a3f3" + +[[package]] +name = "time-macros" +version = "0.2.18" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3f252a68540fde3a3877aeea552b832b40ab9a69e318efd078774a01ddee1ccf" +dependencies = [ + "num-conv", + "time-core", +] + +[[package]] +name = "tinystr" +version = "0.7.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9117f5d4db391c1cf6927e7bea3db74b9a1c1add8f7eda9ffd5364f40f57b82f" +dependencies = [ + "displaydoc", + "zerovec", +] + +[[package]] +name = "tokio" +version = "1.39.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "daa4fb1bc778bd6f04cbfc4bb2d06a7396a8f299dc33ea1900cedaa316f467b1" +dependencies = [ + "backtrace", + "bytes", + "libc", + "mio", + "pin-project-lite", + "socket2", + "tokio-macros", + "windows-sys", +] + +[[package]] +name = "tokio-macros" +version = "2.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "693d596312e88961bc67d7f1f97af8a70227d9f90c31bba5806eec004978d752" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[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.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5f6d0975eaace0cf0fcadee4e4aaa5da15b5c079146f2cffb67c113be122bf37" +dependencies = [ + "rustls", + "tokio", +] + +[[package]] +name = "tokio-util" +version = "0.7.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9cf6b47b3771c49ac75ad09a6162f53ad4b8088b76ac60e8ec1455b31a189fe1" +dependencies = [ + "bytes", + "futures-core", + "futures-sink", + "pin-project-lite", + "tokio", +] + +[[package]] +name = "tower" +version = "0.4.13" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b8fa9be0de6cf49e536ce1851f987bd21a43b771b09473c3549a6c853db37c1c" +dependencies = [ + "futures-core", + "futures-util", + "pin-project", + "pin-project-lite", + "tokio", + "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.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b6bc1c9ce2b5135ac7f93c72918fc37feb872bdc6a5533a8b85eb4b86bfdae52" + +[[package]] +name = "tracing" +version = "0.1.40" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c3523ab5a71916ccf420eebdf5521fcef02141234bbc0b8a49f2fdc4544364ef" +dependencies = [ + "pin-project-lite", + "tracing-core", +] + +[[package]] +name = "tracing-core" +version = "0.1.32" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c06d3da6113f116aaee68e4d601191614c9053067f9ab7f6edbcb161237daa54" +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.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f7d2d4dafb69621809a81864c9c1b864479e1235c0dd4e199924b9742439ed89" +dependencies = [ + "version_check", +] + +[[package]] +name = "unicode-ident" +version = "1.0.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3354b9ac3fae1ff6755cb6db53683adb661634f67557942dea4facebec0fee4b" + +[[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.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "32f8b686cadd1473f4bd0117a5d28d36b1ade384ea9b5069a1c40aefed7fda60" +dependencies = [ + "form_urlencoded", + "idna", + "percent-encoding", + "serde", +] + +[[package]] +name = "utf16_iter" +version = "1.0.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c8232dd3cdaed5356e0f716d285e4b40b932ac434100fe9b7e0e8e935b9e6246" + +[[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 = "version_check" +version = "0.9.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0b928f33d975fc6ad9f86c8f283853ad26bdd5b10b7f1542aa2fa15e2289105a" + +[[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.0+wasi-snapshot-preview1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423" + +[[package]] +name = "wasm-bindgen" +version = "0.2.92" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4be2531df63900aeb2bca0daaaddec08491ee64ceecbee5076636a3b026795a8" +dependencies = [ + "cfg-if", + "wasm-bindgen-macro", +] + +[[package]] +name = "wasm-bindgen-backend" +version = "0.2.92" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "614d787b966d3989fa7bb98a654e369c762374fd3213d212cfc0251257e747da" +dependencies = [ + "bumpalo", + "log", + "once_cell", + "proc-macro2", + "quote", + "syn", + "wasm-bindgen-shared", +] + +[[package]] +name = "wasm-bindgen-futures" +version = "0.4.42" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "76bc14366121efc8dbb487ab05bcc9d346b3b5ec0eaa76e46594cabbe51762c0" +dependencies = [ + "cfg-if", + "js-sys", + "wasm-bindgen", + "web-sys", +] + +[[package]] +name = "wasm-bindgen-macro" +version = "0.2.92" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a1f8823de937b71b9460c0c34e25f3da88250760bec0ebac694b49997550d726" +dependencies = [ + "quote", + "wasm-bindgen-macro-support", +] + +[[package]] +name = "wasm-bindgen-macro-support" +version = "0.2.92" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e94f17b526d0a461a191c78ea52bbce64071ed5c04c9ffe424dcb38f74171bb7" +dependencies = [ + "proc-macro2", + "quote", + "syn", + "wasm-bindgen-backend", + "wasm-bindgen-shared", +] + +[[package]] +name = "wasm-bindgen-shared" +version = "0.2.92" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "af190c94f2773fdb3729c55b007a722abb5384da03bc0986df4c289bf5567e96" + +[[package]] +name = "web-sys" +version = "0.3.69" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "77afa9a11836342370f4817622a2f0f418b134426d91a82dfb48f532d2ec13ef" +dependencies = [ + "js-sys", + "wasm-bindgen", +] + +[[package]] +name = "windows-registry" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e400001bb720a623c1c69032f8e3e4cf09984deec740f007dd2b03ec864804b0" +dependencies = [ + "windows-result", + "windows-strings", + "windows-targets", +] + +[[package]] +name = "windows-result" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1d1043d8214f791817bab27572aaa8af63732e11bf84aa21a45a78d6c317ae0e" +dependencies = [ + "windows-targets", +] + +[[package]] +name = "windows-strings" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4cd9b125c486025df0eabcb585e62173c6c9eddcec5d117d3b6e8c30e2ee4d10" +dependencies = [ + "windows-result", + "windows-targets", +] + +[[package]] +name = "windows-sys" +version = "0.52.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "282be5f36a8ce781fad8c8ae18fa3f9beff57ec1b52cb3de0789201425d9a33d" +dependencies = [ + "windows-targets", +] + +[[package]] +name = "windows-targets" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9b724f72796e036ab90c1021d4780d4d3d648aca59e491e6b98e725b84e99973" +dependencies = [ + "windows_aarch64_gnullvm", + "windows_aarch64_msvc", + "windows_i686_gnu", + "windows_i686_gnullvm", + "windows_i686_msvc", + "windows_x86_64_gnu", + "windows_x86_64_gnullvm", + "windows_x86_64_msvc", +] + +[[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_msvc" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "09ec2a7bb152e2252b53fa7803150007879548bc709c039df7627cabbd05d469" + +[[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_gnullvm" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0eee52d38c090b3caa76c563b86c3a4bd71ef1a819287c19d586d7334ae8ed66" + +[[package]] +name = "windows_i686_msvc" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "240948bc05c5e7c6dabba28bf89d89ffce3e303022809e73deaefe4f6ec56c66" + +[[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_gnullvm" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "24d5b23dc417412679681396f2b49f3de8c1473deb516bd34410872eff51ed0d" + +[[package]] +name = "windows_x86_64_msvc" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "589f6da84c646204747d1270a2a5661ea66ed1cced2631d546fdfb155959f9ec" + +[[package]] +name = "write16" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d1890f4022759daae28ed4fe62859b1236caebfc61ede2f63ed4e695f3f6d936" + +[[package]] +name = "writeable" +version = "0.5.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1e9df38ee2d2c3c5948ea468a8406ff0db0b29ae1ffde1bcf20ef305bcc95c51" + +[[package]] +name = "yoke" +version = "0.7.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "120e6aef9aa629e3d4f52dc8cc43a015c7724194c97dfaf45180d2daf2b77f40" +dependencies = [ + "serde", + "stable_deref_trait", + "yoke-derive", + "zerofrom", +] + +[[package]] +name = "yoke-derive" +version = "0.7.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2380878cad4ac9aac1e2435f3eb4020e8374b5f13c296cb75b4620ff8e229154" +dependencies = [ + "proc-macro2", + "quote", + "syn", + "synstructure", +] + +[[package]] +name = "zerofrom" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cff3ee08c995dee1859d998dea82f7374f2826091dd9cd47def953cae446cd2e" +dependencies = [ + "zerofrom-derive", +] + +[[package]] +name = "zerofrom-derive" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "595eed982f7d355beb85837f651fa22e90b3c044842dc7f2c2842c086f295808" +dependencies = [ + "proc-macro2", + "quote", + "syn", + "synstructure", +] + +[[package]] +name = "zeroize" +version = "1.8.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ced3678a2879b30306d323f4542626697a464a97c0a07c9aebf7ebca65cd4dde" + +[[package]] +name = "zerovec" +version = "0.10.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "aa2b893d79df23bfb12d5461018d408ea19dfafe76c2c7ef6d4eba614f8ff079" +dependencies = [ + "yoke", + "zerofrom", + "zerovec-derive", +] + +[[package]] +name = "zerovec-derive" +version = "0.10.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6eafa6dfb17584ea3e2bd6e76e0cc15ad7af12b09abdd1ca55961bed9b1063c6" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] diff --git a/Cargo.toml b/Cargo.toml index 990cbf9..5e8e6e2 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -12,7 +12,7 @@ [package] edition = "2021" name = "forgejo-api" -version = "0.6.0" +version = "0.7.0" build = false autolib = false autobins = false @@ -32,6 +32,10 @@ path = "src/lib.rs" name = "admin" path = "tests/admin.rs" +[[test]] +name = "headers" +path = "tests/headers.rs" + [[test]] name = "organization" path = "tests/organization.rs" diff --git a/Cargo.toml.orig b/Cargo.toml.orig index 9d4356a..fc1a199 100644 --- a/Cargo.toml.orig +++ b/Cargo.toml.orig @@ -1,7 +1,7 @@ workspace = { members = ["generator"] } [package] name = "forgejo-api" -version = "0.6.0" +version = "0.7.0" edition = "2021" license = "Apache-2.0 OR MIT" repository = "https://codeberg.org/Cyborus/forgejo-api" diff --git a/src/generated/methods.rs b/src/generated/methods.rs index ff00cf2..fb2a350 100644 --- a/src/generated/methods.rs +++ b/src/generated/methods.rs @@ -119,11 +119,11 @@ impl crate::Forgejo { pub async fn admin_get_all_emails( &self, query: AdminGetAllEmailsQuery, - ) -> Result<(EmailListHeaders, Vec), ForgejoError> { + ) -> Result, ForgejoError> { let request = self.get(&format!("admin/emails?{query}")).build()?; let response = self.execute(request).await?; match response.status().as_u16() { - 200 => Ok((response.headers().try_into()?, response.json().await?)), + 200 => Ok(response.json().await?), _ => Err(ForgejoError::UnexpectedStatusCode(response.status())), } } @@ -133,11 +133,11 @@ impl crate::Forgejo { pub async fn admin_search_emails( &self, query: AdminSearchEmailsQuery, - ) -> Result<(EmailListHeaders, Vec), ForgejoError> { + ) -> Result, ForgejoError> { let request = self.get(&format!("admin/emails/search?{query}")).build()?; let response = self.execute(request).await?; match response.status().as_u16() { - 200 => Ok((response.headers().try_into()?, response.json().await?)), + 200 => Ok(response.json().await?), _ => Err(ForgejoError::UnexpectedStatusCode(response.status())), } } @@ -725,13 +725,11 @@ impl crate::Forgejo { } /// Returns a list of all gitignore templates - pub async fn list_gitignores_templates( - &self, - ) -> Result<(GitignoreTemplateListHeaders, Vec), ForgejoError> { + pub async fn list_gitignores_templates(&self) -> Result, ForgejoError> { let request = self.get("gitignore/templates").build()?; let response = self.execute(request).await?; match response.status().as_u16() { - 200 => Ok((response.headers().try_into()?, response.json().await?)), + 200 => Ok(response.json().await?), _ => Err(ForgejoError::UnexpectedStatusCode(response.status())), } } @@ -752,13 +750,11 @@ impl crate::Forgejo { } /// Returns a list of all label templates - pub async fn list_label_templates( - &self, - ) -> Result<(LabelTemplateListHeaders, Vec), ForgejoError> { + pub async fn list_label_templates(&self) -> Result, ForgejoError> { let request = self.get("label/templates").build()?; let response = self.execute(request).await?; match response.status().as_u16() { - 200 => Ok((response.headers().try_into()?, response.json().await?)), + 200 => Ok(response.json().await?), _ => Err(ForgejoError::UnexpectedStatusCode(response.status())), } } @@ -781,11 +777,11 @@ impl crate::Forgejo { /// Returns a list of all license templates pub async fn list_license_templates( &self, - ) -> Result<(LicenseTemplateListHeaders, Vec), ForgejoError> { + ) -> Result, ForgejoError> { let request = self.get("licenses").build()?; let response = self.execute(request).await?; match response.status().as_u16() { - 200 => Ok((response.headers().try_into()?, response.json().await?)), + 200 => Ok(response.json().await?), _ => Err(ForgejoError::UnexpectedStatusCode(response.status())), } } @@ -2006,13 +2002,13 @@ impl crate::Forgejo { owner: &str, repo: &str, query: ListActionTasksQuery, - ) -> Result<(TasksListHeaders, ActionTaskResponse), ForgejoError> { + ) -> Result { let request = self .get(&format!("repos/{owner}/{repo}/actions/tasks?{query}")) .build()?; let response = self.execute(request).await?; match response.status().as_u16() { - 200 => Ok((response.headers().try_into()?, response.json().await?)), + 200 => Ok(response.json().await?), _ => Err(ForgejoError::UnexpectedStatusCode(response.status())), } } @@ -2270,13 +2266,13 @@ impl crate::Forgejo { &self, owner: &str, repo: &str, - ) -> Result<(BranchProtectionListHeaders, Vec), ForgejoError> { + ) -> Result, ForgejoError> { let request = self .get(&format!("repos/{owner}/{repo}/branch_protections")) .build()?; let response = self.execute(request).await?; match response.status().as_u16() { - 200 => Ok((response.headers().try_into()?, response.json().await?)), + 200 => Ok(response.json().await?), _ => Err(ForgejoError::UnexpectedStatusCode(response.status())), } } @@ -3186,13 +3182,13 @@ impl crate::Forgejo { &self, owner: &str, repo: &str, - ) -> Result<(ReferenceListHeaders, Vec), ForgejoError> { + ) -> Result, ForgejoError> { let request = self .get(&format!("repos/{owner}/{repo}/git/refs")) .build()?; let response = self.execute(request).await?; match response.status().as_u16() { - 200 => Ok((response.headers().try_into()?, response.json().await?)), + 200 => Ok(response.json().await?), _ => Err(ForgejoError::UnexpectedStatusCode(response.status())), } } @@ -3207,13 +3203,13 @@ impl crate::Forgejo { owner: &str, repo: &str, r#ref: &str, - ) -> Result<(ReferenceListHeaders, Vec), ForgejoError> { + ) -> Result, ForgejoError> { let request = self .get(&format!("repos/{owner}/{repo}/git/refs/{ref}")) .build()?; let response = self.execute(request).await?; match response.status().as_u16() { - 200 => Ok((response.headers().try_into()?, response.json().await?)), + 200 => Ok(response.json().await?), _ => Err(ForgejoError::UnexpectedStatusCode(response.status())), } } @@ -3673,13 +3669,13 @@ impl crate::Forgejo { owner: &str, repo: &str, id: u64, - ) -> Result<(AttachmentListHeaders, Vec), ForgejoError> { + ) -> Result, ForgejoError> { let request = self .get(&format!("repos/{owner}/{repo}/issues/comments/{id}/assets")) .build()?; let response = self.execute(request).await?; match response.status().as_u16() { - 200 => Ok((response.headers().try_into()?, response.json().await?)), + 200 => Ok(response.json().await?), _ => Err(ForgejoError::UnexpectedStatusCode(response.status())), } } @@ -3967,13 +3963,13 @@ impl crate::Forgejo { owner: &str, repo: &str, index: u64, - ) -> Result<(AttachmentListHeaders, Vec), ForgejoError> { + ) -> Result, ForgejoError> { let request = self .get(&format!("repos/{owner}/{repo}/issues/{index}/assets")) .build()?; let response = self.execute(request).await?; match response.status().as_u16() { - 200 => Ok((response.headers().try_into()?, response.json().await?)), + 200 => Ok(response.json().await?), _ => Err(ForgejoError::UnexpectedStatusCode(response.status())), } } @@ -5764,7 +5760,7 @@ impl crate::Forgejo { repo: &str, index: u64, id: u64, - ) -> Result<(PullReviewCommentListHeaders, Vec), ForgejoError> { + ) -> Result, ForgejoError> { let request = self .get(&format!( "repos/{owner}/{repo}/pulls/{index}/reviews/{id}/comments" @@ -5772,7 +5768,7 @@ impl crate::Forgejo { .build()?; let response = self.execute(request).await?; match response.status().as_u16() { - 200 => Ok((response.headers().try_into()?, response.json().await?)), + 200 => Ok(response.json().await?), _ => Err(ForgejoError::UnexpectedStatusCode(response.status())), } } @@ -6236,13 +6232,13 @@ impl crate::Forgejo { owner: &str, repo: &str, id: u64, - ) -> Result<(AttachmentListHeaders, Vec), ForgejoError> { + ) -> Result, ForgejoError> { let request = self .get(&format!("repos/{owner}/{repo}/releases/{id}/assets")) .build()?; let response = self.execute(request).await?; match response.status().as_u16() { - 200 => Ok((response.headers().try_into()?, response.json().await?)), + 200 => Ok(response.json().await?), _ => Err(ForgejoError::UnexpectedStatusCode(response.status())), } } @@ -6561,13 +6557,13 @@ impl crate::Forgejo { &self, owner: &str, repo: &str, - ) -> Result<(TagProtectionListHeaders, Vec), ForgejoError> { + ) -> Result, ForgejoError> { let request = self .get(&format!("repos/{owner}/{repo}/tag_protections")) .build()?; let response = self.execute(request).await?; match response.status().as_u16() { - 200 => Ok((response.headers().try_into()?, response.json().await?)), + 200 => Ok(response.json().await?), _ => Err(ForgejoError::UnexpectedStatusCode(response.status())), } } @@ -7717,11 +7713,11 @@ impl crate::Forgejo { } /// List the authenticated user's email addresses - pub async fn user_list_emails(&self) -> Result<(EmailListHeaders, Vec), ForgejoError> { + pub async fn user_list_emails(&self) -> Result, ForgejoError> { let request = self.get("user/emails").build()?; let response = self.execute(request).await?; match response.status().as_u16() { - 200 => Ok((response.headers().try_into()?, response.json().await?)), + 200 => Ok(response.json().await?), _ => Err(ForgejoError::UnexpectedStatusCode(response.status())), } } @@ -7732,11 +7728,11 @@ impl crate::Forgejo { pub async fn user_add_email( &self, body: CreateEmailOption, - ) -> Result<(EmailListHeaders, Vec), ForgejoError> { + ) -> Result, ForgejoError> { let request = self.post("user/emails").json(&body).build()?; let response = self.execute(request).await?; match response.status().as_u16() { - 201 => Ok((response.headers().try_into()?, response.json().await?)), + 201 => Ok(response.json().await?), _ => Err(ForgejoError::UnexpectedStatusCode(response.status())), } } diff --git a/src/generated/structs.rs b/src/generated/structs.rs index c51164f..e0ad858 100644 --- a/src/generated/structs.rs +++ b/src/generated/structs.rs @@ -3153,382 +3153,87 @@ pub struct WikiPageMetaData { } pub struct AccessTokenListHeaders { - pub x_has_more: Option, - pub x_page: Option, - pub x_page_count: Option, - pub x_per_page: Option, - pub x_total: Option, + pub x_total_count: Option, } impl TryFrom<&reqwest::header::HeaderMap> for AccessTokenListHeaders { type Error = StructureError; fn try_from(map: &reqwest::header::HeaderMap) -> Result { - let x_has_more = map - .get("X-HasMore") - .map(|s| -> Result<_, _> { - let s = s.to_str().map_err(|_| StructureError::HeaderNotAscii)?; - s.parse::() - .map_err(|_| StructureError::HeaderParseFailed) - }) - .transpose()?; - let x_page = map - .get("X-Page") + let x_total_count = map + .get("x-total-count") .map(|s| -> Result<_, _> { let s = s.to_str().map_err(|_| StructureError::HeaderNotAscii)?; s.parse::() .map_err(|_| StructureError::HeaderParseFailed) }) .transpose()?; - let x_page_count = map - .get("X-PageCount") - .map(|s| -> Result<_, _> { - let s = s.to_str().map_err(|_| StructureError::HeaderNotAscii)?; - s.parse::() - .map_err(|_| StructureError::HeaderParseFailed) - }) - .transpose()?; - let x_per_page = map - .get("X-PerPage") - .map(|s| -> Result<_, _> { - let s = s.to_str().map_err(|_| StructureError::HeaderNotAscii)?; - s.parse::() - .map_err(|_| StructureError::HeaderParseFailed) - }) - .transpose()?; - let x_total = map - .get("X-Total") - .map(|s| -> Result<_, _> { - let s = s.to_str().map_err(|_| StructureError::HeaderNotAscii)?; - s.parse::() - .map_err(|_| StructureError::HeaderParseFailed) - }) - .transpose()?; - Ok(Self { - x_has_more, - x_page, - x_page_count, - x_per_page, - x_total, - }) + Ok(Self { x_total_count }) } } pub struct ActivityFeedsListHeaders { - pub x_has_more: Option, - pub x_page: Option, - pub x_page_count: Option, - pub x_per_page: Option, - pub x_total: Option, + pub x_total_count: Option, } impl TryFrom<&reqwest::header::HeaderMap> for ActivityFeedsListHeaders { type Error = StructureError; fn try_from(map: &reqwest::header::HeaderMap) -> Result { - let x_has_more = map - .get("X-HasMore") - .map(|s| -> Result<_, _> { - let s = s.to_str().map_err(|_| StructureError::HeaderNotAscii)?; - s.parse::() - .map_err(|_| StructureError::HeaderParseFailed) - }) - .transpose()?; - let x_page = map - .get("X-Page") + let x_total_count = map + .get("x-total-count") .map(|s| -> Result<_, _> { let s = s.to_str().map_err(|_| StructureError::HeaderNotAscii)?; s.parse::() .map_err(|_| StructureError::HeaderParseFailed) }) .transpose()?; - let x_page_count = map - .get("X-PageCount") - .map(|s| -> Result<_, _> { - let s = s.to_str().map_err(|_| StructureError::HeaderNotAscii)?; - s.parse::() - .map_err(|_| StructureError::HeaderParseFailed) - }) - .transpose()?; - let x_per_page = map - .get("X-PerPage") - .map(|s| -> Result<_, _> { - let s = s.to_str().map_err(|_| StructureError::HeaderNotAscii)?; - s.parse::() - .map_err(|_| StructureError::HeaderParseFailed) - }) - .transpose()?; - let x_total = map - .get("X-Total") - .map(|s| -> Result<_, _> { - let s = s.to_str().map_err(|_| StructureError::HeaderNotAscii)?; - s.parse::() - .map_err(|_| StructureError::HeaderParseFailed) - }) - .transpose()?; - Ok(Self { - x_has_more, - x_page, - x_page_count, - x_per_page, - x_total, - }) - } -} - -pub struct AttachmentListHeaders { - pub x_has_more: Option, - pub x_page: Option, - pub x_page_count: Option, - pub x_per_page: Option, - pub x_total: Option, -} - -impl TryFrom<&reqwest::header::HeaderMap> for AttachmentListHeaders { - type Error = StructureError; - - fn try_from(map: &reqwest::header::HeaderMap) -> Result { - let x_has_more = map - .get("X-HasMore") - .map(|s| -> Result<_, _> { - let s = s.to_str().map_err(|_| StructureError::HeaderNotAscii)?; - s.parse::() - .map_err(|_| StructureError::HeaderParseFailed) - }) - .transpose()?; - let x_page = map - .get("X-Page") - .map(|s| -> Result<_, _> { - let s = s.to_str().map_err(|_| StructureError::HeaderNotAscii)?; - s.parse::() - .map_err(|_| StructureError::HeaderParseFailed) - }) - .transpose()?; - let x_page_count = map - .get("X-PageCount") - .map(|s| -> Result<_, _> { - let s = s.to_str().map_err(|_| StructureError::HeaderNotAscii)?; - s.parse::() - .map_err(|_| StructureError::HeaderParseFailed) - }) - .transpose()?; - let x_per_page = map - .get("X-PerPage") - .map(|s| -> Result<_, _> { - let s = s.to_str().map_err(|_| StructureError::HeaderNotAscii)?; - s.parse::() - .map_err(|_| StructureError::HeaderParseFailed) - }) - .transpose()?; - let x_total = map - .get("X-Total") - .map(|s| -> Result<_, _> { - let s = s.to_str().map_err(|_| StructureError::HeaderNotAscii)?; - s.parse::() - .map_err(|_| StructureError::HeaderParseFailed) - }) - .transpose()?; - Ok(Self { - x_has_more, - x_page, - x_page_count, - x_per_page, - x_total, - }) + Ok(Self { x_total_count }) } } pub struct BlockedUserListHeaders { - pub x_has_more: Option, - pub x_page: Option, - pub x_page_count: Option, - pub x_per_page: Option, - pub x_total: Option, + pub x_total_count: Option, } impl TryFrom<&reqwest::header::HeaderMap> for BlockedUserListHeaders { type Error = StructureError; fn try_from(map: &reqwest::header::HeaderMap) -> Result { - let x_has_more = map - .get("X-HasMore") - .map(|s| -> Result<_, _> { - let s = s.to_str().map_err(|_| StructureError::HeaderNotAscii)?; - s.parse::() - .map_err(|_| StructureError::HeaderParseFailed) - }) - .transpose()?; - let x_page = map - .get("X-Page") + let x_total_count = map + .get("x-total-count") .map(|s| -> Result<_, _> { let s = s.to_str().map_err(|_| StructureError::HeaderNotAscii)?; s.parse::() .map_err(|_| StructureError::HeaderParseFailed) }) .transpose()?; - let x_page_count = map - .get("X-PageCount") - .map(|s| -> Result<_, _> { - let s = s.to_str().map_err(|_| StructureError::HeaderNotAscii)?; - s.parse::() - .map_err(|_| StructureError::HeaderParseFailed) - }) - .transpose()?; - let x_per_page = map - .get("X-PerPage") - .map(|s| -> Result<_, _> { - let s = s.to_str().map_err(|_| StructureError::HeaderNotAscii)?; - s.parse::() - .map_err(|_| StructureError::HeaderParseFailed) - }) - .transpose()?; - let x_total = map - .get("X-Total") - .map(|s| -> Result<_, _> { - let s = s.to_str().map_err(|_| StructureError::HeaderNotAscii)?; - s.parse::() - .map_err(|_| StructureError::HeaderParseFailed) - }) - .transpose()?; - Ok(Self { - x_has_more, - x_page, - x_page_count, - x_per_page, - x_total, - }) + Ok(Self { x_total_count }) } } pub struct BranchListHeaders { - pub x_has_more: Option, - pub x_page: Option, - pub x_page_count: Option, - pub x_per_page: Option, - pub x_total: Option, + pub x_total_count: Option, } impl TryFrom<&reqwest::header::HeaderMap> for BranchListHeaders { type Error = StructureError; fn try_from(map: &reqwest::header::HeaderMap) -> Result { - let x_has_more = map - .get("X-HasMore") - .map(|s| -> Result<_, _> { - let s = s.to_str().map_err(|_| StructureError::HeaderNotAscii)?; - s.parse::() - .map_err(|_| StructureError::HeaderParseFailed) - }) - .transpose()?; - let x_page = map - .get("X-Page") + let x_total_count = map + .get("x-total-count") .map(|s| -> Result<_, _> { let s = s.to_str().map_err(|_| StructureError::HeaderNotAscii)?; s.parse::() .map_err(|_| StructureError::HeaderParseFailed) }) .transpose()?; - let x_page_count = map - .get("X-PageCount") - .map(|s| -> Result<_, _> { - let s = s.to_str().map_err(|_| StructureError::HeaderNotAscii)?; - s.parse::() - .map_err(|_| StructureError::HeaderParseFailed) - }) - .transpose()?; - let x_per_page = map - .get("X-PerPage") - .map(|s| -> Result<_, _> { - let s = s.to_str().map_err(|_| StructureError::HeaderNotAscii)?; - s.parse::() - .map_err(|_| StructureError::HeaderParseFailed) - }) - .transpose()?; - let x_total = map - .get("X-Total") - .map(|s| -> Result<_, _> { - let s = s.to_str().map_err(|_| StructureError::HeaderNotAscii)?; - s.parse::() - .map_err(|_| StructureError::HeaderParseFailed) - }) - .transpose()?; - Ok(Self { - x_has_more, - x_page, - x_page_count, - x_per_page, - x_total, - }) - } -} - -pub struct BranchProtectionListHeaders { - pub x_has_more: Option, - pub x_page: Option, - pub x_page_count: Option, - pub x_per_page: Option, - pub x_total: Option, -} - -impl TryFrom<&reqwest::header::HeaderMap> for BranchProtectionListHeaders { - type Error = StructureError; - - fn try_from(map: &reqwest::header::HeaderMap) -> Result { - let x_has_more = map - .get("X-HasMore") - .map(|s| -> Result<_, _> { - let s = s.to_str().map_err(|_| StructureError::HeaderNotAscii)?; - s.parse::() - .map_err(|_| StructureError::HeaderParseFailed) - }) - .transpose()?; - let x_page = map - .get("X-Page") - .map(|s| -> Result<_, _> { - let s = s.to_str().map_err(|_| StructureError::HeaderNotAscii)?; - s.parse::() - .map_err(|_| StructureError::HeaderParseFailed) - }) - .transpose()?; - let x_page_count = map - .get("X-PageCount") - .map(|s| -> Result<_, _> { - let s = s.to_str().map_err(|_| StructureError::HeaderNotAscii)?; - s.parse::() - .map_err(|_| StructureError::HeaderParseFailed) - }) - .transpose()?; - let x_per_page = map - .get("X-PerPage") - .map(|s| -> Result<_, _> { - let s = s.to_str().map_err(|_| StructureError::HeaderNotAscii)?; - s.parse::() - .map_err(|_| StructureError::HeaderParseFailed) - }) - .transpose()?; - let x_total = map - .get("X-Total") - .map(|s| -> Result<_, _> { - let s = s.to_str().map_err(|_| StructureError::HeaderNotAscii)?; - s.parse::() - .map_err(|_| StructureError::HeaderParseFailed) - }) - .transpose()?; - Ok(Self { - x_has_more, - x_page, - x_page_count, - x_per_page, - x_total, - }) + Ok(Self { x_total_count }) } } pub struct ChangedFileListHeaders { pub x_has_more: Option, - pub x_page: Option, - pub x_page_count: Option, - pub x_per_page: Option, pub x_total_count: Option, } @@ -3537,39 +3242,15 @@ impl TryFrom<&reqwest::header::HeaderMap> for ChangedFileListHeaders { fn try_from(map: &reqwest::header::HeaderMap) -> Result { let x_has_more = map - .get("X-HasMore") + .get("x-hasmore") .map(|s| -> Result<_, _> { let s = s.to_str().map_err(|_| StructureError::HeaderNotAscii)?; s.parse::() .map_err(|_| StructureError::HeaderParseFailed) }) .transpose()?; - let x_page = map - .get("X-Page") - .map(|s| -> Result<_, _> { - let s = s.to_str().map_err(|_| StructureError::HeaderNotAscii)?; - s.parse::() - .map_err(|_| StructureError::HeaderParseFailed) - }) - .transpose()?; - let x_page_count = map - .get("X-PageCount") - .map(|s| -> Result<_, _> { - let s = s.to_str().map_err(|_| StructureError::HeaderNotAscii)?; - s.parse::() - .map_err(|_| StructureError::HeaderParseFailed) - }) - .transpose()?; - let x_per_page = map - .get("X-PerPage") - .map(|s| -> Result<_, _> { - let s = s.to_str().map_err(|_| StructureError::HeaderNotAscii)?; - s.parse::() - .map_err(|_| StructureError::HeaderParseFailed) - }) - .transpose()?; let x_total_count = map - .get("X-Total-Count") + .get("x-total-count") .map(|s| -> Result<_, _> { let s = s.to_str().map_err(|_| StructureError::HeaderNotAscii)?; s.parse::() @@ -3578,82 +3259,34 @@ impl TryFrom<&reqwest::header::HeaderMap> for ChangedFileListHeaders { .transpose()?; Ok(Self { x_has_more, - x_page, - x_page_count, - x_per_page, x_total_count, }) } } pub struct CommentListHeaders { - pub x_has_more: Option, - pub x_page: Option, - pub x_page_count: Option, - pub x_per_page: Option, - pub x_total: Option, + pub x_total_count: Option, } impl TryFrom<&reqwest::header::HeaderMap> for CommentListHeaders { type Error = StructureError; fn try_from(map: &reqwest::header::HeaderMap) -> Result { - let x_has_more = map - .get("X-HasMore") - .map(|s| -> Result<_, _> { - let s = s.to_str().map_err(|_| StructureError::HeaderNotAscii)?; - s.parse::() - .map_err(|_| StructureError::HeaderParseFailed) - }) - .transpose()?; - let x_page = map - .get("X-Page") + let x_total_count = map + .get("x-total-count") .map(|s| -> Result<_, _> { let s = s.to_str().map_err(|_| StructureError::HeaderNotAscii)?; s.parse::() .map_err(|_| StructureError::HeaderParseFailed) }) .transpose()?; - let x_page_count = map - .get("X-PageCount") - .map(|s| -> Result<_, _> { - let s = s.to_str().map_err(|_| StructureError::HeaderNotAscii)?; - s.parse::() - .map_err(|_| StructureError::HeaderParseFailed) - }) - .transpose()?; - let x_per_page = map - .get("X-PerPage") - .map(|s| -> Result<_, _> { - let s = s.to_str().map_err(|_| StructureError::HeaderNotAscii)?; - s.parse::() - .map_err(|_| StructureError::HeaderParseFailed) - }) - .transpose()?; - let x_total = map - .get("X-Total") - .map(|s| -> Result<_, _> { - let s = s.to_str().map_err(|_| StructureError::HeaderNotAscii)?; - s.parse::() - .map_err(|_| StructureError::HeaderParseFailed) - }) - .transpose()?; - Ok(Self { - x_has_more, - x_page, - x_page_count, - x_per_page, - x_total, - }) + Ok(Self { x_total_count }) } } pub struct CommitListHeaders { pub x_has_more: Option, - pub x_page: Option, - pub x_page_count: Option, - pub x_per_page: Option, - pub x_total: Option, + pub x_total_count: Option, } impl TryFrom<&reqwest::header::HeaderMap> for CommitListHeaders { @@ -3661,39 +3294,15 @@ impl TryFrom<&reqwest::header::HeaderMap> for CommitListHeaders { fn try_from(map: &reqwest::header::HeaderMap) -> Result { let x_has_more = map - .get("X-HasMore") + .get("x-hasmore") .map(|s| -> Result<_, _> { let s = s.to_str().map_err(|_| StructureError::HeaderNotAscii)?; s.parse::() .map_err(|_| StructureError::HeaderParseFailed) }) .transpose()?; - let x_page = map - .get("X-Page") - .map(|s| -> Result<_, _> { - let s = s.to_str().map_err(|_| StructureError::HeaderNotAscii)?; - s.parse::() - .map_err(|_| StructureError::HeaderParseFailed) - }) - .transpose()?; - let x_page_count = map - .get("X-PageCount") - .map(|s| -> Result<_, _> { - let s = s.to_str().map_err(|_| StructureError::HeaderNotAscii)?; - s.parse::() - .map_err(|_| StructureError::HeaderParseFailed) - }) - .transpose()?; - let x_per_page = map - .get("X-PerPage") - .map(|s| -> Result<_, _> { - let s = s.to_str().map_err(|_| StructureError::HeaderNotAscii)?; - s.parse::() - .map_err(|_| StructureError::HeaderParseFailed) - }) - .transpose()?; - let x_total = map - .get("X-Total") + let x_total_count = map + .get("x-total-count") .map(|s| -> Result<_, _> { let s = s.to_str().map_err(|_| StructureError::HeaderNotAscii)?; s.parse::() @@ -3702,1871 +3311,488 @@ impl TryFrom<&reqwest::header::HeaderMap> for CommitListHeaders { .transpose()?; Ok(Self { x_has_more, - x_page, - x_page_count, - x_per_page, - x_total, + x_total_count, }) } } pub struct CommitStatusListHeaders { - pub x_has_more: Option, - pub x_page: Option, - pub x_page_count: Option, - pub x_per_page: Option, - pub x_total: Option, + pub x_total_count: Option, } impl TryFrom<&reqwest::header::HeaderMap> for CommitStatusListHeaders { type Error = StructureError; fn try_from(map: &reqwest::header::HeaderMap) -> Result { - let x_has_more = map - .get("X-HasMore") - .map(|s| -> Result<_, _> { - let s = s.to_str().map_err(|_| StructureError::HeaderNotAscii)?; - s.parse::() - .map_err(|_| StructureError::HeaderParseFailed) - }) - .transpose()?; - let x_page = map - .get("X-Page") + let x_total_count = map + .get("x-total-count") .map(|s| -> Result<_, _> { let s = s.to_str().map_err(|_| StructureError::HeaderNotAscii)?; s.parse::() .map_err(|_| StructureError::HeaderParseFailed) }) .transpose()?; - let x_page_count = map - .get("X-PageCount") - .map(|s| -> Result<_, _> { - let s = s.to_str().map_err(|_| StructureError::HeaderNotAscii)?; - s.parse::() - .map_err(|_| StructureError::HeaderParseFailed) - }) - .transpose()?; - let x_per_page = map - .get("X-PerPage") - .map(|s| -> Result<_, _> { - let s = s.to_str().map_err(|_| StructureError::HeaderNotAscii)?; - s.parse::() - .map_err(|_| StructureError::HeaderParseFailed) - }) - .transpose()?; - let x_total = map - .get("X-Total") - .map(|s| -> Result<_, _> { - let s = s.to_str().map_err(|_| StructureError::HeaderNotAscii)?; - s.parse::() - .map_err(|_| StructureError::HeaderParseFailed) - }) - .transpose()?; - Ok(Self { - x_has_more, - x_page, - x_page_count, - x_per_page, - x_total, - }) + Ok(Self { x_total_count }) } } pub struct CronListHeaders { - pub x_has_more: Option, - pub x_page: Option, - pub x_page_count: Option, - pub x_per_page: Option, - pub x_total: Option, + pub x_total_count: Option, } impl TryFrom<&reqwest::header::HeaderMap> for CronListHeaders { type Error = StructureError; fn try_from(map: &reqwest::header::HeaderMap) -> Result { - let x_has_more = map - .get("X-HasMore") - .map(|s| -> Result<_, _> { - let s = s.to_str().map_err(|_| StructureError::HeaderNotAscii)?; - s.parse::() - .map_err(|_| StructureError::HeaderParseFailed) - }) - .transpose()?; - let x_page = map - .get("X-Page") + let x_total_count = map + .get("x-total-count") .map(|s| -> Result<_, _> { let s = s.to_str().map_err(|_| StructureError::HeaderNotAscii)?; s.parse::() .map_err(|_| StructureError::HeaderParseFailed) }) .transpose()?; - let x_page_count = map - .get("X-PageCount") - .map(|s| -> Result<_, _> { - let s = s.to_str().map_err(|_| StructureError::HeaderNotAscii)?; - s.parse::() - .map_err(|_| StructureError::HeaderParseFailed) - }) - .transpose()?; - let x_per_page = map - .get("X-PerPage") - .map(|s| -> Result<_, _> { - let s = s.to_str().map_err(|_| StructureError::HeaderNotAscii)?; - s.parse::() - .map_err(|_| StructureError::HeaderParseFailed) - }) - .transpose()?; - let x_total = map - .get("X-Total") - .map(|s| -> Result<_, _> { - let s = s.to_str().map_err(|_| StructureError::HeaderNotAscii)?; - s.parse::() - .map_err(|_| StructureError::HeaderParseFailed) - }) - .transpose()?; - Ok(Self { - x_has_more, - x_page, - x_page_count, - x_per_page, - x_total, - }) + Ok(Self { x_total_count }) } } pub struct DeployKeyListHeaders { - pub x_has_more: Option, - pub x_page: Option, - pub x_page_count: Option, - pub x_per_page: Option, - pub x_total: Option, + pub x_total_count: Option, } impl TryFrom<&reqwest::header::HeaderMap> for DeployKeyListHeaders { type Error = StructureError; fn try_from(map: &reqwest::header::HeaderMap) -> Result { - let x_has_more = map - .get("X-HasMore") - .map(|s| -> Result<_, _> { - let s = s.to_str().map_err(|_| StructureError::HeaderNotAscii)?; - s.parse::() - .map_err(|_| StructureError::HeaderParseFailed) - }) - .transpose()?; - let x_page = map - .get("X-Page") + let x_total_count = map + .get("x-total-count") .map(|s| -> Result<_, _> { let s = s.to_str().map_err(|_| StructureError::HeaderNotAscii)?; s.parse::() .map_err(|_| StructureError::HeaderParseFailed) }) .transpose()?; - let x_page_count = map - .get("X-PageCount") - .map(|s| -> Result<_, _> { - let s = s.to_str().map_err(|_| StructureError::HeaderNotAscii)?; - s.parse::() - .map_err(|_| StructureError::HeaderParseFailed) - }) - .transpose()?; - let x_per_page = map - .get("X-PerPage") - .map(|s| -> Result<_, _> { - let s = s.to_str().map_err(|_| StructureError::HeaderNotAscii)?; - s.parse::() - .map_err(|_| StructureError::HeaderParseFailed) - }) - .transpose()?; - let x_total = map - .get("X-Total") - .map(|s| -> Result<_, _> { - let s = s.to_str().map_err(|_| StructureError::HeaderNotAscii)?; - s.parse::() - .map_err(|_| StructureError::HeaderParseFailed) - }) - .transpose()?; - Ok(Self { - x_has_more, - x_page, - x_page_count, - x_per_page, - x_total, - }) - } -} - -pub struct EmailListHeaders { - pub x_has_more: Option, - pub x_page: Option, - pub x_page_count: Option, - pub x_per_page: Option, - pub x_total: Option, -} - -impl TryFrom<&reqwest::header::HeaderMap> for EmailListHeaders { - type Error = StructureError; - - fn try_from(map: &reqwest::header::HeaderMap) -> Result { - let x_has_more = map - .get("X-HasMore") - .map(|s| -> Result<_, _> { - let s = s.to_str().map_err(|_| StructureError::HeaderNotAscii)?; - s.parse::() - .map_err(|_| StructureError::HeaderParseFailed) - }) - .transpose()?; - let x_page = map - .get("X-Page") - .map(|s| -> Result<_, _> { - let s = s.to_str().map_err(|_| StructureError::HeaderNotAscii)?; - s.parse::() - .map_err(|_| StructureError::HeaderParseFailed) - }) - .transpose()?; - let x_page_count = map - .get("X-PageCount") - .map(|s| -> Result<_, _> { - let s = s.to_str().map_err(|_| StructureError::HeaderNotAscii)?; - s.parse::() - .map_err(|_| StructureError::HeaderParseFailed) - }) - .transpose()?; - let x_per_page = map - .get("X-PerPage") - .map(|s| -> Result<_, _> { - let s = s.to_str().map_err(|_| StructureError::HeaderNotAscii)?; - s.parse::() - .map_err(|_| StructureError::HeaderParseFailed) - }) - .transpose()?; - let x_total = map - .get("X-Total") - .map(|s| -> Result<_, _> { - let s = s.to_str().map_err(|_| StructureError::HeaderNotAscii)?; - s.parse::() - .map_err(|_| StructureError::HeaderParseFailed) - }) - .transpose()?; - Ok(Self { - x_has_more, - x_page, - x_page_count, - x_per_page, - x_total, - }) + Ok(Self { x_total_count }) } } pub struct GpgKeyListHeaders { - pub x_has_more: Option, - pub x_page: Option, - pub x_page_count: Option, - pub x_per_page: Option, - pub x_total: Option, + pub x_total_count: Option, } impl TryFrom<&reqwest::header::HeaderMap> for GpgKeyListHeaders { type Error = StructureError; fn try_from(map: &reqwest::header::HeaderMap) -> Result { - let x_has_more = map - .get("X-HasMore") - .map(|s| -> Result<_, _> { - let s = s.to_str().map_err(|_| StructureError::HeaderNotAscii)?; - s.parse::() - .map_err(|_| StructureError::HeaderParseFailed) - }) - .transpose()?; - let x_page = map - .get("X-Page") + let x_total_count = map + .get("x-total-count") .map(|s| -> Result<_, _> { let s = s.to_str().map_err(|_| StructureError::HeaderNotAscii)?; s.parse::() .map_err(|_| StructureError::HeaderParseFailed) }) .transpose()?; - let x_page_count = map - .get("X-PageCount") - .map(|s| -> Result<_, _> { - let s = s.to_str().map_err(|_| StructureError::HeaderNotAscii)?; - s.parse::() - .map_err(|_| StructureError::HeaderParseFailed) - }) - .transpose()?; - let x_per_page = map - .get("X-PerPage") - .map(|s| -> Result<_, _> { - let s = s.to_str().map_err(|_| StructureError::HeaderNotAscii)?; - s.parse::() - .map_err(|_| StructureError::HeaderParseFailed) - }) - .transpose()?; - let x_total = map - .get("X-Total") - .map(|s| -> Result<_, _> { - let s = s.to_str().map_err(|_| StructureError::HeaderNotAscii)?; - s.parse::() - .map_err(|_| StructureError::HeaderParseFailed) - }) - .transpose()?; - Ok(Self { - x_has_more, - x_page, - x_page_count, - x_per_page, - x_total, - }) + Ok(Self { x_total_count }) } } pub struct GitHookListHeaders { - pub x_has_more: Option, - pub x_page: Option, - pub x_page_count: Option, - pub x_per_page: Option, - pub x_total: Option, + pub x_total_count: Option, } impl TryFrom<&reqwest::header::HeaderMap> for GitHookListHeaders { type Error = StructureError; fn try_from(map: &reqwest::header::HeaderMap) -> Result { - let x_has_more = map - .get("X-HasMore") - .map(|s| -> Result<_, _> { - let s = s.to_str().map_err(|_| StructureError::HeaderNotAscii)?; - s.parse::() - .map_err(|_| StructureError::HeaderParseFailed) - }) - .transpose()?; - let x_page = map - .get("X-Page") + let x_total_count = map + .get("x-total-count") .map(|s| -> Result<_, _> { let s = s.to_str().map_err(|_| StructureError::HeaderNotAscii)?; s.parse::() .map_err(|_| StructureError::HeaderParseFailed) }) .transpose()?; - let x_page_count = map - .get("X-PageCount") - .map(|s| -> Result<_, _> { - let s = s.to_str().map_err(|_| StructureError::HeaderNotAscii)?; - s.parse::() - .map_err(|_| StructureError::HeaderParseFailed) - }) - .transpose()?; - let x_per_page = map - .get("X-PerPage") - .map(|s| -> Result<_, _> { - let s = s.to_str().map_err(|_| StructureError::HeaderNotAscii)?; - s.parse::() - .map_err(|_| StructureError::HeaderParseFailed) - }) - .transpose()?; - let x_total = map - .get("X-Total") - .map(|s| -> Result<_, _> { - let s = s.to_str().map_err(|_| StructureError::HeaderNotAscii)?; - s.parse::() - .map_err(|_| StructureError::HeaderParseFailed) - }) - .transpose()?; - Ok(Self { - x_has_more, - x_page, - x_page_count, - x_per_page, - x_total, - }) - } -} - -pub struct GitignoreTemplateListHeaders { - pub x_has_more: Option, - pub x_page: Option, - pub x_page_count: Option, - pub x_per_page: Option, - pub x_total: Option, -} - -impl TryFrom<&reqwest::header::HeaderMap> for GitignoreTemplateListHeaders { - type Error = StructureError; - - fn try_from(map: &reqwest::header::HeaderMap) -> Result { - let x_has_more = map - .get("X-HasMore") - .map(|s| -> Result<_, _> { - let s = s.to_str().map_err(|_| StructureError::HeaderNotAscii)?; - s.parse::() - .map_err(|_| StructureError::HeaderParseFailed) - }) - .transpose()?; - let x_page = map - .get("X-Page") - .map(|s| -> Result<_, _> { - let s = s.to_str().map_err(|_| StructureError::HeaderNotAscii)?; - s.parse::() - .map_err(|_| StructureError::HeaderParseFailed) - }) - .transpose()?; - let x_page_count = map - .get("X-PageCount") - .map(|s| -> Result<_, _> { - let s = s.to_str().map_err(|_| StructureError::HeaderNotAscii)?; - s.parse::() - .map_err(|_| StructureError::HeaderParseFailed) - }) - .transpose()?; - let x_per_page = map - .get("X-PerPage") - .map(|s| -> Result<_, _> { - let s = s.to_str().map_err(|_| StructureError::HeaderNotAscii)?; - s.parse::() - .map_err(|_| StructureError::HeaderParseFailed) - }) - .transpose()?; - let x_total = map - .get("X-Total") - .map(|s| -> Result<_, _> { - let s = s.to_str().map_err(|_| StructureError::HeaderNotAscii)?; - s.parse::() - .map_err(|_| StructureError::HeaderParseFailed) - }) - .transpose()?; - Ok(Self { - x_has_more, - x_page, - x_page_count, - x_per_page, - x_total, - }) + Ok(Self { x_total_count }) } } pub struct HookListHeaders { - pub x_has_more: Option, - pub x_page: Option, - pub x_page_count: Option, - pub x_per_page: Option, - pub x_total: Option, + pub x_total_count: Option, } impl TryFrom<&reqwest::header::HeaderMap> for HookListHeaders { type Error = StructureError; fn try_from(map: &reqwest::header::HeaderMap) -> Result { - let x_has_more = map - .get("X-HasMore") - .map(|s| -> Result<_, _> { - let s = s.to_str().map_err(|_| StructureError::HeaderNotAscii)?; - s.parse::() - .map_err(|_| StructureError::HeaderParseFailed) - }) - .transpose()?; - let x_page = map - .get("X-Page") + let x_total_count = map + .get("x-total-count") .map(|s| -> Result<_, _> { let s = s.to_str().map_err(|_| StructureError::HeaderNotAscii)?; s.parse::() .map_err(|_| StructureError::HeaderParseFailed) }) .transpose()?; - let x_page_count = map - .get("X-PageCount") - .map(|s| -> Result<_, _> { - let s = s.to_str().map_err(|_| StructureError::HeaderNotAscii)?; - s.parse::() - .map_err(|_| StructureError::HeaderParseFailed) - }) - .transpose()?; - let x_per_page = map - .get("X-PerPage") - .map(|s| -> Result<_, _> { - let s = s.to_str().map_err(|_| StructureError::HeaderNotAscii)?; - s.parse::() - .map_err(|_| StructureError::HeaderParseFailed) - }) - .transpose()?; - let x_total = map - .get("X-Total") - .map(|s| -> Result<_, _> { - let s = s.to_str().map_err(|_| StructureError::HeaderNotAscii)?; - s.parse::() - .map_err(|_| StructureError::HeaderParseFailed) - }) - .transpose()?; - Ok(Self { - x_has_more, - x_page, - x_page_count, - x_per_page, - x_total, - }) + Ok(Self { x_total_count }) } } pub struct IssueListHeaders { - pub x_has_more: Option, - pub x_page: Option, - pub x_page_count: Option, - pub x_per_page: Option, - pub x_total: Option, + pub x_total_count: Option, } impl TryFrom<&reqwest::header::HeaderMap> for IssueListHeaders { type Error = StructureError; fn try_from(map: &reqwest::header::HeaderMap) -> Result { - let x_has_more = map - .get("X-HasMore") - .map(|s| -> Result<_, _> { - let s = s.to_str().map_err(|_| StructureError::HeaderNotAscii)?; - s.parse::() - .map_err(|_| StructureError::HeaderParseFailed) - }) - .transpose()?; - let x_page = map - .get("X-Page") + let x_total_count = map + .get("x-total-count") .map(|s| -> Result<_, _> { let s = s.to_str().map_err(|_| StructureError::HeaderNotAscii)?; s.parse::() .map_err(|_| StructureError::HeaderParseFailed) }) .transpose()?; - let x_page_count = map - .get("X-PageCount") - .map(|s| -> Result<_, _> { - let s = s.to_str().map_err(|_| StructureError::HeaderNotAscii)?; - s.parse::() - .map_err(|_| StructureError::HeaderParseFailed) - }) - .transpose()?; - let x_per_page = map - .get("X-PerPage") - .map(|s| -> Result<_, _> { - let s = s.to_str().map_err(|_| StructureError::HeaderNotAscii)?; - s.parse::() - .map_err(|_| StructureError::HeaderParseFailed) - }) - .transpose()?; - let x_total = map - .get("X-Total") - .map(|s| -> Result<_, _> { - let s = s.to_str().map_err(|_| StructureError::HeaderNotAscii)?; - s.parse::() - .map_err(|_| StructureError::HeaderParseFailed) - }) - .transpose()?; - Ok(Self { - x_has_more, - x_page, - x_page_count, - x_per_page, - x_total, - }) + Ok(Self { x_total_count }) } } pub struct LabelListHeaders { - pub x_has_more: Option, - pub x_page: Option, - pub x_page_count: Option, - pub x_per_page: Option, - pub x_total: Option, + pub x_total_count: Option, } impl TryFrom<&reqwest::header::HeaderMap> for LabelListHeaders { type Error = StructureError; fn try_from(map: &reqwest::header::HeaderMap) -> Result { - let x_has_more = map - .get("X-HasMore") - .map(|s| -> Result<_, _> { - let s = s.to_str().map_err(|_| StructureError::HeaderNotAscii)?; - s.parse::() - .map_err(|_| StructureError::HeaderParseFailed) - }) - .transpose()?; - let x_page = map - .get("X-Page") + let x_total_count = map + .get("x-total-count") .map(|s| -> Result<_, _> { let s = s.to_str().map_err(|_| StructureError::HeaderNotAscii)?; s.parse::() .map_err(|_| StructureError::HeaderParseFailed) }) .transpose()?; - let x_page_count = map - .get("X-PageCount") - .map(|s| -> Result<_, _> { - let s = s.to_str().map_err(|_| StructureError::HeaderNotAscii)?; - s.parse::() - .map_err(|_| StructureError::HeaderParseFailed) - }) - .transpose()?; - let x_per_page = map - .get("X-PerPage") - .map(|s| -> Result<_, _> { - let s = s.to_str().map_err(|_| StructureError::HeaderNotAscii)?; - s.parse::() - .map_err(|_| StructureError::HeaderParseFailed) - }) - .transpose()?; - let x_total = map - .get("X-Total") - .map(|s| -> Result<_, _> { - let s = s.to_str().map_err(|_| StructureError::HeaderNotAscii)?; - s.parse::() - .map_err(|_| StructureError::HeaderParseFailed) - }) - .transpose()?; - Ok(Self { - x_has_more, - x_page, - x_page_count, - x_per_page, - x_total, - }) - } -} - -pub struct LabelTemplateListHeaders { - pub x_has_more: Option, - pub x_page: Option, - pub x_page_count: Option, - pub x_per_page: Option, - pub x_total: Option, -} - -impl TryFrom<&reqwest::header::HeaderMap> for LabelTemplateListHeaders { - type Error = StructureError; - - fn try_from(map: &reqwest::header::HeaderMap) -> Result { - let x_has_more = map - .get("X-HasMore") - .map(|s| -> Result<_, _> { - let s = s.to_str().map_err(|_| StructureError::HeaderNotAscii)?; - s.parse::() - .map_err(|_| StructureError::HeaderParseFailed) - }) - .transpose()?; - let x_page = map - .get("X-Page") - .map(|s| -> Result<_, _> { - let s = s.to_str().map_err(|_| StructureError::HeaderNotAscii)?; - s.parse::() - .map_err(|_| StructureError::HeaderParseFailed) - }) - .transpose()?; - let x_page_count = map - .get("X-PageCount") - .map(|s| -> Result<_, _> { - let s = s.to_str().map_err(|_| StructureError::HeaderNotAscii)?; - s.parse::() - .map_err(|_| StructureError::HeaderParseFailed) - }) - .transpose()?; - let x_per_page = map - .get("X-PerPage") - .map(|s| -> Result<_, _> { - let s = s.to_str().map_err(|_| StructureError::HeaderNotAscii)?; - s.parse::() - .map_err(|_| StructureError::HeaderParseFailed) - }) - .transpose()?; - let x_total = map - .get("X-Total") - .map(|s| -> Result<_, _> { - let s = s.to_str().map_err(|_| StructureError::HeaderNotAscii)?; - s.parse::() - .map_err(|_| StructureError::HeaderParseFailed) - }) - .transpose()?; - Ok(Self { - x_has_more, - x_page, - x_page_count, - x_per_page, - x_total, - }) - } -} - -pub struct LicenseTemplateListHeaders { - pub x_has_more: Option, - pub x_page: Option, - pub x_page_count: Option, - pub x_per_page: Option, - pub x_total: Option, -} - -impl TryFrom<&reqwest::header::HeaderMap> for LicenseTemplateListHeaders { - type Error = StructureError; - - fn try_from(map: &reqwest::header::HeaderMap) -> Result { - let x_has_more = map - .get("X-HasMore") - .map(|s| -> Result<_, _> { - let s = s.to_str().map_err(|_| StructureError::HeaderNotAscii)?; - s.parse::() - .map_err(|_| StructureError::HeaderParseFailed) - }) - .transpose()?; - let x_page = map - .get("X-Page") - .map(|s| -> Result<_, _> { - let s = s.to_str().map_err(|_| StructureError::HeaderNotAscii)?; - s.parse::() - .map_err(|_| StructureError::HeaderParseFailed) - }) - .transpose()?; - let x_page_count = map - .get("X-PageCount") - .map(|s| -> Result<_, _> { - let s = s.to_str().map_err(|_| StructureError::HeaderNotAscii)?; - s.parse::() - .map_err(|_| StructureError::HeaderParseFailed) - }) - .transpose()?; - let x_per_page = map - .get("X-PerPage") - .map(|s| -> Result<_, _> { - let s = s.to_str().map_err(|_| StructureError::HeaderNotAscii)?; - s.parse::() - .map_err(|_| StructureError::HeaderParseFailed) - }) - .transpose()?; - let x_total = map - .get("X-Total") - .map(|s| -> Result<_, _> { - let s = s.to_str().map_err(|_| StructureError::HeaderNotAscii)?; - s.parse::() - .map_err(|_| StructureError::HeaderParseFailed) - }) - .transpose()?; - Ok(Self { - x_has_more, - x_page, - x_page_count, - x_per_page, - x_total, - }) + Ok(Self { x_total_count }) } } pub struct MilestoneListHeaders { - pub x_has_more: Option, - pub x_page: Option, - pub x_page_count: Option, - pub x_per_page: Option, - pub x_total: Option, + pub x_total_count: Option, } impl TryFrom<&reqwest::header::HeaderMap> for MilestoneListHeaders { type Error = StructureError; fn try_from(map: &reqwest::header::HeaderMap) -> Result { - let x_has_more = map - .get("X-HasMore") - .map(|s| -> Result<_, _> { - let s = s.to_str().map_err(|_| StructureError::HeaderNotAscii)?; - s.parse::() - .map_err(|_| StructureError::HeaderParseFailed) - }) - .transpose()?; - let x_page = map - .get("X-Page") + let x_total_count = map + .get("x-total-count") .map(|s| -> Result<_, _> { let s = s.to_str().map_err(|_| StructureError::HeaderNotAscii)?; s.parse::() .map_err(|_| StructureError::HeaderParseFailed) }) .transpose()?; - let x_page_count = map - .get("X-PageCount") - .map(|s| -> Result<_, _> { - let s = s.to_str().map_err(|_| StructureError::HeaderNotAscii)?; - s.parse::() - .map_err(|_| StructureError::HeaderParseFailed) - }) - .transpose()?; - let x_per_page = map - .get("X-PerPage") - .map(|s| -> Result<_, _> { - let s = s.to_str().map_err(|_| StructureError::HeaderNotAscii)?; - s.parse::() - .map_err(|_| StructureError::HeaderParseFailed) - }) - .transpose()?; - let x_total = map - .get("X-Total") - .map(|s| -> Result<_, _> { - let s = s.to_str().map_err(|_| StructureError::HeaderNotAscii)?; - s.parse::() - .map_err(|_| StructureError::HeaderParseFailed) - }) - .transpose()?; - Ok(Self { - x_has_more, - x_page, - x_page_count, - x_per_page, - x_total, - }) + Ok(Self { x_total_count }) } } pub struct NotificationThreadListHeaders { - pub x_has_more: Option, - pub x_page: Option, - pub x_page_count: Option, - pub x_per_page: Option, - pub x_total: Option, + pub x_total_count: Option, } impl TryFrom<&reqwest::header::HeaderMap> for NotificationThreadListHeaders { type Error = StructureError; fn try_from(map: &reqwest::header::HeaderMap) -> Result { - let x_has_more = map - .get("X-HasMore") - .map(|s| -> Result<_, _> { - let s = s.to_str().map_err(|_| StructureError::HeaderNotAscii)?; - s.parse::() - .map_err(|_| StructureError::HeaderParseFailed) - }) - .transpose()?; - let x_page = map - .get("X-Page") + let x_total_count = map + .get("x-total-count") .map(|s| -> Result<_, _> { let s = s.to_str().map_err(|_| StructureError::HeaderNotAscii)?; s.parse::() .map_err(|_| StructureError::HeaderParseFailed) }) .transpose()?; - let x_page_count = map - .get("X-PageCount") - .map(|s| -> Result<_, _> { - let s = s.to_str().map_err(|_| StructureError::HeaderNotAscii)?; - s.parse::() - .map_err(|_| StructureError::HeaderParseFailed) - }) - .transpose()?; - let x_per_page = map - .get("X-PerPage") - .map(|s| -> Result<_, _> { - let s = s.to_str().map_err(|_| StructureError::HeaderNotAscii)?; - s.parse::() - .map_err(|_| StructureError::HeaderParseFailed) - }) - .transpose()?; - let x_total = map - .get("X-Total") - .map(|s| -> Result<_, _> { - let s = s.to_str().map_err(|_| StructureError::HeaderNotAscii)?; - s.parse::() - .map_err(|_| StructureError::HeaderParseFailed) - }) - .transpose()?; - Ok(Self { - x_has_more, - x_page, - x_page_count, - x_per_page, - x_total, - }) + Ok(Self { x_total_count }) } } pub struct OAuth2ApplicationListHeaders { - pub x_has_more: Option, - pub x_page: Option, - pub x_page_count: Option, - pub x_per_page: Option, - pub x_total: Option, + pub x_total_count: Option, } impl TryFrom<&reqwest::header::HeaderMap> for OAuth2ApplicationListHeaders { type Error = StructureError; fn try_from(map: &reqwest::header::HeaderMap) -> Result { - let x_has_more = map - .get("X-HasMore") - .map(|s| -> Result<_, _> { - let s = s.to_str().map_err(|_| StructureError::HeaderNotAscii)?; - s.parse::() - .map_err(|_| StructureError::HeaderParseFailed) - }) - .transpose()?; - let x_page = map - .get("X-Page") + let x_total_count = map + .get("x-total-count") .map(|s| -> Result<_, _> { let s = s.to_str().map_err(|_| StructureError::HeaderNotAscii)?; s.parse::() .map_err(|_| StructureError::HeaderParseFailed) }) .transpose()?; - let x_page_count = map - .get("X-PageCount") - .map(|s| -> Result<_, _> { - let s = s.to_str().map_err(|_| StructureError::HeaderNotAscii)?; - s.parse::() - .map_err(|_| StructureError::HeaderParseFailed) - }) - .transpose()?; - let x_per_page = map - .get("X-PerPage") - .map(|s| -> Result<_, _> { - let s = s.to_str().map_err(|_| StructureError::HeaderNotAscii)?; - s.parse::() - .map_err(|_| StructureError::HeaderParseFailed) - }) - .transpose()?; - let x_total = map - .get("X-Total") - .map(|s| -> Result<_, _> { - let s = s.to_str().map_err(|_| StructureError::HeaderNotAscii)?; - s.parse::() - .map_err(|_| StructureError::HeaderParseFailed) - }) - .transpose()?; - Ok(Self { - x_has_more, - x_page, - x_page_count, - x_per_page, - x_total, - }) + Ok(Self { x_total_count }) } } pub struct OrganizationListHeaders { - pub x_has_more: Option, - pub x_page: Option, - pub x_page_count: Option, - pub x_per_page: Option, - pub x_total: Option, + pub x_total_count: Option, } impl TryFrom<&reqwest::header::HeaderMap> for OrganizationListHeaders { type Error = StructureError; fn try_from(map: &reqwest::header::HeaderMap) -> Result { - let x_has_more = map - .get("X-HasMore") - .map(|s| -> Result<_, _> { - let s = s.to_str().map_err(|_| StructureError::HeaderNotAscii)?; - s.parse::() - .map_err(|_| StructureError::HeaderParseFailed) - }) - .transpose()?; - let x_page = map - .get("X-Page") + let x_total_count = map + .get("x-total-count") .map(|s| -> Result<_, _> { let s = s.to_str().map_err(|_| StructureError::HeaderNotAscii)?; s.parse::() .map_err(|_| StructureError::HeaderParseFailed) }) .transpose()?; - let x_page_count = map - .get("X-PageCount") - .map(|s| -> Result<_, _> { - let s = s.to_str().map_err(|_| StructureError::HeaderNotAscii)?; - s.parse::() - .map_err(|_| StructureError::HeaderParseFailed) - }) - .transpose()?; - let x_per_page = map - .get("X-PerPage") - .map(|s| -> Result<_, _> { - let s = s.to_str().map_err(|_| StructureError::HeaderNotAscii)?; - s.parse::() - .map_err(|_| StructureError::HeaderParseFailed) - }) - .transpose()?; - let x_total = map - .get("X-Total") - .map(|s| -> Result<_, _> { - let s = s.to_str().map_err(|_| StructureError::HeaderNotAscii)?; - s.parse::() - .map_err(|_| StructureError::HeaderParseFailed) - }) - .transpose()?; - Ok(Self { - x_has_more, - x_page, - x_page_count, - x_per_page, - x_total, - }) + Ok(Self { x_total_count }) } } pub struct PackageFileListHeaders { - pub x_has_more: Option, - pub x_page: Option, - pub x_page_count: Option, - pub x_per_page: Option, - pub x_total: Option, + pub x_total_count: Option, } impl TryFrom<&reqwest::header::HeaderMap> for PackageFileListHeaders { type Error = StructureError; fn try_from(map: &reqwest::header::HeaderMap) -> Result { - let x_has_more = map - .get("X-HasMore") - .map(|s| -> Result<_, _> { - let s = s.to_str().map_err(|_| StructureError::HeaderNotAscii)?; - s.parse::() - .map_err(|_| StructureError::HeaderParseFailed) - }) - .transpose()?; - let x_page = map - .get("X-Page") + let x_total_count = map + .get("x-total-count") .map(|s| -> Result<_, _> { let s = s.to_str().map_err(|_| StructureError::HeaderNotAscii)?; s.parse::() .map_err(|_| StructureError::HeaderParseFailed) }) .transpose()?; - let x_page_count = map - .get("X-PageCount") - .map(|s| -> Result<_, _> { - let s = s.to_str().map_err(|_| StructureError::HeaderNotAscii)?; - s.parse::() - .map_err(|_| StructureError::HeaderParseFailed) - }) - .transpose()?; - let x_per_page = map - .get("X-PerPage") - .map(|s| -> Result<_, _> { - let s = s.to_str().map_err(|_| StructureError::HeaderNotAscii)?; - s.parse::() - .map_err(|_| StructureError::HeaderParseFailed) - }) - .transpose()?; - let x_total = map - .get("X-Total") - .map(|s| -> Result<_, _> { - let s = s.to_str().map_err(|_| StructureError::HeaderNotAscii)?; - s.parse::() - .map_err(|_| StructureError::HeaderParseFailed) - }) - .transpose()?; - Ok(Self { - x_has_more, - x_page, - x_page_count, - x_per_page, - x_total, - }) + Ok(Self { x_total_count }) } } pub struct PackageListHeaders { - pub x_has_more: Option, - pub x_page: Option, - pub x_page_count: Option, - pub x_per_page: Option, - pub x_total: Option, + pub x_total_count: Option, } impl TryFrom<&reqwest::header::HeaderMap> for PackageListHeaders { type Error = StructureError; fn try_from(map: &reqwest::header::HeaderMap) -> Result { - let x_has_more = map - .get("X-HasMore") - .map(|s| -> Result<_, _> { - let s = s.to_str().map_err(|_| StructureError::HeaderNotAscii)?; - s.parse::() - .map_err(|_| StructureError::HeaderParseFailed) - }) - .transpose()?; - let x_page = map - .get("X-Page") + let x_total_count = map + .get("x-total-count") .map(|s| -> Result<_, _> { let s = s.to_str().map_err(|_| StructureError::HeaderNotAscii)?; s.parse::() .map_err(|_| StructureError::HeaderParseFailed) }) .transpose()?; - let x_page_count = map - .get("X-PageCount") - .map(|s| -> Result<_, _> { - let s = s.to_str().map_err(|_| StructureError::HeaderNotAscii)?; - s.parse::() - .map_err(|_| StructureError::HeaderParseFailed) - }) - .transpose()?; - let x_per_page = map - .get("X-PerPage") - .map(|s| -> Result<_, _> { - let s = s.to_str().map_err(|_| StructureError::HeaderNotAscii)?; - s.parse::() - .map_err(|_| StructureError::HeaderParseFailed) - }) - .transpose()?; - let x_total = map - .get("X-Total") - .map(|s| -> Result<_, _> { - let s = s.to_str().map_err(|_| StructureError::HeaderNotAscii)?; - s.parse::() - .map_err(|_| StructureError::HeaderParseFailed) - }) - .transpose()?; - Ok(Self { - x_has_more, - x_page, - x_page_count, - x_per_page, - x_total, - }) + Ok(Self { x_total_count }) } } pub struct PublicKeyListHeaders { - pub x_has_more: Option, - pub x_page: Option, - pub x_page_count: Option, - pub x_per_page: Option, - pub x_total: Option, + pub x_total_count: Option, } impl TryFrom<&reqwest::header::HeaderMap> for PublicKeyListHeaders { type Error = StructureError; fn try_from(map: &reqwest::header::HeaderMap) -> Result { - let x_has_more = map - .get("X-HasMore") - .map(|s| -> Result<_, _> { - let s = s.to_str().map_err(|_| StructureError::HeaderNotAscii)?; - s.parse::() - .map_err(|_| StructureError::HeaderParseFailed) - }) - .transpose()?; - let x_page = map - .get("X-Page") + let x_total_count = map + .get("x-total-count") .map(|s| -> Result<_, _> { let s = s.to_str().map_err(|_| StructureError::HeaderNotAscii)?; s.parse::() .map_err(|_| StructureError::HeaderParseFailed) }) .transpose()?; - let x_page_count = map - .get("X-PageCount") - .map(|s| -> Result<_, _> { - let s = s.to_str().map_err(|_| StructureError::HeaderNotAscii)?; - s.parse::() - .map_err(|_| StructureError::HeaderParseFailed) - }) - .transpose()?; - let x_per_page = map - .get("X-PerPage") - .map(|s| -> Result<_, _> { - let s = s.to_str().map_err(|_| StructureError::HeaderNotAscii)?; - s.parse::() - .map_err(|_| StructureError::HeaderParseFailed) - }) - .transpose()?; - let x_total = map - .get("X-Total") - .map(|s| -> Result<_, _> { - let s = s.to_str().map_err(|_| StructureError::HeaderNotAscii)?; - s.parse::() - .map_err(|_| StructureError::HeaderParseFailed) - }) - .transpose()?; - Ok(Self { - x_has_more, - x_page, - x_page_count, - x_per_page, - x_total, - }) + Ok(Self { x_total_count }) } } pub struct PullRequestListHeaders { - pub x_has_more: Option, - pub x_page: Option, - pub x_page_count: Option, - pub x_per_page: Option, - pub x_total: Option, + pub x_total_count: Option, } impl TryFrom<&reqwest::header::HeaderMap> for PullRequestListHeaders { type Error = StructureError; fn try_from(map: &reqwest::header::HeaderMap) -> Result { - let x_has_more = map - .get("X-HasMore") - .map(|s| -> Result<_, _> { - let s = s.to_str().map_err(|_| StructureError::HeaderNotAscii)?; - s.parse::() - .map_err(|_| StructureError::HeaderParseFailed) - }) - .transpose()?; - let x_page = map - .get("X-Page") + let x_total_count = map + .get("x-total-count") .map(|s| -> Result<_, _> { let s = s.to_str().map_err(|_| StructureError::HeaderNotAscii)?; s.parse::() .map_err(|_| StructureError::HeaderParseFailed) }) .transpose()?; - let x_page_count = map - .get("X-PageCount") - .map(|s| -> Result<_, _> { - let s = s.to_str().map_err(|_| StructureError::HeaderNotAscii)?; - s.parse::() - .map_err(|_| StructureError::HeaderParseFailed) - }) - .transpose()?; - let x_per_page = map - .get("X-PerPage") - .map(|s| -> Result<_, _> { - let s = s.to_str().map_err(|_| StructureError::HeaderNotAscii)?; - s.parse::() - .map_err(|_| StructureError::HeaderParseFailed) - }) - .transpose()?; - let x_total = map - .get("X-Total") - .map(|s| -> Result<_, _> { - let s = s.to_str().map_err(|_| StructureError::HeaderNotAscii)?; - s.parse::() - .map_err(|_| StructureError::HeaderParseFailed) - }) - .transpose()?; - Ok(Self { - x_has_more, - x_page, - x_page_count, - x_per_page, - x_total, - }) - } -} - -pub struct PullReviewCommentListHeaders { - pub x_has_more: Option, - pub x_page: Option, - pub x_page_count: Option, - pub x_per_page: Option, - pub x_total: Option, -} - -impl TryFrom<&reqwest::header::HeaderMap> for PullReviewCommentListHeaders { - type Error = StructureError; - - fn try_from(map: &reqwest::header::HeaderMap) -> Result { - let x_has_more = map - .get("X-HasMore") - .map(|s| -> Result<_, _> { - let s = s.to_str().map_err(|_| StructureError::HeaderNotAscii)?; - s.parse::() - .map_err(|_| StructureError::HeaderParseFailed) - }) - .transpose()?; - let x_page = map - .get("X-Page") - .map(|s| -> Result<_, _> { - let s = s.to_str().map_err(|_| StructureError::HeaderNotAscii)?; - s.parse::() - .map_err(|_| StructureError::HeaderParseFailed) - }) - .transpose()?; - let x_page_count = map - .get("X-PageCount") - .map(|s| -> Result<_, _> { - let s = s.to_str().map_err(|_| StructureError::HeaderNotAscii)?; - s.parse::() - .map_err(|_| StructureError::HeaderParseFailed) - }) - .transpose()?; - let x_per_page = map - .get("X-PerPage") - .map(|s| -> Result<_, _> { - let s = s.to_str().map_err(|_| StructureError::HeaderNotAscii)?; - s.parse::() - .map_err(|_| StructureError::HeaderParseFailed) - }) - .transpose()?; - let x_total = map - .get("X-Total") - .map(|s| -> Result<_, _> { - let s = s.to_str().map_err(|_| StructureError::HeaderNotAscii)?; - s.parse::() - .map_err(|_| StructureError::HeaderParseFailed) - }) - .transpose()?; - Ok(Self { - x_has_more, - x_page, - x_page_count, - x_per_page, - x_total, - }) + Ok(Self { x_total_count }) } } pub struct PullReviewListHeaders { - pub x_has_more: Option, - pub x_page: Option, - pub x_page_count: Option, - pub x_per_page: Option, - pub x_total: Option, + pub x_total_count: Option, } impl TryFrom<&reqwest::header::HeaderMap> for PullReviewListHeaders { type Error = StructureError; fn try_from(map: &reqwest::header::HeaderMap) -> Result { - let x_has_more = map - .get("X-HasMore") - .map(|s| -> Result<_, _> { - let s = s.to_str().map_err(|_| StructureError::HeaderNotAscii)?; - s.parse::() - .map_err(|_| StructureError::HeaderParseFailed) - }) - .transpose()?; - let x_page = map - .get("X-Page") + let x_total_count = map + .get("x-total-count") .map(|s| -> Result<_, _> { let s = s.to_str().map_err(|_| StructureError::HeaderNotAscii)?; s.parse::() .map_err(|_| StructureError::HeaderParseFailed) }) .transpose()?; - let x_page_count = map - .get("X-PageCount") - .map(|s| -> Result<_, _> { - let s = s.to_str().map_err(|_| StructureError::HeaderNotAscii)?; - s.parse::() - .map_err(|_| StructureError::HeaderParseFailed) - }) - .transpose()?; - let x_per_page = map - .get("X-PerPage") - .map(|s| -> Result<_, _> { - let s = s.to_str().map_err(|_| StructureError::HeaderNotAscii)?; - s.parse::() - .map_err(|_| StructureError::HeaderParseFailed) - }) - .transpose()?; - let x_total = map - .get("X-Total") - .map(|s| -> Result<_, _> { - let s = s.to_str().map_err(|_| StructureError::HeaderNotAscii)?; - s.parse::() - .map_err(|_| StructureError::HeaderParseFailed) - }) - .transpose()?; - Ok(Self { - x_has_more, - x_page, - x_page_count, - x_per_page, - x_total, - }) + Ok(Self { x_total_count }) } } pub struct PushMirrorListHeaders { - pub x_has_more: Option, - pub x_page: Option, - pub x_page_count: Option, - pub x_per_page: Option, - pub x_total: Option, + pub x_total_count: Option, } impl TryFrom<&reqwest::header::HeaderMap> for PushMirrorListHeaders { type Error = StructureError; fn try_from(map: &reqwest::header::HeaderMap) -> Result { - let x_has_more = map - .get("X-HasMore") - .map(|s| -> Result<_, _> { - let s = s.to_str().map_err(|_| StructureError::HeaderNotAscii)?; - s.parse::() - .map_err(|_| StructureError::HeaderParseFailed) - }) - .transpose()?; - let x_page = map - .get("X-Page") + let x_total_count = map + .get("x-total-count") .map(|s| -> Result<_, _> { let s = s.to_str().map_err(|_| StructureError::HeaderNotAscii)?; s.parse::() .map_err(|_| StructureError::HeaderParseFailed) }) .transpose()?; - let x_page_count = map - .get("X-PageCount") - .map(|s| -> Result<_, _> { - let s = s.to_str().map_err(|_| StructureError::HeaderNotAscii)?; - s.parse::() - .map_err(|_| StructureError::HeaderParseFailed) - }) - .transpose()?; - let x_per_page = map - .get("X-PerPage") - .map(|s| -> Result<_, _> { - let s = s.to_str().map_err(|_| StructureError::HeaderNotAscii)?; - s.parse::() - .map_err(|_| StructureError::HeaderParseFailed) - }) - .transpose()?; - let x_total = map - .get("X-Total") - .map(|s| -> Result<_, _> { - let s = s.to_str().map_err(|_| StructureError::HeaderNotAscii)?; - s.parse::() - .map_err(|_| StructureError::HeaderParseFailed) - }) - .transpose()?; - Ok(Self { - x_has_more, - x_page, - x_page_count, - x_per_page, - x_total, - }) + Ok(Self { x_total_count }) } } pub struct QuotaGroupListHeaders { - pub x_has_more: Option, - pub x_page: Option, - pub x_page_count: Option, - pub x_per_page: Option, - pub x_total: Option, + pub x_total_count: Option, } impl TryFrom<&reqwest::header::HeaderMap> for QuotaGroupListHeaders { type Error = StructureError; fn try_from(map: &reqwest::header::HeaderMap) -> Result { - let x_has_more = map - .get("X-HasMore") - .map(|s| -> Result<_, _> { - let s = s.to_str().map_err(|_| StructureError::HeaderNotAscii)?; - s.parse::() - .map_err(|_| StructureError::HeaderParseFailed) - }) - .transpose()?; - let x_page = map - .get("X-Page") + let x_total_count = map + .get("x-total-count") .map(|s| -> Result<_, _> { let s = s.to_str().map_err(|_| StructureError::HeaderNotAscii)?; s.parse::() .map_err(|_| StructureError::HeaderParseFailed) }) .transpose()?; - let x_page_count = map - .get("X-PageCount") - .map(|s| -> Result<_, _> { - let s = s.to_str().map_err(|_| StructureError::HeaderNotAscii)?; - s.parse::() - .map_err(|_| StructureError::HeaderParseFailed) - }) - .transpose()?; - let x_per_page = map - .get("X-PerPage") - .map(|s| -> Result<_, _> { - let s = s.to_str().map_err(|_| StructureError::HeaderNotAscii)?; - s.parse::() - .map_err(|_| StructureError::HeaderParseFailed) - }) - .transpose()?; - let x_total = map - .get("X-Total") - .map(|s| -> Result<_, _> { - let s = s.to_str().map_err(|_| StructureError::HeaderNotAscii)?; - s.parse::() - .map_err(|_| StructureError::HeaderParseFailed) - }) - .transpose()?; - Ok(Self { - x_has_more, - x_page, - x_page_count, - x_per_page, - x_total, - }) + Ok(Self { x_total_count }) } } pub struct QuotaRuleInfoListHeaders { - pub x_has_more: Option, - pub x_page: Option, - pub x_page_count: Option, - pub x_per_page: Option, - pub x_total: Option, + pub x_total_count: Option, } impl TryFrom<&reqwest::header::HeaderMap> for QuotaRuleInfoListHeaders { type Error = StructureError; fn try_from(map: &reqwest::header::HeaderMap) -> Result { - let x_has_more = map - .get("X-HasMore") - .map(|s| -> Result<_, _> { - let s = s.to_str().map_err(|_| StructureError::HeaderNotAscii)?; - s.parse::() - .map_err(|_| StructureError::HeaderParseFailed) - }) - .transpose()?; - let x_page = map - .get("X-Page") + let x_total_count = map + .get("x-total-count") .map(|s| -> Result<_, _> { let s = s.to_str().map_err(|_| StructureError::HeaderNotAscii)?; s.parse::() .map_err(|_| StructureError::HeaderParseFailed) }) .transpose()?; - let x_page_count = map - .get("X-PageCount") - .map(|s| -> Result<_, _> { - let s = s.to_str().map_err(|_| StructureError::HeaderNotAscii)?; - s.parse::() - .map_err(|_| StructureError::HeaderParseFailed) - }) - .transpose()?; - let x_per_page = map - .get("X-PerPage") - .map(|s| -> Result<_, _> { - let s = s.to_str().map_err(|_| StructureError::HeaderNotAscii)?; - s.parse::() - .map_err(|_| StructureError::HeaderParseFailed) - }) - .transpose()?; - let x_total = map - .get("X-Total") - .map(|s| -> Result<_, _> { - let s = s.to_str().map_err(|_| StructureError::HeaderNotAscii)?; - s.parse::() - .map_err(|_| StructureError::HeaderParseFailed) - }) - .transpose()?; - Ok(Self { - x_has_more, - x_page, - x_page_count, - x_per_page, - x_total, - }) + Ok(Self { x_total_count }) } } pub struct QuotaUsedArtifactListHeaders { - pub x_has_more: Option, - pub x_page: Option, - pub x_page_count: Option, - pub x_per_page: Option, - pub x_total: Option, + pub x_total_count: Option, } impl TryFrom<&reqwest::header::HeaderMap> for QuotaUsedArtifactListHeaders { type Error = StructureError; fn try_from(map: &reqwest::header::HeaderMap) -> Result { - let x_has_more = map - .get("X-HasMore") - .map(|s| -> Result<_, _> { - let s = s.to_str().map_err(|_| StructureError::HeaderNotAscii)?; - s.parse::() - .map_err(|_| StructureError::HeaderParseFailed) - }) - .transpose()?; - let x_page = map - .get("X-Page") + let x_total_count = map + .get("x-total-count") .map(|s| -> Result<_, _> { let s = s.to_str().map_err(|_| StructureError::HeaderNotAscii)?; s.parse::() .map_err(|_| StructureError::HeaderParseFailed) }) .transpose()?; - let x_page_count = map - .get("X-PageCount") - .map(|s| -> Result<_, _> { - let s = s.to_str().map_err(|_| StructureError::HeaderNotAscii)?; - s.parse::() - .map_err(|_| StructureError::HeaderParseFailed) - }) - .transpose()?; - let x_per_page = map - .get("X-PerPage") - .map(|s| -> Result<_, _> { - let s = s.to_str().map_err(|_| StructureError::HeaderNotAscii)?; - s.parse::() - .map_err(|_| StructureError::HeaderParseFailed) - }) - .transpose()?; - let x_total = map - .get("X-Total") - .map(|s| -> Result<_, _> { - let s = s.to_str().map_err(|_| StructureError::HeaderNotAscii)?; - s.parse::() - .map_err(|_| StructureError::HeaderParseFailed) - }) - .transpose()?; - Ok(Self { - x_has_more, - x_page, - x_page_count, - x_per_page, - x_total, - }) + Ok(Self { x_total_count }) } } pub struct QuotaUsedAttachmentListHeaders { - pub x_has_more: Option, - pub x_page: Option, - pub x_page_count: Option, - pub x_per_page: Option, - pub x_total: Option, + pub x_total_count: Option, } impl TryFrom<&reqwest::header::HeaderMap> for QuotaUsedAttachmentListHeaders { type Error = StructureError; fn try_from(map: &reqwest::header::HeaderMap) -> Result { - let x_has_more = map - .get("X-HasMore") - .map(|s| -> Result<_, _> { - let s = s.to_str().map_err(|_| StructureError::HeaderNotAscii)?; - s.parse::() - .map_err(|_| StructureError::HeaderParseFailed) - }) - .transpose()?; - let x_page = map - .get("X-Page") + let x_total_count = map + .get("x-total-count") .map(|s| -> Result<_, _> { let s = s.to_str().map_err(|_| StructureError::HeaderNotAscii)?; s.parse::() .map_err(|_| StructureError::HeaderParseFailed) }) .transpose()?; - let x_page_count = map - .get("X-PageCount") - .map(|s| -> Result<_, _> { - let s = s.to_str().map_err(|_| StructureError::HeaderNotAscii)?; - s.parse::() - .map_err(|_| StructureError::HeaderParseFailed) - }) - .transpose()?; - let x_per_page = map - .get("X-PerPage") - .map(|s| -> Result<_, _> { - let s = s.to_str().map_err(|_| StructureError::HeaderNotAscii)?; - s.parse::() - .map_err(|_| StructureError::HeaderParseFailed) - }) - .transpose()?; - let x_total = map - .get("X-Total") - .map(|s| -> Result<_, _> { - let s = s.to_str().map_err(|_| StructureError::HeaderNotAscii)?; - s.parse::() - .map_err(|_| StructureError::HeaderParseFailed) - }) - .transpose()?; - Ok(Self { - x_has_more, - x_page, - x_page_count, - x_per_page, - x_total, - }) + Ok(Self { x_total_count }) } } pub struct QuotaUsedPackageListHeaders { - pub x_has_more: Option, - pub x_page: Option, - pub x_page_count: Option, - pub x_per_page: Option, - pub x_total: Option, + pub x_total_count: Option, } impl TryFrom<&reqwest::header::HeaderMap> for QuotaUsedPackageListHeaders { type Error = StructureError; fn try_from(map: &reqwest::header::HeaderMap) -> Result { - let x_has_more = map - .get("X-HasMore") - .map(|s| -> Result<_, _> { - let s = s.to_str().map_err(|_| StructureError::HeaderNotAscii)?; - s.parse::() - .map_err(|_| StructureError::HeaderParseFailed) - }) - .transpose()?; - let x_page = map - .get("X-Page") + let x_total_count = map + .get("x-total-count") .map(|s| -> Result<_, _> { let s = s.to_str().map_err(|_| StructureError::HeaderNotAscii)?; s.parse::() .map_err(|_| StructureError::HeaderParseFailed) }) .transpose()?; - let x_page_count = map - .get("X-PageCount") - .map(|s| -> Result<_, _> { - let s = s.to_str().map_err(|_| StructureError::HeaderNotAscii)?; - s.parse::() - .map_err(|_| StructureError::HeaderParseFailed) - }) - .transpose()?; - let x_per_page = map - .get("X-PerPage") - .map(|s| -> Result<_, _> { - let s = s.to_str().map_err(|_| StructureError::HeaderNotAscii)?; - s.parse::() - .map_err(|_| StructureError::HeaderParseFailed) - }) - .transpose()?; - let x_total = map - .get("X-Total") - .map(|s| -> Result<_, _> { - let s = s.to_str().map_err(|_| StructureError::HeaderNotAscii)?; - s.parse::() - .map_err(|_| StructureError::HeaderParseFailed) - }) - .transpose()?; - Ok(Self { - x_has_more, - x_page, - x_page_count, - x_per_page, - x_total, - }) + Ok(Self { x_total_count }) } } pub struct ReactionListHeaders { - pub x_has_more: Option, - pub x_page: Option, - pub x_page_count: Option, - pub x_per_page: Option, - pub x_total: Option, + pub x_total_count: Option, } impl TryFrom<&reqwest::header::HeaderMap> for ReactionListHeaders { type Error = StructureError; fn try_from(map: &reqwest::header::HeaderMap) -> Result { - let x_has_more = map - .get("X-HasMore") - .map(|s| -> Result<_, _> { - let s = s.to_str().map_err(|_| StructureError::HeaderNotAscii)?; - s.parse::() - .map_err(|_| StructureError::HeaderParseFailed) - }) - .transpose()?; - let x_page = map - .get("X-Page") + let x_total_count = map + .get("x-total-count") .map(|s| -> Result<_, _> { let s = s.to_str().map_err(|_| StructureError::HeaderNotAscii)?; s.parse::() .map_err(|_| StructureError::HeaderParseFailed) }) .transpose()?; - let x_page_count = map - .get("X-PageCount") - .map(|s| -> Result<_, _> { - let s = s.to_str().map_err(|_| StructureError::HeaderNotAscii)?; - s.parse::() - .map_err(|_| StructureError::HeaderParseFailed) - }) - .transpose()?; - let x_per_page = map - .get("X-PerPage") - .map(|s| -> Result<_, _> { - let s = s.to_str().map_err(|_| StructureError::HeaderNotAscii)?; - s.parse::() - .map_err(|_| StructureError::HeaderParseFailed) - }) - .transpose()?; - let x_total = map - .get("X-Total") - .map(|s| -> Result<_, _> { - let s = s.to_str().map_err(|_| StructureError::HeaderNotAscii)?; - s.parse::() - .map_err(|_| StructureError::HeaderParseFailed) - }) - .transpose()?; - Ok(Self { - x_has_more, - x_page, - x_page_count, - x_per_page, - x_total, - }) - } -} - -pub struct ReferenceListHeaders { - pub x_has_more: Option, - pub x_page: Option, - pub x_page_count: Option, - pub x_per_page: Option, - pub x_total: Option, -} - -impl TryFrom<&reqwest::header::HeaderMap> for ReferenceListHeaders { - type Error = StructureError; - - fn try_from(map: &reqwest::header::HeaderMap) -> Result { - let x_has_more = map - .get("X-HasMore") - .map(|s| -> Result<_, _> { - let s = s.to_str().map_err(|_| StructureError::HeaderNotAscii)?; - s.parse::() - .map_err(|_| StructureError::HeaderParseFailed) - }) - .transpose()?; - let x_page = map - .get("X-Page") - .map(|s| -> Result<_, _> { - let s = s.to_str().map_err(|_| StructureError::HeaderNotAscii)?; - s.parse::() - .map_err(|_| StructureError::HeaderParseFailed) - }) - .transpose()?; - let x_page_count = map - .get("X-PageCount") - .map(|s| -> Result<_, _> { - let s = s.to_str().map_err(|_| StructureError::HeaderNotAscii)?; - s.parse::() - .map_err(|_| StructureError::HeaderParseFailed) - }) - .transpose()?; - let x_per_page = map - .get("X-PerPage") - .map(|s| -> Result<_, _> { - let s = s.to_str().map_err(|_| StructureError::HeaderNotAscii)?; - s.parse::() - .map_err(|_| StructureError::HeaderParseFailed) - }) - .transpose()?; - let x_total = map - .get("X-Total") - .map(|s| -> Result<_, _> { - let s = s.to_str().map_err(|_| StructureError::HeaderNotAscii)?; - s.parse::() - .map_err(|_| StructureError::HeaderParseFailed) - }) - .transpose()?; - Ok(Self { - x_has_more, - x_page, - x_page_count, - x_per_page, - x_total, - }) + Ok(Self { x_total_count }) } } @@ -5590,870 +3816,242 @@ impl TryFrom<&reqwest::header::HeaderMap> for RegistrationTokenHeaders { } pub struct ReleaseListHeaders { - pub x_has_more: Option, - pub x_page: Option, - pub x_page_count: Option, - pub x_per_page: Option, - pub x_total: Option, + pub x_total_count: Option, } impl TryFrom<&reqwest::header::HeaderMap> for ReleaseListHeaders { type Error = StructureError; fn try_from(map: &reqwest::header::HeaderMap) -> Result { - let x_has_more = map - .get("X-HasMore") - .map(|s| -> Result<_, _> { - let s = s.to_str().map_err(|_| StructureError::HeaderNotAscii)?; - s.parse::() - .map_err(|_| StructureError::HeaderParseFailed) - }) - .transpose()?; - let x_page = map - .get("X-Page") + let x_total_count = map + .get("x-total-count") .map(|s| -> Result<_, _> { let s = s.to_str().map_err(|_| StructureError::HeaderNotAscii)?; s.parse::() .map_err(|_| StructureError::HeaderParseFailed) }) .transpose()?; - let x_page_count = map - .get("X-PageCount") - .map(|s| -> Result<_, _> { - let s = s.to_str().map_err(|_| StructureError::HeaderNotAscii)?; - s.parse::() - .map_err(|_| StructureError::HeaderParseFailed) - }) - .transpose()?; - let x_per_page = map - .get("X-PerPage") - .map(|s| -> Result<_, _> { - let s = s.to_str().map_err(|_| StructureError::HeaderNotAscii)?; - s.parse::() - .map_err(|_| StructureError::HeaderParseFailed) - }) - .transpose()?; - let x_total = map - .get("X-Total") - .map(|s| -> Result<_, _> { - let s = s.to_str().map_err(|_| StructureError::HeaderNotAscii)?; - s.parse::() - .map_err(|_| StructureError::HeaderParseFailed) - }) - .transpose()?; - Ok(Self { - x_has_more, - x_page, - x_page_count, - x_per_page, - x_total, - }) + Ok(Self { x_total_count }) } } pub struct RepositoryListHeaders { - pub x_has_more: Option, - pub x_page: Option, - pub x_page_count: Option, - pub x_per_page: Option, - pub x_total: Option, + pub x_total_count: Option, } impl TryFrom<&reqwest::header::HeaderMap> for RepositoryListHeaders { type Error = StructureError; fn try_from(map: &reqwest::header::HeaderMap) -> Result { - let x_has_more = map - .get("X-HasMore") - .map(|s| -> Result<_, _> { - let s = s.to_str().map_err(|_| StructureError::HeaderNotAscii)?; - s.parse::() - .map_err(|_| StructureError::HeaderParseFailed) - }) - .transpose()?; - let x_page = map - .get("X-Page") + let x_total_count = map + .get("x-total-count") .map(|s| -> Result<_, _> { let s = s.to_str().map_err(|_| StructureError::HeaderNotAscii)?; s.parse::() .map_err(|_| StructureError::HeaderParseFailed) }) .transpose()?; - let x_page_count = map - .get("X-PageCount") - .map(|s| -> Result<_, _> { - let s = s.to_str().map_err(|_| StructureError::HeaderNotAscii)?; - s.parse::() - .map_err(|_| StructureError::HeaderParseFailed) - }) - .transpose()?; - let x_per_page = map - .get("X-PerPage") - .map(|s| -> Result<_, _> { - let s = s.to_str().map_err(|_| StructureError::HeaderNotAscii)?; - s.parse::() - .map_err(|_| StructureError::HeaderParseFailed) - }) - .transpose()?; - let x_total = map - .get("X-Total") - .map(|s| -> Result<_, _> { - let s = s.to_str().map_err(|_| StructureError::HeaderNotAscii)?; - s.parse::() - .map_err(|_| StructureError::HeaderParseFailed) - }) - .transpose()?; - Ok(Self { - x_has_more, - x_page, - x_page_count, - x_per_page, - x_total, - }) + Ok(Self { x_total_count }) } } pub struct SecretListHeaders { - pub x_has_more: Option, - pub x_page: Option, - pub x_page_count: Option, - pub x_per_page: Option, - pub x_total: Option, + pub x_total_count: Option, } impl TryFrom<&reqwest::header::HeaderMap> for SecretListHeaders { type Error = StructureError; fn try_from(map: &reqwest::header::HeaderMap) -> Result { - let x_has_more = map - .get("X-HasMore") - .map(|s| -> Result<_, _> { - let s = s.to_str().map_err(|_| StructureError::HeaderNotAscii)?; - s.parse::() - .map_err(|_| StructureError::HeaderParseFailed) - }) - .transpose()?; - let x_page = map - .get("X-Page") + let x_total_count = map + .get("x-total-count") .map(|s| -> Result<_, _> { let s = s.to_str().map_err(|_| StructureError::HeaderNotAscii)?; s.parse::() .map_err(|_| StructureError::HeaderParseFailed) }) .transpose()?; - let x_page_count = map - .get("X-PageCount") - .map(|s| -> Result<_, _> { - let s = s.to_str().map_err(|_| StructureError::HeaderNotAscii)?; - s.parse::() - .map_err(|_| StructureError::HeaderParseFailed) - }) - .transpose()?; - let x_per_page = map - .get("X-PerPage") - .map(|s| -> Result<_, _> { - let s = s.to_str().map_err(|_| StructureError::HeaderNotAscii)?; - s.parse::() - .map_err(|_| StructureError::HeaderParseFailed) - }) - .transpose()?; - let x_total = map - .get("X-Total") - .map(|s| -> Result<_, _> { - let s = s.to_str().map_err(|_| StructureError::HeaderNotAscii)?; - s.parse::() - .map_err(|_| StructureError::HeaderParseFailed) - }) - .transpose()?; - Ok(Self { - x_has_more, - x_page, - x_page_count, - x_per_page, - x_total, - }) + Ok(Self { x_total_count }) } } pub struct StopWatchListHeaders { - pub x_has_more: Option, - pub x_page: Option, - pub x_page_count: Option, - pub x_per_page: Option, - pub x_total: Option, + pub x_total_count: Option, } impl TryFrom<&reqwest::header::HeaderMap> for StopWatchListHeaders { type Error = StructureError; fn try_from(map: &reqwest::header::HeaderMap) -> Result { - let x_has_more = map - .get("X-HasMore") - .map(|s| -> Result<_, _> { - let s = s.to_str().map_err(|_| StructureError::HeaderNotAscii)?; - s.parse::() - .map_err(|_| StructureError::HeaderParseFailed) - }) - .transpose()?; - let x_page = map - .get("X-Page") + let x_total_count = map + .get("x-total-count") .map(|s| -> Result<_, _> { let s = s.to_str().map_err(|_| StructureError::HeaderNotAscii)?; s.parse::() .map_err(|_| StructureError::HeaderParseFailed) }) .transpose()?; - let x_page_count = map - .get("X-PageCount") - .map(|s| -> Result<_, _> { - let s = s.to_str().map_err(|_| StructureError::HeaderNotAscii)?; - s.parse::() - .map_err(|_| StructureError::HeaderParseFailed) - }) - .transpose()?; - let x_per_page = map - .get("X-PerPage") - .map(|s| -> Result<_, _> { - let s = s.to_str().map_err(|_| StructureError::HeaderNotAscii)?; - s.parse::() - .map_err(|_| StructureError::HeaderParseFailed) - }) - .transpose()?; - let x_total = map - .get("X-Total") - .map(|s| -> Result<_, _> { - let s = s.to_str().map_err(|_| StructureError::HeaderNotAscii)?; - s.parse::() - .map_err(|_| StructureError::HeaderParseFailed) - }) - .transpose()?; - Ok(Self { - x_has_more, - x_page, - x_page_count, - x_per_page, - x_total, - }) + Ok(Self { x_total_count }) } } pub struct TagListHeaders { - pub x_has_more: Option, - pub x_page: Option, - pub x_page_count: Option, - pub x_per_page: Option, - pub x_total: Option, + pub x_total_count: Option, } impl TryFrom<&reqwest::header::HeaderMap> for TagListHeaders { type Error = StructureError; fn try_from(map: &reqwest::header::HeaderMap) -> Result { - let x_has_more = map - .get("X-HasMore") - .map(|s| -> Result<_, _> { - let s = s.to_str().map_err(|_| StructureError::HeaderNotAscii)?; - s.parse::() - .map_err(|_| StructureError::HeaderParseFailed) - }) - .transpose()?; - let x_page = map - .get("X-Page") + let x_total_count = map + .get("x-total-count") .map(|s| -> Result<_, _> { let s = s.to_str().map_err(|_| StructureError::HeaderNotAscii)?; s.parse::() .map_err(|_| StructureError::HeaderParseFailed) }) .transpose()?; - let x_page_count = map - .get("X-PageCount") - .map(|s| -> Result<_, _> { - let s = s.to_str().map_err(|_| StructureError::HeaderNotAscii)?; - s.parse::() - .map_err(|_| StructureError::HeaderParseFailed) - }) - .transpose()?; - let x_per_page = map - .get("X-PerPage") - .map(|s| -> Result<_, _> { - let s = s.to_str().map_err(|_| StructureError::HeaderNotAscii)?; - s.parse::() - .map_err(|_| StructureError::HeaderParseFailed) - }) - .transpose()?; - let x_total = map - .get("X-Total") - .map(|s| -> Result<_, _> { - let s = s.to_str().map_err(|_| StructureError::HeaderNotAscii)?; - s.parse::() - .map_err(|_| StructureError::HeaderParseFailed) - }) - .transpose()?; - Ok(Self { - x_has_more, - x_page, - x_page_count, - x_per_page, - x_total, - }) - } -} - -pub struct TagProtectionListHeaders { - pub x_has_more: Option, - pub x_page: Option, - pub x_page_count: Option, - pub x_per_page: Option, - pub x_total: Option, -} - -impl TryFrom<&reqwest::header::HeaderMap> for TagProtectionListHeaders { - type Error = StructureError; - - fn try_from(map: &reqwest::header::HeaderMap) -> Result { - let x_has_more = map - .get("X-HasMore") - .map(|s| -> Result<_, _> { - let s = s.to_str().map_err(|_| StructureError::HeaderNotAscii)?; - s.parse::() - .map_err(|_| StructureError::HeaderParseFailed) - }) - .transpose()?; - let x_page = map - .get("X-Page") - .map(|s| -> Result<_, _> { - let s = s.to_str().map_err(|_| StructureError::HeaderNotAscii)?; - s.parse::() - .map_err(|_| StructureError::HeaderParseFailed) - }) - .transpose()?; - let x_page_count = map - .get("X-PageCount") - .map(|s| -> Result<_, _> { - let s = s.to_str().map_err(|_| StructureError::HeaderNotAscii)?; - s.parse::() - .map_err(|_| StructureError::HeaderParseFailed) - }) - .transpose()?; - let x_per_page = map - .get("X-PerPage") - .map(|s| -> Result<_, _> { - let s = s.to_str().map_err(|_| StructureError::HeaderNotAscii)?; - s.parse::() - .map_err(|_| StructureError::HeaderParseFailed) - }) - .transpose()?; - let x_total = map - .get("X-Total") - .map(|s| -> Result<_, _> { - let s = s.to_str().map_err(|_| StructureError::HeaderNotAscii)?; - s.parse::() - .map_err(|_| StructureError::HeaderParseFailed) - }) - .transpose()?; - Ok(Self { - x_has_more, - x_page, - x_page_count, - x_per_page, - x_total, - }) - } -} - -pub struct TasksListHeaders { - pub x_has_more: Option, - pub x_page: Option, - pub x_page_count: Option, - pub x_per_page: Option, - pub x_total: Option, -} - -impl TryFrom<&reqwest::header::HeaderMap> for TasksListHeaders { - type Error = StructureError; - - fn try_from(map: &reqwest::header::HeaderMap) -> Result { - let x_has_more = map - .get("X-HasMore") - .map(|s| -> Result<_, _> { - let s = s.to_str().map_err(|_| StructureError::HeaderNotAscii)?; - s.parse::() - .map_err(|_| StructureError::HeaderParseFailed) - }) - .transpose()?; - let x_page = map - .get("X-Page") - .map(|s| -> Result<_, _> { - let s = s.to_str().map_err(|_| StructureError::HeaderNotAscii)?; - s.parse::() - .map_err(|_| StructureError::HeaderParseFailed) - }) - .transpose()?; - let x_page_count = map - .get("X-PageCount") - .map(|s| -> Result<_, _> { - let s = s.to_str().map_err(|_| StructureError::HeaderNotAscii)?; - s.parse::() - .map_err(|_| StructureError::HeaderParseFailed) - }) - .transpose()?; - let x_per_page = map - .get("X-PerPage") - .map(|s| -> Result<_, _> { - let s = s.to_str().map_err(|_| StructureError::HeaderNotAscii)?; - s.parse::() - .map_err(|_| StructureError::HeaderParseFailed) - }) - .transpose()?; - let x_total = map - .get("X-Total") - .map(|s| -> Result<_, _> { - let s = s.to_str().map_err(|_| StructureError::HeaderNotAscii)?; - s.parse::() - .map_err(|_| StructureError::HeaderParseFailed) - }) - .transpose()?; - Ok(Self { - x_has_more, - x_page, - x_page_count, - x_per_page, - x_total, - }) + Ok(Self { x_total_count }) } } pub struct TeamListHeaders { - pub x_has_more: Option, - pub x_page: Option, - pub x_page_count: Option, - pub x_per_page: Option, - pub x_total: Option, + pub x_total_count: Option, } impl TryFrom<&reqwest::header::HeaderMap> for TeamListHeaders { type Error = StructureError; fn try_from(map: &reqwest::header::HeaderMap) -> Result { - let x_has_more = map - .get("X-HasMore") - .map(|s| -> Result<_, _> { - let s = s.to_str().map_err(|_| StructureError::HeaderNotAscii)?; - s.parse::() - .map_err(|_| StructureError::HeaderParseFailed) - }) - .transpose()?; - let x_page = map - .get("X-Page") + let x_total_count = map + .get("x-total-count") .map(|s| -> Result<_, _> { let s = s.to_str().map_err(|_| StructureError::HeaderNotAscii)?; s.parse::() .map_err(|_| StructureError::HeaderParseFailed) }) .transpose()?; - let x_page_count = map - .get("X-PageCount") - .map(|s| -> Result<_, _> { - let s = s.to_str().map_err(|_| StructureError::HeaderNotAscii)?; - s.parse::() - .map_err(|_| StructureError::HeaderParseFailed) - }) - .transpose()?; - let x_per_page = map - .get("X-PerPage") - .map(|s| -> Result<_, _> { - let s = s.to_str().map_err(|_| StructureError::HeaderNotAscii)?; - s.parse::() - .map_err(|_| StructureError::HeaderParseFailed) - }) - .transpose()?; - let x_total = map - .get("X-Total") - .map(|s| -> Result<_, _> { - let s = s.to_str().map_err(|_| StructureError::HeaderNotAscii)?; - s.parse::() - .map_err(|_| StructureError::HeaderParseFailed) - }) - .transpose()?; - Ok(Self { - x_has_more, - x_page, - x_page_count, - x_per_page, - x_total, - }) + Ok(Self { x_total_count }) } } pub struct TimelineListHeaders { - pub x_has_more: Option, - pub x_page: Option, - pub x_page_count: Option, - pub x_per_page: Option, - pub x_total: Option, + pub x_total_count: Option, } impl TryFrom<&reqwest::header::HeaderMap> for TimelineListHeaders { type Error = StructureError; fn try_from(map: &reqwest::header::HeaderMap) -> Result { - let x_has_more = map - .get("X-HasMore") - .map(|s| -> Result<_, _> { - let s = s.to_str().map_err(|_| StructureError::HeaderNotAscii)?; - s.parse::() - .map_err(|_| StructureError::HeaderParseFailed) - }) - .transpose()?; - let x_page = map - .get("X-Page") + let x_total_count = map + .get("x-total-count") .map(|s| -> Result<_, _> { let s = s.to_str().map_err(|_| StructureError::HeaderNotAscii)?; s.parse::() .map_err(|_| StructureError::HeaderParseFailed) }) .transpose()?; - let x_page_count = map - .get("X-PageCount") - .map(|s| -> Result<_, _> { - let s = s.to_str().map_err(|_| StructureError::HeaderNotAscii)?; - s.parse::() - .map_err(|_| StructureError::HeaderParseFailed) - }) - .transpose()?; - let x_per_page = map - .get("X-PerPage") - .map(|s| -> Result<_, _> { - let s = s.to_str().map_err(|_| StructureError::HeaderNotAscii)?; - s.parse::() - .map_err(|_| StructureError::HeaderParseFailed) - }) - .transpose()?; - let x_total = map - .get("X-Total") - .map(|s| -> Result<_, _> { - let s = s.to_str().map_err(|_| StructureError::HeaderNotAscii)?; - s.parse::() - .map_err(|_| StructureError::HeaderParseFailed) - }) - .transpose()?; - Ok(Self { - x_has_more, - x_page, - x_page_count, - x_per_page, - x_total, - }) + Ok(Self { x_total_count }) } } pub struct TrackedTimeListHeaders { - pub x_has_more: Option, - pub x_page: Option, - pub x_page_count: Option, - pub x_per_page: Option, - pub x_total: Option, + pub x_total_count: Option, } impl TryFrom<&reqwest::header::HeaderMap> for TrackedTimeListHeaders { type Error = StructureError; fn try_from(map: &reqwest::header::HeaderMap) -> Result { - let x_has_more = map - .get("X-HasMore") - .map(|s| -> Result<_, _> { - let s = s.to_str().map_err(|_| StructureError::HeaderNotAscii)?; - s.parse::() - .map_err(|_| StructureError::HeaderParseFailed) - }) - .transpose()?; - let x_page = map - .get("X-Page") + let x_total_count = map + .get("x-total-count") .map(|s| -> Result<_, _> { let s = s.to_str().map_err(|_| StructureError::HeaderNotAscii)?; s.parse::() .map_err(|_| StructureError::HeaderParseFailed) }) .transpose()?; - let x_page_count = map - .get("X-PageCount") - .map(|s| -> Result<_, _> { - let s = s.to_str().map_err(|_| StructureError::HeaderNotAscii)?; - s.parse::() - .map_err(|_| StructureError::HeaderParseFailed) - }) - .transpose()?; - let x_per_page = map - .get("X-PerPage") - .map(|s| -> Result<_, _> { - let s = s.to_str().map_err(|_| StructureError::HeaderNotAscii)?; - s.parse::() - .map_err(|_| StructureError::HeaderParseFailed) - }) - .transpose()?; - let x_total = map - .get("X-Total") - .map(|s| -> Result<_, _> { - let s = s.to_str().map_err(|_| StructureError::HeaderNotAscii)?; - s.parse::() - .map_err(|_| StructureError::HeaderParseFailed) - }) - .transpose()?; - Ok(Self { - x_has_more, - x_page, - x_page_count, - x_per_page, - x_total, - }) + Ok(Self { x_total_count }) } } pub struct UserListHeaders { - pub x_has_more: Option, - pub x_page: Option, - pub x_page_count: Option, - pub x_per_page: Option, - pub x_total: Option, + pub x_total_count: Option, } impl TryFrom<&reqwest::header::HeaderMap> for UserListHeaders { type Error = StructureError; fn try_from(map: &reqwest::header::HeaderMap) -> Result { - let x_has_more = map - .get("X-HasMore") - .map(|s| -> Result<_, _> { - let s = s.to_str().map_err(|_| StructureError::HeaderNotAscii)?; - s.parse::() - .map_err(|_| StructureError::HeaderParseFailed) - }) - .transpose()?; - let x_page = map - .get("X-Page") + let x_total_count = map + .get("x-total-count") .map(|s| -> Result<_, _> { let s = s.to_str().map_err(|_| StructureError::HeaderNotAscii)?; s.parse::() .map_err(|_| StructureError::HeaderParseFailed) }) .transpose()?; - let x_page_count = map - .get("X-PageCount") - .map(|s| -> Result<_, _> { - let s = s.to_str().map_err(|_| StructureError::HeaderNotAscii)?; - s.parse::() - .map_err(|_| StructureError::HeaderParseFailed) - }) - .transpose()?; - let x_per_page = map - .get("X-PerPage") - .map(|s| -> Result<_, _> { - let s = s.to_str().map_err(|_| StructureError::HeaderNotAscii)?; - s.parse::() - .map_err(|_| StructureError::HeaderParseFailed) - }) - .transpose()?; - let x_total = map - .get("X-Total") - .map(|s| -> Result<_, _> { - let s = s.to_str().map_err(|_| StructureError::HeaderNotAscii)?; - s.parse::() - .map_err(|_| StructureError::HeaderParseFailed) - }) - .transpose()?; - Ok(Self { - x_has_more, - x_page, - x_page_count, - x_per_page, - x_total, - }) + Ok(Self { x_total_count }) } } pub struct VariableListHeaders { - pub x_has_more: Option, - pub x_page: Option, - pub x_page_count: Option, - pub x_per_page: Option, - pub x_total: Option, + pub x_total_count: Option, } impl TryFrom<&reqwest::header::HeaderMap> for VariableListHeaders { type Error = StructureError; fn try_from(map: &reqwest::header::HeaderMap) -> Result { - let x_has_more = map - .get("X-HasMore") - .map(|s| -> Result<_, _> { - let s = s.to_str().map_err(|_| StructureError::HeaderNotAscii)?; - s.parse::() - .map_err(|_| StructureError::HeaderParseFailed) - }) - .transpose()?; - let x_page = map - .get("X-Page") + let x_total_count = map + .get("x-total-count") .map(|s| -> Result<_, _> { let s = s.to_str().map_err(|_| StructureError::HeaderNotAscii)?; s.parse::() .map_err(|_| StructureError::HeaderParseFailed) }) .transpose()?; - let x_page_count = map - .get("X-PageCount") - .map(|s| -> Result<_, _> { - let s = s.to_str().map_err(|_| StructureError::HeaderNotAscii)?; - s.parse::() - .map_err(|_| StructureError::HeaderParseFailed) - }) - .transpose()?; - let x_per_page = map - .get("X-PerPage") - .map(|s| -> Result<_, _> { - let s = s.to_str().map_err(|_| StructureError::HeaderNotAscii)?; - s.parse::() - .map_err(|_| StructureError::HeaderParseFailed) - }) - .transpose()?; - let x_total = map - .get("X-Total") - .map(|s| -> Result<_, _> { - let s = s.to_str().map_err(|_| StructureError::HeaderNotAscii)?; - s.parse::() - .map_err(|_| StructureError::HeaderParseFailed) - }) - .transpose()?; - Ok(Self { - x_has_more, - x_page, - x_page_count, - x_per_page, - x_total, - }) + Ok(Self { x_total_count }) } } pub struct WikiCommitListHeaders { - pub x_has_more: Option, - pub x_page: Option, - pub x_page_count: Option, - pub x_per_page: Option, - pub x_total: Option, + pub x_total_count: Option, } impl TryFrom<&reqwest::header::HeaderMap> for WikiCommitListHeaders { type Error = StructureError; fn try_from(map: &reqwest::header::HeaderMap) -> Result { - let x_has_more = map - .get("X-HasMore") - .map(|s| -> Result<_, _> { - let s = s.to_str().map_err(|_| StructureError::HeaderNotAscii)?; - s.parse::() - .map_err(|_| StructureError::HeaderParseFailed) - }) - .transpose()?; - let x_page = map - .get("X-Page") + let x_total_count = map + .get("x-total-count") .map(|s| -> Result<_, _> { let s = s.to_str().map_err(|_| StructureError::HeaderNotAscii)?; s.parse::() .map_err(|_| StructureError::HeaderParseFailed) }) .transpose()?; - let x_page_count = map - .get("X-PageCount") - .map(|s| -> Result<_, _> { - let s = s.to_str().map_err(|_| StructureError::HeaderNotAscii)?; - s.parse::() - .map_err(|_| StructureError::HeaderParseFailed) - }) - .transpose()?; - let x_per_page = map - .get("X-PerPage") - .map(|s| -> Result<_, _> { - let s = s.to_str().map_err(|_| StructureError::HeaderNotAscii)?; - s.parse::() - .map_err(|_| StructureError::HeaderParseFailed) - }) - .transpose()?; - let x_total = map - .get("X-Total") - .map(|s| -> Result<_, _> { - let s = s.to_str().map_err(|_| StructureError::HeaderNotAscii)?; - s.parse::() - .map_err(|_| StructureError::HeaderParseFailed) - }) - .transpose()?; - Ok(Self { - x_has_more, - x_page, - x_page_count, - x_per_page, - x_total, - }) + Ok(Self { x_total_count }) } } pub struct WikiPageListHeaders { - pub x_has_more: Option, - pub x_page: Option, - pub x_page_count: Option, - pub x_per_page: Option, - pub x_total: Option, + pub x_total_count: Option, } impl TryFrom<&reqwest::header::HeaderMap> for WikiPageListHeaders { type Error = StructureError; fn try_from(map: &reqwest::header::HeaderMap) -> Result { - let x_has_more = map - .get("X-HasMore") - .map(|s| -> Result<_, _> { - let s = s.to_str().map_err(|_| StructureError::HeaderNotAscii)?; - s.parse::() - .map_err(|_| StructureError::HeaderParseFailed) - }) - .transpose()?; - let x_page = map - .get("X-Page") + let x_total_count = map + .get("x-total-count") .map(|s| -> Result<_, _> { let s = s.to_str().map_err(|_| StructureError::HeaderNotAscii)?; s.parse::() .map_err(|_| StructureError::HeaderParseFailed) }) .transpose()?; - let x_page_count = map - .get("X-PageCount") - .map(|s| -> Result<_, _> { - let s = s.to_str().map_err(|_| StructureError::HeaderNotAscii)?; - s.parse::() - .map_err(|_| StructureError::HeaderParseFailed) - }) - .transpose()?; - let x_per_page = map - .get("X-PerPage") - .map(|s| -> Result<_, _> { - let s = s.to_str().map_err(|_| StructureError::HeaderNotAscii)?; - s.parse::() - .map_err(|_| StructureError::HeaderParseFailed) - }) - .transpose()?; - let x_total = map - .get("X-Total") - .map(|s| -> Result<_, _> { - let s = s.to_str().map_err(|_| StructureError::HeaderNotAscii)?; - s.parse::() - .map_err(|_| StructureError::HeaderParseFailed) - }) - .transpose()?; - Ok(Self { - x_has_more, - x_page, - x_page_count, - x_per_page, - x_total, - }) + Ok(Self { x_total_count }) } } diff --git a/swagger.v1.json b/swagger.v1.json index 98cbfe1..0f99386 100644 --- a/swagger.v1.json +++ b/swagger.v1.json @@ -20391,20 +20391,20 @@ "items": { "type": "string", "enum": [ - "none", - "size:all", - "size:repos:all", - "size:repos:public", - "size:repos:private", - "size:git:all", - "size:git:lfs", - "size:assets:all", - "size:assets:attachments:all", - "size:assets:attachments:issues", - "size:assets:attachments:releases", - "size:assets:artifacts", - "size:assets:packages:all", - "size:assets:wiki" + "none", + "size:all", + "size:repos:all", + "size:repos:public", + "size:repos:private", + "size:git:all", + "size:git:lfs", + "size:assets:all", + "size:assets:attachments:all", + "size:assets:attachments:issues", + "size:assets:attachments:releases", + "size:assets:artifacts", + "size:assets:packages:all", + "size:assets:wiki" ] }, "x-go-name": "Subjects" @@ -25098,10 +25098,7 @@ "StateType": { "description": "StateType issue state type", "type": "string", - "enum": [ - "open", - "closed" - ], + "enum": ["open", "closed"], "x-go-package": "code.gitea.io/gitea/modules/structs" }, "StopWatch": { @@ -26064,26 +26061,7 @@ } }, "headers": { - "X-HasMore": { - "type": "boolean", - "description": "True if there is another page" - }, - "X-Page": { - "type": "integer", - "format": "int64", - "description": "The current page" - }, - "X-PageCount": { - "type": "integer", - "format": "int64", - "description": "Total number of pages" - }, - "X-PerPage": { - "type": "integer", - "format": "int64", - "description": "Commits per page" - }, - "X-Total": { + "X-Total-Count": { "type": "integer", "format": "int64", "description": "Total commit count" @@ -26105,26 +26083,7 @@ } }, "headers": { - "X-HasMore": { - "type": "boolean", - "description": "True if there is another page" - }, - "X-Page": { - "type": "integer", - "format": "int64", - "description": "The current page" - }, - "X-PageCount": { - "type": "integer", - "format": "int64", - "description": "Total number of pages" - }, - "X-PerPage": { - "type": "integer", - "format": "int64", - "description": "Commits per page" - }, - "X-Total": { + "X-Total-Count": { "type": "integer", "format": "int64", "description": "Total commit count" @@ -26156,32 +26115,6 @@ "items": { "$ref": "#/definitions/Attachment" } - }, - "headers": { - "X-HasMore": { - "type": "boolean", - "description": "True if there is another page" - }, - "X-Page": { - "type": "integer", - "format": "int64", - "description": "The current page" - }, - "X-PageCount": { - "type": "integer", - "format": "int64", - "description": "Total number of pages" - }, - "X-PerPage": { - "type": "integer", - "format": "int64", - "description": "Commits per page" - }, - "X-Total": { - "type": "integer", - "format": "int64", - "description": "Total commit count" - } } }, "BlockedUserList": { @@ -26193,26 +26126,7 @@ } }, "headers": { - "X-HasMore": { - "type": "boolean", - "description": "True if there is another page" - }, - "X-Page": { - "type": "integer", - "format": "int64", - "description": "The current page" - }, - "X-PageCount": { - "type": "integer", - "format": "int64", - "description": "Total number of pages" - }, - "X-PerPage": { - "type": "integer", - "format": "int64", - "description": "Commits per page" - }, - "X-Total": { + "X-Total-Count": { "type": "integer", "format": "int64", "description": "Total commit count" @@ -26234,26 +26148,7 @@ } }, "headers": { - "X-HasMore": { - "type": "boolean", - "description": "True if there is another page" - }, - "X-Page": { - "type": "integer", - "format": "int64", - "description": "The current page" - }, - "X-PageCount": { - "type": "integer", - "format": "int64", - "description": "Total number of pages" - }, - "X-PerPage": { - "type": "integer", - "format": "int64", - "description": "Commits per page" - }, - "X-Total": { + "X-Total-Count": { "type": "integer", "format": "int64", "description": "Total commit count" @@ -26273,32 +26168,6 @@ "items": { "$ref": "#/definitions/BranchProtection" } - }, - "headers": { - "X-HasMore": { - "type": "boolean", - "description": "True if there is another page" - }, - "X-Page": { - "type": "integer", - "format": "int64", - "description": "The current page" - }, - "X-PageCount": { - "type": "integer", - "format": "int64", - "description": "Total number of pages" - }, - "X-PerPage": { - "type": "integer", - "format": "int64", - "description": "Commits per page" - }, - "X-Total": { - "type": "integer", - "format": "int64", - "description": "Total commit count" - } } }, "ChangedFileList": { @@ -26314,21 +26183,6 @@ "type": "boolean", "description": "True if there is another page" }, - "X-Page": { - "type": "integer", - "format": "int64", - "description": "The current page" - }, - "X-PageCount": { - "type": "integer", - "format": "int64", - "description": "Total number of pages" - }, - "X-PerPage": { - "type": "integer", - "format": "int64", - "description": "Commits per page" - }, "X-Total-Count": { "type": "integer", "format": "int64", @@ -26357,26 +26211,7 @@ } }, "headers": { - "X-HasMore": { - "type": "boolean", - "description": "True if there is another page" - }, - "X-Page": { - "type": "integer", - "format": "int64", - "description": "The current page" - }, - "X-PageCount": { - "type": "integer", - "format": "int64", - "description": "Total number of pages" - }, - "X-PerPage": { - "type": "integer", - "format": "int64", - "description": "Commits per page" - }, - "X-Total": { + "X-Total-Count": { "type": "integer", "format": "int64", "description": "Total commit count" @@ -26402,22 +26237,7 @@ "type": "boolean", "description": "True if there is another page" }, - "X-Page": { - "type": "integer", - "format": "int64", - "description": "The current page" - }, - "X-PageCount": { - "type": "integer", - "format": "int64", - "description": "Total number of pages" - }, - "X-PerPage": { - "type": "integer", - "format": "int64", - "description": "Commits per page" - }, - "X-Total": { + "X-Total-Count": { "type": "integer", "format": "int64", "description": "Total commit count" @@ -26439,26 +26259,7 @@ } }, "headers": { - "X-HasMore": { - "type": "boolean", - "description": "True if there is another page" - }, - "X-Page": { - "type": "integer", - "format": "int64", - "description": "The current page" - }, - "X-PageCount": { - "type": "integer", - "format": "int64", - "description": "Total number of pages" - }, - "X-PerPage": { - "type": "integer", - "format": "int64", - "description": "Commits per page" - }, - "X-Total": { + "X-Total-Count": { "type": "integer", "format": "int64", "description": "Total commit count" @@ -26495,26 +26296,7 @@ } }, "headers": { - "X-HasMore": { - "type": "boolean", - "description": "True if there is another page" - }, - "X-Page": { - "type": "integer", - "format": "int64", - "description": "The current page" - }, - "X-PageCount": { - "type": "integer", - "format": "int64", - "description": "Total number of pages" - }, - "X-PerPage": { - "type": "integer", - "format": "int64", - "description": "Commits per page" - }, - "X-Total": { + "X-Total-Count": { "type": "integer", "format": "int64", "description": "Total commit count" @@ -26536,26 +26318,7 @@ } }, "headers": { - "X-HasMore": { - "type": "boolean", - "description": "True if there is another page" - }, - "X-Page": { - "type": "integer", - "format": "int64", - "description": "The current page" - }, - "X-PageCount": { - "type": "integer", - "format": "int64", - "description": "Total number of pages" - }, - "X-PerPage": { - "type": "integer", - "format": "int64", - "description": "Commits per page" - }, - "X-Total": { + "X-Total-Count": { "type": "integer", "format": "int64", "description": "Total commit count" @@ -26569,32 +26332,6 @@ "items": { "$ref": "#/definitions/Email" } - }, - "headers": { - "X-HasMore": { - "type": "boolean", - "description": "True if there is another page" - }, - "X-Page": { - "type": "integer", - "format": "int64", - "description": "The current page" - }, - "X-PageCount": { - "type": "integer", - "format": "int64", - "description": "Total number of pages" - }, - "X-PerPage": { - "type": "integer", - "format": "int64", - "description": "Commits per page" - }, - "X-Total": { - "type": "integer", - "format": "int64", - "description": "Total commit count" - } } }, "EmptyRepository": { @@ -26636,26 +26373,7 @@ } }, "headers": { - "X-HasMore": { - "type": "boolean", - "description": "True if there is another page" - }, - "X-Page": { - "type": "integer", - "format": "int64", - "description": "The current page" - }, - "X-PageCount": { - "type": "integer", - "format": "int64", - "description": "Total number of pages" - }, - "X-PerPage": { - "type": "integer", - "format": "int64", - "description": "Commits per page" - }, - "X-Total": { + "X-Total-Count": { "type": "integer", "format": "int64", "description": "Total commit count" @@ -26707,26 +26425,7 @@ } }, "headers": { - "X-HasMore": { - "type": "boolean", - "description": "True if there is another page" - }, - "X-Page": { - "type": "integer", - "format": "int64", - "description": "The current page" - }, - "X-PageCount": { - "type": "integer", - "format": "int64", - "description": "Total number of pages" - }, - "X-PerPage": { - "type": "integer", - "format": "int64", - "description": "Commits per page" - }, - "X-Total": { + "X-Total-Count": { "type": "integer", "format": "int64", "description": "Total commit count" @@ -26752,32 +26451,6 @@ "items": { "type": "string" } - }, - "headers": { - "X-HasMore": { - "type": "boolean", - "description": "True if there is another page" - }, - "X-Page": { - "type": "integer", - "format": "int64", - "description": "The current page" - }, - "X-PageCount": { - "type": "integer", - "format": "int64", - "description": "Total number of pages" - }, - "X-PerPage": { - "type": "integer", - "format": "int64", - "description": "Commits per page" - }, - "X-Total": { - "type": "integer", - "format": "int64", - "description": "Total commit count" - } } }, "Hook": { @@ -26795,26 +26468,7 @@ } }, "headers": { - "X-HasMore": { - "type": "boolean", - "description": "True if there is another page" - }, - "X-Page": { - "type": "integer", - "format": "int64", - "description": "The current page" - }, - "X-PageCount": { - "type": "integer", - "format": "int64", - "description": "Total number of pages" - }, - "X-PerPage": { - "type": "integer", - "format": "int64", - "description": "Commits per page" - }, - "X-Total": { + "X-Total-Count": { "type": "integer", "format": "int64", "description": "Total commit count" @@ -26842,26 +26496,7 @@ } }, "headers": { - "X-HasMore": { - "type": "boolean", - "description": "True if there is another page" - }, - "X-Page": { - "type": "integer", - "format": "int64", - "description": "The current page" - }, - "X-PageCount": { - "type": "integer", - "format": "int64", - "description": "Total number of pages" - }, - "X-PerPage": { - "type": "integer", - "format": "int64", - "description": "Commits per page" - }, - "X-Total": { + "X-Total-Count": { "type": "integer", "format": "int64", "description": "Total commit count" @@ -26892,26 +26527,7 @@ } }, "headers": { - "X-HasMore": { - "type": "boolean", - "description": "True if there is another page" - }, - "X-Page": { - "type": "integer", - "format": "int64", - "description": "The current page" - }, - "X-PageCount": { - "type": "integer", - "format": "int64", - "description": "Total number of pages" - }, - "X-PerPage": { - "type": "integer", - "format": "int64", - "description": "Commits per page" - }, - "X-Total": { + "X-Total-Count": { "type": "integer", "format": "int64", "description": "Total commit count" @@ -26934,32 +26550,6 @@ "items": { "type": "string" } - }, - "headers": { - "X-HasMore": { - "type": "boolean", - "description": "True if there is another page" - }, - "X-Page": { - "type": "integer", - "format": "int64", - "description": "The current page" - }, - "X-PageCount": { - "type": "integer", - "format": "int64", - "description": "Total number of pages" - }, - "X-PerPage": { - "type": "integer", - "format": "int64", - "description": "Commits per page" - }, - "X-Total": { - "type": "integer", - "format": "int64", - "description": "Total commit count" - } } }, "LanguageStatistics": { @@ -26985,32 +26575,6 @@ "items": { "$ref": "#/definitions/LicensesTemplateListEntry" } - }, - "headers": { - "X-HasMore": { - "type": "boolean", - "description": "True if there is another page" - }, - "X-Page": { - "type": "integer", - "format": "int64", - "description": "The current page" - }, - "X-PageCount": { - "type": "integer", - "format": "int64", - "description": "Total number of pages" - }, - "X-PerPage": { - "type": "integer", - "format": "int64", - "description": "Commits per page" - }, - "X-Total": { - "type": "integer", - "format": "int64", - "description": "Total commit count" - } } }, "MarkdownRender": { @@ -27040,26 +26604,7 @@ } }, "headers": { - "X-HasMore": { - "type": "boolean", - "description": "True if there is another page" - }, - "X-Page": { - "type": "integer", - "format": "int64", - "description": "The current page" - }, - "X-PageCount": { - "type": "integer", - "format": "int64", - "description": "Total number of pages" - }, - "X-PerPage": { - "type": "integer", - "format": "int64", - "description": "Commits per page" - }, - "X-Total": { + "X-Total-Count": { "type": "integer", "format": "int64", "description": "Total commit count" @@ -27099,26 +26644,7 @@ } }, "headers": { - "X-HasMore": { - "type": "boolean", - "description": "True if there is another page" - }, - "X-Page": { - "type": "integer", - "format": "int64", - "description": "The current page" - }, - "X-PageCount": { - "type": "integer", - "format": "int64", - "description": "Total number of pages" - }, - "X-PerPage": { - "type": "integer", - "format": "int64", - "description": "Commits per page" - }, - "X-Total": { + "X-Total-Count": { "type": "integer", "format": "int64", "description": "Total commit count" @@ -27140,26 +26666,7 @@ } }, "headers": { - "X-HasMore": { - "type": "boolean", - "description": "True if there is another page" - }, - "X-Page": { - "type": "integer", - "format": "int64", - "description": "The current page" - }, - "X-PageCount": { - "type": "integer", - "format": "int64", - "description": "Total number of pages" - }, - "X-PerPage": { - "type": "integer", - "format": "int64", - "description": "Commits per page" - }, - "X-Total": { + "X-Total-Count": { "type": "integer", "format": "int64", "description": "Total commit count" @@ -27181,26 +26688,7 @@ } }, "headers": { - "X-HasMore": { - "type": "boolean", - "description": "True if there is another page" - }, - "X-Page": { - "type": "integer", - "format": "int64", - "description": "The current page" - }, - "X-PageCount": { - "type": "integer", - "format": "int64", - "description": "Total number of pages" - }, - "X-PerPage": { - "type": "integer", - "format": "int64", - "description": "Commits per page" - }, - "X-Total": { + "X-Total-Count": { "type": "integer", "format": "int64", "description": "Total commit count" @@ -27228,26 +26716,7 @@ } }, "headers": { - "X-HasMore": { - "type": "boolean", - "description": "True if there is another page" - }, - "X-Page": { - "type": "integer", - "format": "int64", - "description": "The current page" - }, - "X-PageCount": { - "type": "integer", - "format": "int64", - "description": "Total number of pages" - }, - "X-PerPage": { - "type": "integer", - "format": "int64", - "description": "Commits per page" - }, - "X-Total": { + "X-Total-Count": { "type": "integer", "format": "int64", "description": "Total commit count" @@ -27263,26 +26732,7 @@ } }, "headers": { - "X-HasMore": { - "type": "boolean", - "description": "True if there is another page" - }, - "X-Page": { - "type": "integer", - "format": "int64", - "description": "The current page" - }, - "X-PageCount": { - "type": "integer", - "format": "int64", - "description": "Total number of pages" - }, - "X-PerPage": { - "type": "integer", - "format": "int64", - "description": "Commits per page" - }, - "X-Total": { + "X-Total-Count": { "type": "integer", "format": "int64", "description": "Total commit count" @@ -27304,26 +26754,7 @@ } }, "headers": { - "X-HasMore": { - "type": "boolean", - "description": "True if there is another page" - }, - "X-Page": { - "type": "integer", - "format": "int64", - "description": "The current page" - }, - "X-PageCount": { - "type": "integer", - "format": "int64", - "description": "Total number of pages" - }, - "X-PerPage": { - "type": "integer", - "format": "int64", - "description": "Commits per page" - }, - "X-Total": { + "X-Total-Count": { "type": "integer", "format": "int64", "description": "Total commit count" @@ -27345,26 +26776,7 @@ } }, "headers": { - "X-HasMore": { - "type": "boolean", - "description": "True if there is another page" - }, - "X-Page": { - "type": "integer", - "format": "int64", - "description": "The current page" - }, - "X-PageCount": { - "type": "integer", - "format": "int64", - "description": "Total number of pages" - }, - "X-PerPage": { - "type": "integer", - "format": "int64", - "description": "Commits per page" - }, - "X-Total": { + "X-Total-Count": { "type": "integer", "format": "int64", "description": "Total commit count" @@ -27390,32 +26802,6 @@ "items": { "$ref": "#/definitions/PullReviewComment" } - }, - "headers": { - "X-HasMore": { - "type": "boolean", - "description": "True if there is another page" - }, - "X-Page": { - "type": "integer", - "format": "int64", - "description": "The current page" - }, - "X-PageCount": { - "type": "integer", - "format": "int64", - "description": "Total number of pages" - }, - "X-PerPage": { - "type": "integer", - "format": "int64", - "description": "Commits per page" - }, - "X-Total": { - "type": "integer", - "format": "int64", - "description": "Total commit count" - } } }, "PullReviewList": { @@ -27427,26 +26813,7 @@ } }, "headers": { - "X-HasMore": { - "type": "boolean", - "description": "True if there is another page" - }, - "X-Page": { - "type": "integer", - "format": "int64", - "description": "The current page" - }, - "X-PageCount": { - "type": "integer", - "format": "int64", - "description": "Total number of pages" - }, - "X-PerPage": { - "type": "integer", - "format": "int64", - "description": "Commits per page" - }, - "X-Total": { + "X-Total-Count": { "type": "integer", "format": "int64", "description": "Total commit count" @@ -27468,26 +26835,7 @@ } }, "headers": { - "X-HasMore": { - "type": "boolean", - "description": "True if there is another page" - }, - "X-Page": { - "type": "integer", - "format": "int64", - "description": "The current page" - }, - "X-PageCount": { - "type": "integer", - "format": "int64", - "description": "Total number of pages" - }, - "X-PerPage": { - "type": "integer", - "format": "int64", - "description": "Commits per page" - }, - "X-Total": { + "X-Total-Count": { "type": "integer", "format": "int64", "description": "Total commit count" @@ -27506,26 +26854,7 @@ "$ref": "#/definitions/QuotaGroupList" }, "headers": { - "X-HasMore": { - "type": "boolean", - "description": "True if there is another page" - }, - "X-Page": { - "type": "integer", - "format": "int64", - "description": "The current page" - }, - "X-PageCount": { - "type": "integer", - "format": "int64", - "description": "Total number of pages" - }, - "X-PerPage": { - "type": "integer", - "format": "int64", - "description": "Commits per page" - }, - "X-Total": { + "X-Total-Count": { "type": "integer", "format": "int64", "description": "Total commit count" @@ -27553,26 +26882,7 @@ } }, "headers": { - "X-HasMore": { - "type": "boolean", - "description": "True if there is another page" - }, - "X-Page": { - "type": "integer", - "format": "int64", - "description": "The current page" - }, - "X-PageCount": { - "type": "integer", - "format": "int64", - "description": "Total number of pages" - }, - "X-PerPage": { - "type": "integer", - "format": "int64", - "description": "Commits per page" - }, - "X-Total": { + "X-Total-Count": { "type": "integer", "format": "int64", "description": "Total commit count" @@ -27585,26 +26895,7 @@ "$ref": "#/definitions/QuotaUsedArtifactList" }, "headers": { - "X-HasMore": { - "type": "boolean", - "description": "True if there is another page" - }, - "X-Page": { - "type": "integer", - "format": "int64", - "description": "The current page" - }, - "X-PageCount": { - "type": "integer", - "format": "int64", - "description": "Total number of pages" - }, - "X-PerPage": { - "type": "integer", - "format": "int64", - "description": "Commits per page" - }, - "X-Total": { + "X-Total-Count": { "type": "integer", "format": "int64", "description": "Total commit count" @@ -27617,26 +26908,7 @@ "$ref": "#/definitions/QuotaUsedAttachmentList" }, "headers": { - "X-HasMore": { - "type": "boolean", - "description": "True if there is another page" - }, - "X-Page": { - "type": "integer", - "format": "int64", - "description": "The current page" - }, - "X-PageCount": { - "type": "integer", - "format": "int64", - "description": "Total number of pages" - }, - "X-PerPage": { - "type": "integer", - "format": "int64", - "description": "Commits per page" - }, - "X-Total": { + "X-Total-Count": { "type": "integer", "format": "int64", "description": "Total commit count" @@ -27649,26 +26921,7 @@ "$ref": "#/definitions/QuotaUsedPackageList" }, "headers": { - "X-HasMore": { - "type": "boolean", - "description": "True if there is another page" - }, - "X-Page": { - "type": "integer", - "format": "int64", - "description": "The current page" - }, - "X-PageCount": { - "type": "integer", - "format": "int64", - "description": "Total number of pages" - }, - "X-PerPage": { - "type": "integer", - "format": "int64", - "description": "Commits per page" - }, - "X-Total": { + "X-Total-Count": { "type": "integer", "format": "int64", "description": "Total commit count" @@ -27690,26 +26943,7 @@ } }, "headers": { - "X-HasMore": { - "type": "boolean", - "description": "True if there is another page" - }, - "X-Page": { - "type": "integer", - "format": "int64", - "description": "The current page" - }, - "X-PageCount": { - "type": "integer", - "format": "int64", - "description": "Total number of pages" - }, - "X-PerPage": { - "type": "integer", - "format": "int64", - "description": "Commits per page" - }, - "X-Total": { + "X-Total-Count": { "type": "integer", "format": "int64", "description": "Total commit count" @@ -27729,32 +26963,6 @@ "items": { "$ref": "#/definitions/Reference" } - }, - "headers": { - "X-HasMore": { - "type": "boolean", - "description": "True if there is another page" - }, - "X-Page": { - "type": "integer", - "format": "int64", - "description": "The current page" - }, - "X-PageCount": { - "type": "integer", - "format": "int64", - "description": "Total number of pages" - }, - "X-PerPage": { - "type": "integer", - "format": "int64", - "description": "Commits per page" - }, - "X-Total": { - "type": "integer", - "format": "int64", - "description": "Total commit count" - } } }, "RegistrationToken": { @@ -27780,26 +26988,7 @@ } }, "headers": { - "X-HasMore": { - "type": "boolean", - "description": "True if there is another page" - }, - "X-Page": { - "type": "integer", - "format": "int64", - "description": "The current page" - }, - "X-PageCount": { - "type": "integer", - "format": "int64", - "description": "Total number of pages" - }, - "X-PerPage": { - "type": "integer", - "format": "int64", - "description": "Commits per page" - }, - "X-Total": { + "X-Total-Count": { "type": "integer", "format": "int64", "description": "Total commit count" @@ -27845,26 +27034,7 @@ } }, "headers": { - "X-HasMore": { - "type": "boolean", - "description": "True if there is another page" - }, - "X-Page": { - "type": "integer", - "format": "int64", - "description": "The current page" - }, - "X-PageCount": { - "type": "integer", - "format": "int64", - "description": "Total number of pages" - }, - "X-PerPage": { - "type": "integer", - "format": "int64", - "description": "Commits per page" - }, - "X-Total": { + "X-Total-Count": { "type": "integer", "format": "int64", "description": "Total commit count" @@ -27892,26 +27062,7 @@ } }, "headers": { - "X-HasMore": { - "type": "boolean", - "description": "True if there is another page" - }, - "X-Page": { - "type": "integer", - "format": "int64", - "description": "The current page" - }, - "X-PageCount": { - "type": "integer", - "format": "int64", - "description": "Total number of pages" - }, - "X-PerPage": { - "type": "integer", - "format": "int64", - "description": "Commits per page" - }, - "X-Total": { + "X-Total-Count": { "type": "integer", "format": "int64", "description": "Total commit count" @@ -27939,26 +27090,7 @@ } }, "headers": { - "X-HasMore": { - "type": "boolean", - "description": "True if there is another page" - }, - "X-Page": { - "type": "integer", - "format": "int64", - "description": "The current page" - }, - "X-PageCount": { - "type": "integer", - "format": "int64", - "description": "Total number of pages" - }, - "X-PerPage": { - "type": "integer", - "format": "int64", - "description": "Commits per page" - }, - "X-Total": { + "X-Total-Count": { "type": "integer", "format": "int64", "description": "Total commit count" @@ -27989,26 +27121,7 @@ } }, "headers": { - "X-HasMore": { - "type": "boolean", - "description": "True if there is another page" - }, - "X-Page": { - "type": "integer", - "format": "int64", - "description": "The current page" - }, - "X-PageCount": { - "type": "integer", - "format": "int64", - "description": "Total number of pages" - }, - "X-PerPage": { - "type": "integer", - "format": "int64", - "description": "Commits per page" - }, - "X-Total": { + "X-Total-Count": { "type": "integer", "format": "int64", "description": "Total commit count" @@ -28028,64 +27141,12 @@ "items": { "$ref": "#/definitions/TagProtection" } - }, - "headers": { - "X-HasMore": { - "type": "boolean", - "description": "True if there is another page" - }, - "X-Page": { - "type": "integer", - "format": "int64", - "description": "The current page" - }, - "X-PageCount": { - "type": "integer", - "format": "int64", - "description": "Total number of pages" - }, - "X-PerPage": { - "type": "integer", - "format": "int64", - "description": "Commits per page" - }, - "X-Total": { - "type": "integer", - "format": "int64", - "description": "Total commit count" - } } }, "TasksList": { "description": "TasksList", "schema": { "$ref": "#/definitions/ActionTaskResponse" - }, - "headers": { - "X-HasMore": { - "type": "boolean", - "description": "True if there is another page" - }, - "X-Page": { - "type": "integer", - "format": "int64", - "description": "The current page" - }, - "X-PageCount": { - "type": "integer", - "format": "int64", - "description": "Total number of pages" - }, - "X-PerPage": { - "type": "integer", - "format": "int64", - "description": "Commits per page" - }, - "X-Total": { - "type": "integer", - "format": "int64", - "description": "Total commit count" - } } }, "Team": { @@ -28103,26 +27164,7 @@ } }, "headers": { - "X-HasMore": { - "type": "boolean", - "description": "True if there is another page" - }, - "X-Page": { - "type": "integer", - "format": "int64", - "description": "The current page" - }, - "X-PageCount": { - "type": "integer", - "format": "int64", - "description": "Total number of pages" - }, - "X-PerPage": { - "type": "integer", - "format": "int64", - "description": "Commits per page" - }, - "X-Total": { + "X-Total-Count": { "type": "integer", "format": "int64", "description": "Total commit count" @@ -28138,26 +27180,7 @@ } }, "headers": { - "X-HasMore": { - "type": "boolean", - "description": "True if there is another page" - }, - "X-Page": { - "type": "integer", - "format": "int64", - "description": "The current page" - }, - "X-PageCount": { - "type": "integer", - "format": "int64", - "description": "Total number of pages" - }, - "X-PerPage": { - "type": "integer", - "format": "int64", - "description": "Commits per page" - }, - "X-Total": { + "X-Total-Count": { "type": "integer", "format": "int64", "description": "Total commit count" @@ -28194,26 +27217,7 @@ } }, "headers": { - "X-HasMore": { - "type": "boolean", - "description": "True if there is another page" - }, - "X-Page": { - "type": "integer", - "format": "int64", - "description": "The current page" - }, - "X-PageCount": { - "type": "integer", - "format": "int64", - "description": "Total number of pages" - }, - "X-PerPage": { - "type": "integer", - "format": "int64", - "description": "Commits per page" - }, - "X-Total": { + "X-Total-Count": { "type": "integer", "format": "int64", "description": "Total commit count" @@ -28244,26 +27248,7 @@ } }, "headers": { - "X-HasMore": { - "type": "boolean", - "description": "True if there is another page" - }, - "X-Page": { - "type": "integer", - "format": "int64", - "description": "The current page" - }, - "X-PageCount": { - "type": "integer", - "format": "int64", - "description": "Total number of pages" - }, - "X-PerPage": { - "type": "integer", - "format": "int64", - "description": "Commits per page" - }, - "X-Total": { + "X-Total-Count": { "type": "integer", "format": "int64", "description": "Total commit count" @@ -28285,26 +27270,7 @@ } }, "headers": { - "X-HasMore": { - "type": "boolean", - "description": "True if there is another page" - }, - "X-Page": { - "type": "integer", - "format": "int64", - "description": "The current page" - }, - "X-PageCount": { - "type": "integer", - "format": "int64", - "description": "Total number of pages" - }, - "X-PerPage": { - "type": "integer", - "format": "int64", - "description": "Commits per page" - }, - "X-Total": { + "X-Total-Count": { "type": "integer", "format": "int64", "description": "Total commit count" @@ -28323,26 +27289,7 @@ "$ref": "#/definitions/WikiCommitList" }, "headers": { - "X-HasMore": { - "type": "boolean", - "description": "True if there is another page" - }, - "X-Page": { - "type": "integer", - "format": "int64", - "description": "The current page" - }, - "X-PageCount": { - "type": "integer", - "format": "int64", - "description": "Total number of pages" - }, - "X-PerPage": { - "type": "integer", - "format": "int64", - "description": "Commits per page" - }, - "X-Total": { + "X-Total-Count": { "type": "integer", "format": "int64", "description": "Total commit count" @@ -28364,26 +27311,7 @@ } }, "headers": { - "X-HasMore": { - "type": "boolean", - "description": "True if there is another page" - }, - "X-Page": { - "type": "integer", - "format": "int64", - "description": "The current page" - }, - "X-PageCount": { - "type": "integer", - "format": "int64", - "description": "Total number of pages" - }, - "X-PerPage": { - "type": "integer", - "format": "int64", - "description": "Commits per page" - }, - "X-Total": { + "X-Total-Count": { "type": "integer", "format": "int64", "description": "Total commit count" diff --git a/tests/admin.rs b/tests/admin.rs index 4aa7f13..cc3d303 100644 --- a/tests/admin.rs +++ b/tests/admin.rs @@ -34,7 +34,7 @@ async fn user() { "could not find new user" ); let query = AdminGetAllEmailsQuery::default(); - let (_, users) = api + let users = api .admin_get_all_emails(query) .await .expect("failed to search emails"); diff --git a/tests/common/mod.rs b/tests/common/mod.rs index 63ae02c..d273368 100644 --- a/tests/common/mod.rs +++ b/tests/common/mod.rs @@ -1,3 +1,4 @@ +use forgejo_api::structs::*; use forgejo_api::Forgejo; pub fn login() -> Forgejo { @@ -15,3 +16,117 @@ pub fn login_pass(username: &str, password: &str) -> Forgejo { }; Forgejo::new(auth, url).unwrap() } + +pub struct Git { + dir: &'static std::path::Path, +} + +impl Git { + pub fn new + ?Sized>(path: &'static T) -> Self { + let dir = path.as_ref(); + std::fs::create_dir_all(dir).unwrap(); + Self { dir } + } + + pub fn run(&self, args: &[impl AsRef]) { + let mut cmd = std::process::Command::new("git"); + cmd.current_dir(self.dir); + let _ = cmd.args(args).status().unwrap(); + } +} + +pub async fn setup_local_repo(git: &Git) { + git.run(&["config", "--global", "init.defaultBranch", "main"]); + git.run(&["init"]); + git.run(&["config", "user.name", "TestingAdmin"]); + git.run(&["config", "user.email", "admin@noreply.example.org"]); + tokio::fs::write(&git.dir.join("README.md"), "# Test\nThis is a test repo") + .await + .unwrap(); + git.run(&["add", "."]); + git.run(&["commit", "-m", "initial commit"]); +} + +pub async fn basic_repo(api: &forgejo_api::Forgejo, git: &Git, name: &str) -> Repository { + setup_local_repo(git).await; + let repo_opt = CreateRepoOption { + auto_init: Some(false), + default_branch: Some("main".into()), + description: Some("Test Repo".into()), + gitignores: Some("".into()), + issue_labels: Some("".into()), + license: Some("".into()), + name: name.into(), + object_format_name: None, + private: Some(false), + readme: None, + template: Some(false), + trust_model: Some(CreateRepoOptionTrustModel::Default), + }; + let remote_repo = api.create_current_user_repo(repo_opt).await.unwrap(); + assert!( + remote_repo.has_pull_requests.unwrap(), + "repo does not accept pull requests" + ); + assert!( + remote_repo.owner.as_ref().unwrap().login.as_ref().unwrap() == "TestingAdmin", + "repo owner is not \"TestingAdmin\"" + ); + assert!( + remote_repo.name.as_ref().unwrap() == name, + "repo name is not \"{name}\"" + ); + + let mut remote_url = remote_repo.clone_url.clone().unwrap(); + remote_url.set_username("TestingAdmin").unwrap(); + remote_url.set_password(Some("password")).unwrap(); + git.run(&["remote", "add", "origin", remote_url.as_str()]); + git.run(&["push", "-u", "origin", "main"]); + + remote_repo +} + +pub async fn basic_org_repo( + api: &forgejo_api::Forgejo, + git: &Git, + org: &str, + name: &str, +) -> Repository { + setup_local_repo(git).await; + + let repo_opt = CreateRepoOption { + auto_init: Some(false), + default_branch: Some("main".into()), + description: Some("Test Repo".into()), + gitignores: Some("".into()), + issue_labels: Some("".into()), + license: Some("".into()), + name: name.into(), + object_format_name: None, + private: Some(false), + readme: None, + template: Some(false), + trust_model: Some(CreateRepoOptionTrustModel::Default), + }; + let remote_repo = api.create_org_repo(org, repo_opt).await.unwrap(); + assert!( + remote_repo.has_pull_requests.unwrap(), + "repo does not accept pull requests" + ); + assert!( + remote_repo.owner.as_ref().unwrap().login.as_ref().unwrap() == org, + "repo owner is not \"TestingAdmin\"" + ); + assert!( + remote_repo.name.as_ref().unwrap() == name, + "repo name is not \"{name}\"" + ); + + let mut remote_url = remote_repo.clone_url.clone().unwrap(); + remote_url.set_username("TestingAdmin").unwrap(); + remote_url.set_password(Some("password")).unwrap(); + git.run(&["remote", "add", "origin", remote_url.as_str()]); + git.run(&["push", "-u", "origin", "main"]); + + remote_repo +} diff --git a/tests/headers.rs b/tests/headers.rs new file mode 100644 index 0000000..7e1acd0 --- /dev/null +++ b/tests/headers.rs @@ -0,0 +1,385 @@ +mod common; +use common::Git; +use forgejo_api::structs::*; + +macro_rules! test_header { + ($e:expr, $header:ident) => { + let (headers, _) = $e.await.expect("api called failed"); + assert!(headers.$header.is_some()); + }; +} + +#[tokio::test] +async fn total_count() { + // password login needed for user_get_tokens + let api = common::login_pass("TestingAdmin", "password"); + + test_header!( + api.user_get_tokens("TestingAdmin", UserGetTokensQuery::default()), + x_total_count + ); + test_header!( + api.user_list_activity_feeds("TestingAdmin", UserListActivityFeedsQuery::default()), + x_total_count + ); + test_header!( + api.user_current_list_gpg_keys(UserCurrentListGpgKeysQuery::default()), + x_total_count + ); + test_header!( + api.user_get_oauth2_applications(UserGetOAuth2ApplicationsQuery::default()), + x_total_count + ); + test_header!( + api.user_get_oauth2_applications(UserGetOAuth2ApplicationsQuery::default()), + x_total_count + ); + test_header!( + api.user_current_list_keys(UserCurrentListKeysQuery::default()), + x_total_count + ); + test_header!( + api.user_list_blocked_users(UserListBlockedUsersQuery::default()), + x_total_count + ); + test_header!( + api.user_current_list_repos(UserCurrentListReposQuery::default()), + x_total_count + ); + test_header!( + api.user_get_stop_watches(UserGetStopWatchesQuery::default()), + x_total_count + ); + test_header!( + api.user_current_tracked_times(UserCurrentTrackedTimesQuery::default()), + x_total_count + ); + test_header!( + api.user_list_followers("TestingAdmin", UserListFollowersQuery::default()), + x_total_count + ); + test_header!( + api.list_packages("TestingAdmin", ListPackagesQuery::default()), + x_total_count + ); + test_header!( + api.notify_get_list(NotifyGetListQuery::default()), + x_total_count + ); + + let git = Git::new("./test_repos/header_test"); + common::basic_repo(&api, &git, "header_test").await; + let body = CreateIssueOption { + assignee: None, + assignees: None, + body: None, + closed: None, + due_date: None, + labels: None, + milestone: None, + r#ref: None, + title: "Test".into(), + }; + api.issue_create_issue("TestingAdmin", "header_test", body) + .await + .unwrap(); + let body = EditReactionOption { + content: Some("+1".into()), + }; + api.issue_post_issue_reaction("TestingAdmin", "header_test", 1, body) + .await + .unwrap(); + test_header!( + api.issue_get_issue_reactions( + "TestingAdmin", + "header_test", + 1, + IssueGetIssueReactionsQuery::default() + ), + x_total_count + ); + test_header!( + api.issue_list_issues( + "TestingAdmin", + "header_test", + IssueListIssuesQuery::default() + ), + x_total_count + ); + test_header!( + api.issue_list_labels( + "TestingAdmin", + "header_test", + IssueListLabelsQuery::default() + ), + x_total_count + ); + test_header!( + api.issue_get_milestones_list( + "TestingAdmin", + "header_test", + IssueGetMilestonesListQuery::default() + ), + x_total_count + ); + + git.run(&["switch", "-c", "pluey"]); + tokio::fs::write("./test_repos/header_test/pluey.txt", "wahoo") + .await + .unwrap(); + git.run(&["add", "."]); + git.run(&["commit", "-m", "\"We implemented pluey\""]); + git.run(&["push"]); + let body = CreatePullRequestOption { + assignee: None, + assignees: None, + base: Some("main".into()), + body: None, + due_date: None, + head: Some("pluey".into()), + labels: None, + milestone: None, + title: Some("pluey".into()), + }; + tokio::time::sleep(std::time::Duration::from_secs(2)).await; + let pr = api + .repo_create_pull_request("TestingAdmin", "header_test", body) + .await + .unwrap(); + test_header!( + api.repo_get_pull_request_files( + "TestingAdmin", + "header_test", + 2, + RepoGetPullRequestFilesQuery::default() + ), + x_total_count + ); + test_header!( + api.issue_get_comments( + "TestingAdmin", + "header_test", + 1, + IssueGetCommentsQuery::default() + ), + x_total_count + ); + test_header!( + api.repo_get_pull_request_commits( + "TestingAdmin", + "header_test", + 2, + RepoGetPullRequestCommitsQuery::default() + ), + x_total_count + ); + let sha = pr.head.unwrap().sha.unwrap(); + test_header!( + api.repo_list_pull_requests( + "TestingAdmin", + "header_test", + RepoListPullRequestsQuery::default() + ), + x_total_count + ); + let body = CreatePullReviewOptions { + body: Some("woah".into()), + comments: None, + commit_id: None, + event: None, + }; + api.repo_create_pull_review("TestingAdmin", "header_test", 2, body) + .await + .unwrap(); + test_header!( + api.repo_list_pull_reviews( + "TestingAdmin", + "header_test", + 2, + RepoListPullReviewsQuery::default() + ), + x_total_count + ); + test_header!( + api.issue_get_comments_and_timeline( + "TestingAdmin", + "header_test", + 2, + IssueGetCommentsAndTimelineQuery::default() + ), + x_total_count + ); + + test_header!( + api.repo_list_push_mirrors( + "TestingAdmin", + "header_test", + RepoListPushMirrorsQuery::default() + ), + x_total_count + ); + //tokio::time::sleep(std::time::Duration::from_secs(2)).await; + test_header!( + api.repo_list_branches( + "TestingAdmin", + "header_test", + RepoListBranchesQuery::default() + ), + x_total_count + ); + test_header!( + api.repo_list_branches( + "TestingAdmin", + "header_test", + RepoListBranchesQuery::default() + ), + x_total_count + ); + test_header!( + api.repo_list_statuses( + "TestingAdmin", + "header_test", + &sha, + RepoListStatusesQuery::default() + ), + x_total_count + ); + test_header!( + api.repo_list_keys("TestingAdmin", "header_test", RepoListKeysQuery::default()), + x_total_count + ); + test_header!( + api.repo_list_hooks("TestingAdmin", "header_test", RepoListHooksQuery::default()), + x_total_count + ); + test_header!( + api.repo_list_releases( + "TestingAdmin", + "header_test", + RepoListReleasesQuery::default() + ), + x_total_count + ); + test_header!( + api.repo_list_actions_secrets( + "TestingAdmin", + "header_test", + RepoListActionsSecretsQuery::default() + ), + x_total_count + ); + test_header!( + api.repo_list_tags("TestingAdmin", "header_test", RepoListTagsQuery::default()), + x_total_count + ); + test_header!( + api.get_repo_variables_list( + "TestingAdmin", + "header_test", + GetRepoVariablesListQuery::default() + ), + x_total_count + ); + let body = CreateWikiPageOptions { + content_base64: Some( + "WW91IGRlY29kZWQgdGhpcyB0byBzZWUgd2hhdCBpdCBzYXlzPyBZb3UncmUgcXVpdGUgYSBuZXJk".into(), + ), + message: Some("wahoo".into()), + title: Some("Home".into()), + }; + api.repo_create_wiki_page("TestingAdmin", "header_test", body) + .await + .unwrap(); + test_header!( + api.repo_get_wiki_page_revisions( + "TestingAdmin", + "header_test", + "Home", + RepoGetWikiPageRevisionsQuery::default() + ), + x_total_count + ); + test_header!( + api.repo_get_wiki_pages( + "TestingAdmin", + "header_test", + RepoGetWikiPagesQuery::default() + ), + x_total_count + ); + + test_header!( + api.admin_cron_list(AdminCronListQuery::default()), + x_total_count + ); + //test_header!(api.admin_list_quota_groups(), x_total_count); + //test_header!(api.admin_list_quota_rules(), x_total_count); + //test_header!(api.user_list_quota_artifacts(UserListQuotaArtifactsQuery::default()), x_total_count); + //test_header!(api.user_list_quota_attachments(UserListQuotaAttachmentsQuery::default()), x_total_count); + //test_header!(api.user_list_quota_packages(UserListQuotaPackagesQuery::default()), x_total_count); + let body = CreateOrgOption { + description: None, + email: None, + full_name: None, + location: None, + repo_admin_change_team_access: None, + username: "header-test-org".into(), + visibility: None, + website: None, + }; + api.org_create(body).await.unwrap(); + test_header!( + api.org_list_teams("header-test-org", OrgListTeamsQuery::default()), + x_total_count + ); + test_header!(api.org_get_all(OrgGetAllQuery::default()), x_total_count); +} + +#[tokio::test] +async fn has_more() { + let api = common::login_pass("TestingAdmin", "password"); + + let git = Git::new("./test_repos/header_more_test"); + common::basic_repo(&api, &git, "header_more_test").await; + + git.run(&["switch", "-c", "pluey"]); + tokio::fs::write("./test_repos/header_more_test/pluey.txt", "wahoo") + .await + .unwrap(); + git.run(&["add", "."]); + git.run(&["commit", "-m", "\"We implemented pluey\""]); + git.run(&["push"]); + let body = CreatePullRequestOption { + assignee: None, + assignees: None, + base: Some("main".into()), + body: None, + due_date: None, + head: Some("pluey".into()), + labels: None, + milestone: None, + title: Some("pluey".into()), + }; + tokio::time::sleep(std::time::Duration::from_secs(2)).await; + api.repo_create_pull_request("TestingAdmin", "header_more_test", body) + .await + .unwrap(); + test_header!( + api.repo_get_pull_request_files( + "TestingAdmin", + "header_more_test", + 1, + RepoGetPullRequestFilesQuery::default() + ), + x_has_more + ); + test_header!( + api.repo_get_pull_request_commits( + "TestingAdmin", + "header_more_test", + 1, + RepoGetPullRequestCommitsQuery::default() + ), + x_has_more + ); +} diff --git a/tests/repo.rs b/tests/repo.rs index 389adba..6328e95 100644 --- a/tests/repo.rs +++ b/tests/repo.rs @@ -2,119 +2,7 @@ use forgejo_api::structs::*; mod common; -struct Git { - dir: &'static std::path::Path, -} - -impl Git { - fn new + ?Sized>(path: &'static T) -> Self { - let dir = path.as_ref(); - std::fs::create_dir_all(dir).unwrap(); - Self { dir } - } - - fn run(&self, args: &[impl AsRef]) { - let mut cmd = std::process::Command::new("git"); - cmd.current_dir(self.dir); - let _ = cmd.args(args).status().unwrap(); - } -} - -async fn setup_local_repo(git: &Git) { - git.run(&["config", "--global", "init.defaultBranch", "main"]); - git.run(&["init"]); - git.run(&["config", "user.name", "TestingAdmin"]); - git.run(&["config", "user.email", "admin@noreply.example.org"]); - tokio::fs::write(&git.dir.join("README.md"), "# Test\nThis is a test repo") - .await - .unwrap(); - git.run(&["add", "."]); - git.run(&["commit", "-m", "initial commit"]); -} - -async fn basic_repo(api: &forgejo_api::Forgejo, git: &Git, name: &str) -> Repository { - setup_local_repo(git).await; - let repo_opt = CreateRepoOption { - auto_init: Some(false), - default_branch: Some("main".into()), - description: Some("Test Repo".into()), - gitignores: Some("".into()), - issue_labels: Some("".into()), - license: Some("".into()), - name: name.into(), - object_format_name: None, - private: Some(false), - readme: None, - template: Some(false), - trust_model: Some(CreateRepoOptionTrustModel::Default), - }; - let remote_repo = api.create_current_user_repo(repo_opt).await.unwrap(); - assert!( - remote_repo.has_pull_requests.unwrap(), - "repo does not accept pull requests" - ); - assert!( - remote_repo.owner.as_ref().unwrap().login.as_ref().unwrap() == "TestingAdmin", - "repo owner is not \"TestingAdmin\"" - ); - assert!( - remote_repo.name.as_ref().unwrap() == name, - "repo name is not \"{name}\"" - ); - - let mut remote_url = remote_repo.clone_url.clone().unwrap(); - remote_url.set_username("TestingAdmin").unwrap(); - remote_url.set_password(Some("password")).unwrap(); - git.run(&["remote", "add", "origin", remote_url.as_str()]); - git.run(&["push", "-u", "origin", "main"]); - - remote_repo -} - -async fn basic_org_repo( - api: &forgejo_api::Forgejo, - git: &Git, - org: &str, - name: &str, -) -> Repository { - setup_local_repo(git).await; - - let repo_opt = CreateRepoOption { - auto_init: Some(false), - default_branch: Some("main".into()), - description: Some("Test Repo".into()), - gitignores: Some("".into()), - issue_labels: Some("".into()), - license: Some("".into()), - name: name.into(), - object_format_name: None, - private: Some(false), - readme: None, - template: Some(false), - trust_model: Some(CreateRepoOptionTrustModel::Default), - }; - let remote_repo = api.create_org_repo(org, repo_opt).await.unwrap(); - assert!( - remote_repo.has_pull_requests.unwrap(), - "repo does not accept pull requests" - ); - assert!( - remote_repo.owner.as_ref().unwrap().login.as_ref().unwrap() == org, - "repo owner is not \"TestingAdmin\"" - ); - assert!( - remote_repo.name.as_ref().unwrap() == name, - "repo name is not \"{name}\"" - ); - - let mut remote_url = remote_repo.clone_url.clone().unwrap(); - remote_url.set_username("TestingAdmin").unwrap(); - remote_url.set_password(Some("password")).unwrap(); - git.run(&["remote", "add", "origin", remote_url.as_str()]); - git.run(&["push", "-u", "origin", "main"]); - - remote_repo -} +use common::{basic_org_repo, basic_repo, Git}; #[tokio::test] async fn pull_request() { @@ -401,7 +289,7 @@ async fn tag_protection() { let git = Git::new("./test_repos/tag-protect"); let _ = basic_repo(&api, &git, "tag-protect").await; - let (_, tag_protections) = api + let tag_protections = api .repo_list_tag_protection("TestingAdmin", "tag-protect") .await .expect("failed to list tag protections");