diff --git a/Cargo.lock b/Cargo.lock index 6c22ec40..1a731970 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -4,9 +4,9 @@ version = 4 [[package]] name = "aho-corasick" -version = "1.1.3" +version = "1.1.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8e60d3430d3a69478ad0993f19238d2df97c507009a52b3c10addcd7f6bcb916" +checksum = "ddd31a130427c27518df266943a5308ed92d4b226cc639f5a8f1002816174301" dependencies = [ "memchr", ] @@ -58,29 +58,39 @@ dependencies = [ [[package]] name = "anstyle-query" -version = "1.1.4" +version = "1.1.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9e231f6134f61b71076a3eab506c379d4f36122f2af15a9ff04415ea4c3339e2" +checksum = "40c48f72fd53cd289104fc64099abca73db4166ad86ea0b4341abe65af83dadc" dependencies = [ - "windows-sys 0.60.2", + "windows-sys 0.61.2", ] [[package]] name = "anstyle-wincon" -version = "3.0.10" +version = "3.0.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3e0633414522a32ffaac8ac6cc8f748e090c5717661fddeea04219e2344f5f2a" +checksum = "291e6a250ff86cd4a820112fb8898808a366d8f9f58ce16d1f538353ad55747d" dependencies = [ "anstyle", "once_cell_polyfill", - "windows-sys 0.60.2", + "windows-sys 0.61.2", ] [[package]] name = "anyhow" -version = "1.0.100" +version = "1.0.101" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5f0e0fee31ef5ed1ba1316088939cea399010ed7731dba877ed44aeb407a75ea" + +[[package]] +name = "assert-json-diff" +version = "2.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a23eb6b1614318a8071c9b2521f36b424b2c83db5eb3a0fead4a6c0809af6e61" +checksum = "47e4f2b81832e72834d7518d8487a0396a28cc408186a2e8854c0f98011faf12" +dependencies = [ + "serde", + "serde_json", +] [[package]] name = "assert_cmd" @@ -97,6 +107,27 @@ dependencies = [ "wait-timeout", ] +[[package]] +name = "async-lock" +version = "3.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "290f7f2596bd5b78a9fec8088ccd89180d7f9f55b94b0576823bbbdc72ee8311" +dependencies = [ + "event-listener", + "event-listener-strategy", + "pin-project-lite", +] + +[[package]] +name = "async-object-pool" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e1ac0219111eb7bb7cb76d4cf2cb50c598e7ae549091d3616f9e95442c18486f" +dependencies = [ + "async-lock", + "event-listener", +] + [[package]] name = "async-stream" version = "0.3.6" @@ -155,9 +186,9 @@ checksum = "c08606f8c3cbf4ce6ec8e28fb0014a2c086708fe954eaa885384a6165172e7e8" [[package]] name = "aws-lc-rs" -version = "1.15.2" +version = "1.15.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6a88aab2464f1f25453baa7a07c84c5b7684e274054ba06817f382357f77a288" +checksum = "7b7b6141e96a8c160799cc2d5adecd5cbbe5054cb8c7c4af53da0f83bb7ad256" dependencies = [ "aws-lc-sys", "zeroize", @@ -165,9 +196,9 @@ dependencies = [ [[package]] name = "aws-lc-sys" -version = "0.35.0" +version = "0.37.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b45afffdee1e7c9126814751f88dddc747f41d91da16c9551a0f1e8a11e788a1" +checksum = "5c34dda4df7017c8db52132f0f8a2e0f8161649d15723ed63fc00c82d0f2081a" dependencies = [ "cc", "cmake", @@ -183,9 +214,9 @@ checksum = "72b3254f16251a8381aa12e40e3c4d2f0199f8c6508fbecb9d91f575e0fbb8c6" [[package]] name = "bitflags" -version = "2.9.4" +version = "2.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2261d10cca569e4643e526d8dc2e62e433cc8aba21ab764233731f8d369bf394" +checksum = "812e12b5285cc515a9c72a5c1d3b6d46a19dac5acfef5265968c166106e31dd3" [[package]] name = "block-buffer" @@ -198,9 +229,9 @@ dependencies = [ [[package]] name = "bstr" -version = "1.12.0" +version = "1.12.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "234113d19d0d7d613b40e86fb654acf958910802bcceab913a4f9e7cda03b1a4" +checksum = "63044e1ae8e69f3b5a92c736ca6269b8d12fa7efe39bf34ddb06d102cf0e2cab" dependencies = [ "memchr", "regex-automata", @@ -209,15 +240,18 @@ dependencies = [ [[package]] name = "bumpalo" -version = "3.19.0" +version = "3.19.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "46c5e41b57b8bba42a04676d81cb89e9ee8e859a1a66f80a5a72e1cb76b34d43" +checksum = "5dd9dc738b7a8311c7ade152424974d8115f2cdad61e8dab8dac9f2362298510" [[package]] name = "bytes" version = "1.11.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1e748733b7cbc798e1434b6ac524f0c1ff2ab456fe201501e6497c8417a4fc33" +dependencies = [ + "serde", +] [[package]] name = "camino" @@ -247,11 +281,17 @@ dependencies = [ "serde_yaml", ] +[[package]] +name = "cast" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "37b2a672a2cb129a2e41c10b1224bb368f9f37a2b16b612598138befd7b37eb5" + [[package]] name = "cc" -version = "1.2.51" +version = "1.2.55" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7a0aeaff4ff1a90589618835a598e545176939b97874f7abc7851caa0618f203" +checksum = "47b26a0954ae34af09b50f0de26458fa95369a0d478d8236d3f93082b219bd29" dependencies = [ "find-msvc-tools", "jobserver", @@ -267,9 +307,9 @@ checksum = "6d43a04d8753f35258c91f8ec639f792891f748a1edbd759cf1dcea3382ad83c" [[package]] name = "cfg-if" -version = "1.0.3" +version = "1.0.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2fd1289c04a9ea8cb22300a459a72a385d7c73d3259e2ed7dcb2af674838cfa9" +checksum = "9330f8b2ff13f34540b44e946ef35111825727b38d33286ef986142615121801" [[package]] name = "cfg_aliases" @@ -299,7 +339,7 @@ dependencies = [ "num-traits", "serde", "wasm-bindgen", - "windows-link 0.2.1", + "windows-link", ] [[package]] @@ -348,9 +388,9 @@ dependencies = [ [[package]] name = "clap_lex" -version = "0.7.6" +version = "0.7.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a1d728cc89cf3aee9ff92b05e62b19ee65a02b5702cff7d5a377e32c6ae29d8d" +checksum = "c3e64b0cc0439b12df2fa678eae89a1c56a529fd067a9115f7827f1fffd22b32" [[package]] name = "cmake" @@ -377,6 +417,15 @@ dependencies = [ "memchr", ] +[[package]] +name = "concurrent-queue" +version = "2.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4ca0197aee26d1ae37445ee532fefce43251d24cc7c166799f4d46817f1d3973" +dependencies = [ + "crossbeam-utils", +] + [[package]] name = "console" version = "0.15.11" @@ -451,9 +500,9 @@ checksum = "d0a5c400df2834b80a4c3327b3aad3a4c4cd4de0629063962b03235697506a28" [[package]] name = "crypto-common" -version = "0.1.6" +version = "0.1.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1bfb12502f3fc46cca1bb51ac28df9d618d813cdc3d2f25b9fe775a34af26bb3" +checksum = "78c8292055d1c1df0cce5d180393dc8cce0abec0a7102adb6c7b1eef6016d60a" dependencies = [ "generic-array", "typenum", @@ -467,9 +516,9 @@ checksum = "ffe7ed1d93f4553003e20b629abe9085e1e81b1429520f897f8f8860bc6dfc21" [[package]] name = "deranged" -version = "0.5.4" +version = "0.5.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a41953f86f8a05768a6cda24def994fd2f424b04ec5c719cf89989779f199071" +checksum = "ececcb659e7ba858fb4f10388c250a7252eb0a27373f1a72b8748afdd248e587" dependencies = [ "powerfmt", ] @@ -641,6 +690,27 @@ dependencies = [ "windows-sys 0.61.2", ] +[[package]] +name = "event-listener" +version = "5.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e13b66accf52311f30a0db42147dadea9850cb48cd070028831ae5f5d4b856ab" +dependencies = [ + "concurrent-queue", + "parking", + "pin-project-lite", +] + +[[package]] +name = "event-listener-strategy" +version = "0.5.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8be9f3dfaaffdae2972880079a491a1a8bb7cbed0b8dd7a347f668b4150a3b93" +dependencies = [ + "event-listener", + "pin-project-lite", +] + [[package]] name = "example-build" version = "0.0.1" @@ -708,9 +778,9 @@ checksum = "37909eebbb50d72f9059c3b6d82c0463f2ff062c9e95845c43a6c9c0355411be" [[package]] name = "find-msvc-tools" -version = "0.1.6" +version = "0.1.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "645cbb3a84e60b7531617d5ae4e57f7e27308f6445f5abf653209ea76dec8dff" +checksum = "5baebc0774151f905a1a2cc41989300b1e6fbb29aff0ceffa1064fdd3088d582" [[package]] name = "float-cmp" @@ -825,6 +895,12 @@ version = "0.3.31" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f90f7dce0722e95104fcb095585910c0977252f286e354b5e3bd38902cd99988" +[[package]] +name = "futures-timer" +version = "3.0.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f288b0a4f20f9a56b5d1da57e2227c661b7b16168e2f72365f57b63326e29b24" + [[package]] name = "futures-util" version = "0.3.31" @@ -845,9 +921,9 @@ dependencies = [ [[package]] name = "generic-array" -version = "0.14.9" +version = "0.14.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4bb6743198531e02858aeaea5398fcc883e71851fcbcb5a2f773e2fb6cb1edf2" +checksum = "85649ca51fd72272d7821adaf274ad91c288277713d9c18820d8499a7ff69e9a" dependencies = [ "typenum", "version_check", @@ -855,28 +931,28 @@ dependencies = [ [[package]] name = "getrandom" -version = "0.2.16" +version = "0.2.17" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "335ff9f135e4384c8150d6f27c6daed433577f86b4750418338c01a1a2528592" +checksum = "ff2abc00be7fca6ebc474524697ae276ad847ad0a6b3faa4bcb027e9a4614ad0" dependencies = [ "cfg-if", "js-sys", "libc", - "wasi 0.11.1+wasi-snapshot-preview1", + "wasi", "wasm-bindgen", ] [[package]] name = "getrandom" -version = "0.3.3" +version = "0.3.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "26145e563e54f2cadc477553f1ec5ee650b00862f0a58bcd12cbdc5f0ea2d2f4" +checksum = "899def5c37c4fd7b2664648c28120ecec138e4d395b459e5ca34f9cce2dd77fd" dependencies = [ "cfg-if", "js-sys", "libc", "r-efi", - "wasi 0.14.7+wasi-0.2.4", + "wasip2", "wasm-bindgen", ] @@ -896,9 +972,9 @@ dependencies = [ [[package]] name = "h2" -version = "0.4.12" +version = "0.4.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f3c0b69cfcb4e1b9f1bf2f53f95f766e4661169728ec61cd3fe5a0166f2d1386" +checksum = "2f44da3a8150a6703ed5d34e164b875fd14c2cdab9af1252a9a1020bde2bdc54" dependencies = [ "atomic-waker", "bytes", @@ -933,6 +1009,30 @@ dependencies = [ "foldhash 0.2.0", ] +[[package]] +name = "headers" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b3314d5adb5d94bcdf56771f2e50dbbc80bb4bdf88967526706205ac9eff24eb" +dependencies = [ + "base64", + "bytes", + "headers-core", + "http", + "httpdate", + "mime", + "sha1", +] + +[[package]] +name = "headers-core" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "54b4a22553d4242c49fddb9ba998a99962b5cc6f22cb5a3482bec22522403ce4" +dependencies = [ + "http", +] + [[package]] name = "heck" version = "0.5.0" @@ -947,11 +1047,11 @@ checksum = "fc0fef456e4baa96da950455cd02c081ca953b141298e41db3fc7e36b1da849c" [[package]] name = "home" -version = "0.5.11" +version = "0.5.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "589533453244b0995c858700322199b2becb13b627df2851f64a2775d024abcf" +checksum = "cc627f471c528ff0c4a49e1d5e60450c8f6461dd6d10ba9dcd3a61d3dff7728d" dependencies = [ - "windows-sys 0.59.0", + "windows-sys 0.61.2", ] [[package]] @@ -973,7 +1073,7 @@ checksum = "617aaa3557aef3810a6369d0a99fac8a080891b68bd9f9812a1eeda0c0730cbd" dependencies = [ "cfg-if", "libc", - "windows-link 0.2.1", + "windows-link", ] [[package]] @@ -1021,6 +1121,40 @@ version = "1.0.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "df3b46402a9d5adb4c86a0cf463f42e19994e3ee891101b1841f30a545cb49a9" +[[package]] +name = "httpmock" +version = "0.8.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bf4888a4d02d8e1f92ffb6b4965cf5ff56dda36ef41975f41c6fa0f6bde78c4e" +dependencies = [ + "assert-json-diff", + "async-object-pool", + "async-trait", + "base64", + "bytes", + "crossbeam-utils", + "form_urlencoded", + "futures-timer", + "futures-util", + "headers", + "http", + "http-body-util", + "hyper", + "hyper-util", + "path-tree", + "regex", + "serde", + "serde_json", + "serde_regex", + "similar", + "stringmetrics", + "tabwriter", + "thiserror 2.0.18", + "tokio", + "tracing", + "url", +] + [[package]] name = "hyper" version = "1.8.1" @@ -1053,7 +1187,7 @@ dependencies = [ "http", "hyper", "hyper-util", - "rustls 0.23.32", + "rustls 0.23.36", "rustls-pki-types", "tokio", "tokio-rustls 0.26.4", @@ -1062,14 +1196,13 @@ dependencies = [ [[package]] name = "hyper-util" -version = "0.1.19" +version = "0.1.20" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "727805d60e7938b76b826a6ef209eb70eaa1812794f9424d4a4e2d740662df5f" +checksum = "96547c2556ec9d12fb1578c4eaf448b04993e7fb79cbaad930a656880a6bdfa0" dependencies = [ "base64", "bytes", "futures-channel", - "futures-core", "futures-util", "http", "http-body", @@ -1089,9 +1222,9 @@ dependencies = [ [[package]] name = "iana-time-zone" -version = "0.1.64" +version = "0.1.65" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "33e57f83510bb73707521ebaffa789ec8caf86f9657cad665b092b581d40e9fb" +checksum = "e31bc9ad994ba00e440a8aa5c9ef0ec67d5cb5e5cb0cc7f8b744a35b389cc470" dependencies = [ "android_system_properties", "core-foundation-sys", @@ -1113,9 +1246,9 @@ dependencies = [ [[package]] name = "icu_collections" -version = "2.0.0" +version = "2.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "200072f5d0e3614556f94a9930d5dc3e0662a652823904c3a75dc3b0af7fee47" +checksum = "4c6b649701667bbe825c3b7e6388cb521c23d88644678e83c0c4d0a621a34b43" dependencies = [ "displaydoc", "potential_utf", @@ -1126,9 +1259,9 @@ dependencies = [ [[package]] name = "icu_locale_core" -version = "2.0.0" +version = "2.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0cde2700ccaed3872079a65fb1a78f6c0a36c91570f28755dda67bc8f7d9f00a" +checksum = "edba7861004dd3714265b4db54a3c390e880ab658fec5f7db895fae2046b5bb6" dependencies = [ "displaydoc", "litemap", @@ -1139,11 +1272,10 @@ dependencies = [ [[package]] name = "icu_normalizer" -version = "2.0.0" +version = "2.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "436880e8e18df4d7bbc06d58432329d6458cc84531f7ac5f024e93deadb37979" +checksum = "5f6c8828b67bf8908d82127b2054ea1b4427ff0230ee9141c54251934ab1b599" dependencies = [ - "displaydoc", "icu_collections", "icu_normalizer_data", "icu_properties", @@ -1154,42 +1286,38 @@ dependencies = [ [[package]] name = "icu_normalizer_data" -version = "2.0.0" +version = "2.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "00210d6893afc98edb752b664b8890f0ef174c8adbb8d0be9710fa66fbbf72d3" +checksum = "7aedcccd01fc5fe81e6b489c15b247b8b0690feb23304303a9e560f37efc560a" [[package]] name = "icu_properties" -version = "2.0.1" +version = "2.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "016c619c1eeb94efb86809b015c58f479963de65bdb6253345c1a1276f22e32b" +checksum = "020bfc02fe870ec3a66d93e677ccca0562506e5872c650f893269e08615d74ec" dependencies = [ - "displaydoc", "icu_collections", "icu_locale_core", "icu_properties_data", "icu_provider", - "potential_utf", "zerotrie", "zerovec", ] [[package]] name = "icu_properties_data" -version = "2.0.1" +version = "2.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "298459143998310acd25ffe6810ed544932242d3f07083eee1084d83a71bd632" +checksum = "616c294cf8d725c6afcd8f55abc17c56464ef6211f9ed59cccffe534129c77af" [[package]] name = "icu_provider" -version = "2.0.0" +version = "2.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "03c80da27b5f4187909049ee2d72f276f0d9f99a42c306bd0131ecfe04d8e5af" +checksum = "85962cf0ce02e1e0a629cc34e7ca3e373ce20dda4c4d7294bbd0bf1fdb59e614" dependencies = [ "displaydoc", "icu_locale_core", - "stable_deref_trait", - "tinystr", "writeable", "yoke", "zerofrom", @@ -1244,9 +1372,9 @@ checksum = "469fb0b9cefa57e3ef31275ee7cacb78f2fdca44e4765491884a2b119d4eb130" [[package]] name = "iri-string" -version = "0.7.8" +version = "0.7.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dbc5ebe9c3a1a7a5127f920a418f7585e9e758e911d0466ed004f393b0e380b2" +checksum = "c91338f0783edbd6195decb37bae672fd3b165faffb89bf7b9e6942f8b1a731a" dependencies = [ "memchr", "serde", @@ -1254,45 +1382,45 @@ dependencies = [ [[package]] name = "is-terminal" -version = "0.4.16" +version = "0.4.17" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e04d7f318608d35d4b61ddd75cbdaee86b023ebe2bd5a66ee0915f0bf93095a9" +checksum = "3640c1c38b8e4e43584d8df18be5fc6b0aa314ce6ebf51b53313d4306cca8e46" dependencies = [ "hermit-abi", "libc", - "windows-sys 0.59.0", + "windows-sys 0.61.2", ] [[package]] name = "is_terminal_polyfill" -version = "1.70.1" +version = "1.70.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7943c866cc5cd64cbc25b2e01621d07fa8eb2a1a23160ee81ce38704e97b8ecf" +checksum = "a6cb138bb79a146c1bd460005623e142ef0181e3d0219cb493e02f7d08a35695" [[package]] name = "itoa" -version = "1.0.15" +version = "1.0.17" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4a5f13b858c8d314ee3e8f639011f7ccefe71f97f96e50151fb991f267928e2c" +checksum = "92ecc6618181def0457392ccd0ee51198e065e016d1d527a7ac1b6dc7c1f09d2" [[package]] name = "jiff" -version = "0.2.15" +version = "0.2.19" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "be1f93b8b1eb69c77f24bbb0afdf66f54b632ee39af40ca21c4365a1d7347e49" +checksum = "d89a5b5e10d5a9ad6e5d1f4bd58225f655d6fe9767575a5e8ac5a6fe64e04495" dependencies = [ "jiff-static", "log", "portable-atomic", "portable-atomic-util", - "serde", + "serde_core", ] [[package]] name = "jiff-static" -version = "0.2.15" +version = "0.2.19" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "03343451ff899767262ec32146f6d559dd759fdadf42ff0e227c7c48f72594b4" +checksum = "ff7a39c8862fc1369215ccf0a8f12dd4598c7f6484704359f0351bd617034dbf" dependencies = [ "proc-macro2", "quote", @@ -1327,15 +1455,15 @@ version = "0.1.34" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9afb3de4395d6b3e67a780b6de64b51c978ecf11cb9a462c66be7d4ca9039d33" dependencies = [ - "getrandom 0.3.3", + "getrandom 0.3.4", "libc", ] [[package]] name = "js-sys" -version = "0.3.81" +version = "0.3.85" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ec48937a97411dcb524a265206ccd4c90bb711fca92b2792c407f268825b9305" +checksum = "8c942ebf8e95485ca0d52d97da7c5a2c387d0e7f0ba4c35e93bfcaee045955b3" dependencies = [ "once_cell", "wasm-bindgen", @@ -1349,9 +1477,15 @@ checksum = "09edd9e8b54e49e587e4f6295a7d29c3ea94d469cb40ab8ca70b288248a81db2" [[package]] name = "libc" -version = "0.2.177" +version = "0.2.181" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "459427e2af2b9c839b132acb702a1c654d95e10f8c326bfc2ad11310e458b1c5" + +[[package]] +name = "libm" +version = "0.2.16" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2874a2af47a2325c2001a6e6fad9b16a53b802102b528163885171cf92b15976" +checksum = "b6d2cec3eae94f9f509c767b45932f1ada8350c4bdb85af2fcab4a3c14807981" [[package]] name = "linux-raw-sys" @@ -1367,9 +1501,9 @@ checksum = "df1d3c3b53da64cf5760482273a98e575c651a67eec7f77df96b5b642de8f039" [[package]] name = "litemap" -version = "0.8.0" +version = "0.8.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "241eaef5fd12c88705a01fc1066c48c4b36e0dd4377dcdc7ec3942cea7a69956" +checksum = "6373607a59f0be73a39b6fe456b8192fcc3585f602af20751600e974dd455e77" [[package]] name = "lock_api" @@ -1400,9 +1534,9 @@ checksum = "ffbee8634e0d45d258acb448e7eaab3fce7a0a467395d4d9f228e3c1f01fb2e4" [[package]] name = "memchr" -version = "2.7.6" +version = "2.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f52b00d39961fc5b2736ea853c9cc86238e165017a493d1d5c8eac6bdc4cc273" +checksum = "f8ca58f447f06ed17d5fc4043ce1b10dd205e060fb3ce5b979b8ed8e59ff3f79" [[package]] name = "mime" @@ -1412,9 +1546,9 @@ checksum = "6877bb514081ee2a7ff5ef9de3281f14a4dd4bceac4c09388074a6b5df8a139a" [[package]] name = "minicov" -version = "0.3.7" +version = "0.3.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f27fe9f1cc3c22e1687f9446c2083c4c5fc7f0bcf1c7a86bdbded14985895b4b" +checksum = "4869b6a491569605d66d3952bcdf03df789e5b536e5f0cf7758a7f08a55ae24d" dependencies = [ "cc", "walkdir", @@ -1422,13 +1556,13 @@ dependencies = [ [[package]] name = "mio" -version = "1.0.4" +version = "1.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "78bed444cc8a2160f01cbcf811ef18cac863ad68ae8ca62092e8db51d51c761c" +checksum = "a69bcab0ad47271a0234d9422b131806bf3968021e5dc9328caf2d4cd58557fc" dependencies = [ "libc", - "wasi 0.11.1+wasi-snapshot-preview1", - "windows-sys 0.59.0", + "wasi", + "windows-sys 0.61.2", ] [[package]] @@ -1463,6 +1597,15 @@ version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "61807f77802ff30975e01f4f071c8ba10c022052f98b3294119f3e615d13e5be" +[[package]] +name = "nu-ansi-term" +version = "0.50.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7957b9740744892f114936ab4a57b3f487491bbeafaf8083688b16841a4240e5" +dependencies = [ + "windows-sys 0.61.2", +] + [[package]] name = "num-conv" version = "0.2.0" @@ -1476,6 +1619,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "071dfc062690e90b734c0b2273ce72ad0ffa95f0c74596bc250dcfd960262841" dependencies = [ "autocfg", + "libm", ] [[package]] @@ -1495,9 +1639,15 @@ checksum = "42f5e15c9953c5e4ccceeb2e7382a716482c34515315f7b03532b8b4e8393d2d" [[package]] name = "once_cell_polyfill" -version = "1.70.1" +version = "1.70.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a4895175b425cb1f87721b59f0f286c2092bd4af812243672510e1ac53e2e0ad" +checksum = "384b8ab6d37215f3c5301a95a4accb5d64aa607f1fcb26a11b5303878451b4fe" + +[[package]] +name = "oorandom" +version = "11.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d6790f58c7ff633d8771f42965289203411a5e5c68388703c06e14f24770b41e" [[package]] name = "openapiv3" @@ -1512,9 +1662,15 @@ dependencies = [ [[package]] name = "openssl-probe" -version = "0.2.0" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7c87def4c32ab89d880effc9e097653c8da5d6ef28e6b539d313baaacfbafcbe" + +[[package]] +name = "parking" +version = "2.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9f50d9b3dabb09ecd771ad0aa242ca6894994c130308ca3d7684634df8037391" +checksum = "f38d5652c16fde515bb1ecef450ab0f6a219d619a7274976324d5e377f7dceba" [[package]] name = "parking_lot" @@ -1536,7 +1692,7 @@ dependencies = [ "libc", "redox_syscall", "smallvec", - "windows-link 0.2.1", + "windows-link", ] [[package]] @@ -1545,6 +1701,15 @@ version = "1.0.15" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "57c0d7b74b563b49d38dae00a0c37d4d6de9b432382b2892f0574ddcae73fd0a" +[[package]] +name = "path-tree" +version = "0.8.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c2a97453bc21a968f722df730bfe11bd08745cb50d1300b0df2bda131dece136" +dependencies = [ + "smallvec", +] + [[package]] name = "percent-encoding" version = "2.3.2" @@ -1565,24 +1730,24 @@ checksum = "8b870d8c151b6f2fb93e84a13146138f05d02ed11c7e7c54f8826aaaf7c9f184" [[package]] name = "portable-atomic" -version = "1.11.1" +version = "1.13.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f84267b20a16ea918e43c6a88433c2d54fa145c92a811b5b047ccbe153674483" +checksum = "c33a9471896f1c69cecef8d20cbe2f7accd12527ce60845ff44c153bb2a21b49" [[package]] name = "portable-atomic-util" -version = "0.2.4" +version = "0.2.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d8a2f0d8d040d7848a709caf78912debcc3f33ee4b3cac47d73d1e1069e83507" +checksum = "7a9db96d7fa8782dd8c15ce32ffe8680bbd1e978a43bf51a34d39483540495f5" dependencies = [ "portable-atomic", ] [[package]] name = "potential_utf" -version = "0.1.3" +version = "0.1.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "84df19adbe5b5a0782edcab45899906947ab039ccf4573713735ee7de1e6b08a" +checksum = "b73949432f5e2a09657003c25bca5e19a0e9c84f8058ca374f49e0ebe605af77" dependencies = [ "zerovec", ] @@ -1696,6 +1861,7 @@ dependencies = [ "futures", "heck", "http", + "httpmock", "hyper", "indexmap", "openapiv3", @@ -1745,7 +1911,7 @@ dependencies = [ "quinn-proto", "quinn-udp", "rustc-hash", - "rustls 0.23.32", + "rustls 0.23.36", "socket2", "thiserror 2.0.18", "tokio", @@ -1761,12 +1927,12 @@ checksum = "f1906b49b0c3bc04b5fe5d86a77925ae6524a19b816ae38ce1e426255f1d8a31" dependencies = [ "aws-lc-rs", "bytes", - "getrandom 0.3.3", + "getrandom 0.3.4", "lru-slab", "rand 0.9.2", "ring", "rustc-hash", - "rustls 0.23.32", + "rustls 0.23.36", "rustls-pki-types", "slab", "thiserror 2.0.18", @@ -1811,7 +1977,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6db2770f06117d490610c7488547d543617b21bfa07796d7a12f6f1bd53850d1" dependencies = [ "rand_chacha", - "rand_core 0.9.3", + "rand_core 0.9.5", ] [[package]] @@ -1832,16 +1998,16 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d3022b5f1df60f26e1ffddd6c66e8aa15de382ae63b3a0c1bfc0e4d3e3f325cb" dependencies = [ "ppv-lite86", - "rand_core 0.9.3", + "rand_core 0.9.5", ] [[package]] name = "rand_core" -version = "0.9.3" +version = "0.9.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "99d9a13982dcf210057a8a78572b2217b667c3beacbf3a0d8b454f6f82837d38" +checksum = "76afc826de14238e6e8c374ddcc1fa19e374fd8dd986b0d2af0d02377261d83c" dependencies = [ - "getrandom 0.3.3", + "getrandom 0.3.4", ] [[package]] @@ -1861,9 +2027,9 @@ dependencies = [ [[package]] name = "regex" -version = "1.12.2" +version = "1.12.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "843bc0191f75f3e22651ae5f1e72939ab2f72a4bc30fa80a066bd66edefc24d4" +checksum = "e10754a14b9137dd7b1e3e5b0493cc9171fdd105e0ab477f51b72e7f3ac0e276" dependencies = [ "aho-corasick", "memchr", @@ -1873,9 +2039,9 @@ dependencies = [ [[package]] name = "regex-automata" -version = "0.4.13" +version = "0.4.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5276caf25ac86c8d810222b3dbb938e512c55c6831a10f3e6ed1c93b84041f1c" +checksum = "6e1dd4122fc1595e8162618945476892eefca7b88c52820e74af6262213cae8f" dependencies = [ "aho-corasick", "memchr", @@ -1884,9 +2050,9 @@ dependencies = [ [[package]] name = "regex-syntax" -version = "0.8.8" +version = "0.8.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7a2d987857b319362043e95f5353c0535c1f58eec5336fdfcf626430af7def58" +checksum = "a96887878f22d7bad8a3b6dc5b7440e0ada9a245242924394987b21cf2210a4c" [[package]] name = "regress" @@ -1900,9 +2066,9 @@ dependencies = [ [[package]] name = "reqwest" -version = "0.13.1" +version = "0.13.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "04e9018c9d814e5f30cc16a0f03271aeab3571e609612d9fe78c1aa8d11c2f62" +checksum = "ab3f43e3283ab1488b624b44b0e988d0acea0b3214e694730a055cb6b2efa801" dependencies = [ "base64", "bytes", @@ -1922,7 +2088,7 @@ dependencies = [ "percent-encoding", "pin-project-lite", "quinn", - "rustls 0.23.32", + "rustls 0.23.36", "rustls-pki-types", "rustls-platform-verifier", "serde", @@ -1950,7 +2116,7 @@ checksum = "a4689e6c2294d81e88dc6261c768b63bc4fcdb852be6d1352498b114f61383b7" dependencies = [ "cc", "cfg-if", - "getrandom 0.2.16", + "getrandom 0.2.17", "libc", "untrusted", "windows-sys 0.52.0", @@ -1990,9 +2156,9 @@ dependencies = [ [[package]] name = "rustix" -version = "1.1.2" +version = "1.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cd15f8a2c5551a84d56efdc1cd049089e409ac19a3072d5037a17fd70719ff3e" +checksum = "146c9e247ccc180c1f61615433868c99f3de3ae256a30a43b49f67c2d9171f34" dependencies = [ "bitflags", "errno", @@ -2017,14 +2183,14 @@ dependencies = [ [[package]] name = "rustls" -version = "0.23.32" +version = "0.23.36" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cd3c25631629d034ce7cd9940adc9d45762d46de2b0f57193c4443b92c6d4d40" +checksum = "c665f33d38cea657d9614f766881e4d510e0eda4239891eea56b4cadcf01801b" dependencies = [ "aws-lc-rs", "once_cell", "rustls-pki-types", - "rustls-webpki 0.103.7", + "rustls-webpki 0.103.9", "subtle", "zeroize", ] @@ -2052,9 +2218,9 @@ dependencies = [ [[package]] name = "rustls-pki-types" -version = "1.12.0" +version = "1.14.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "229a4a4c221013e7e1f1a043678c5cc39fe5171437c88fb47151a21e6f5b5c79" +checksum = "be040f8b0a225e40375822a563fa9524378b9d63112f53e19ffff34df5d33fdd" dependencies = [ "web-time", "zeroize", @@ -2071,10 +2237,10 @@ dependencies = [ "jni", "log", "once_cell", - "rustls 0.23.32", + "rustls 0.23.36", "rustls-native-certs", "rustls-platform-verifier-android", - "rustls-webpki 0.103.7", + "rustls-webpki 0.103.9", "security-framework", "security-framework-sys", "webpki-root-certs", @@ -2100,9 +2266,9 @@ dependencies = [ [[package]] name = "rustls-webpki" -version = "0.103.7" +version = "0.103.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e10b3f4191e8a80e6b43eebabfac91e5dcecebb27a71f04e820c47ec41d314bf" +checksum = "d7df23109aa6c1567d1c575b9952556388da57401e4ace1d15f79eedad0d8f53" dependencies = [ "aws-lc-rs", "ring", @@ -2118,9 +2284,9 @@ checksum = "b39cdef0fa800fc44525c84ccb54a029961a8215f9619753635a9c0d2538d46d" [[package]] name = "ryu" -version = "1.0.20" +version = "1.0.23" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "28d3b2b1366ec20994f1fd18c3c594f05c5dd4bc44d8bb0c1c632c8d6829481f" +checksum = "9774ba4a74de5f7b1c1451ed6cd5285a32eddb5cccb8cc655a4e50009e06477f" [[package]] name = "same-file" @@ -2270,6 +2436,16 @@ dependencies = [ "serde_core", ] +[[package]] +name = "serde_regex" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a8136f1a4ea815d7eac4101cfd0b16dc0cb5e1fe1b8609dfd728058656b7badf" +dependencies = [ + "regex", + "serde", +] + [[package]] name = "serde_spanned" version = "0.6.9" @@ -2344,10 +2520,11 @@ checksum = "0fda2ff0d084019ba4d7c6f371c95d8fd75ce3524c3cb8fb653a3023f6323e64" [[package]] name = "signal-hook-registry" -version = "1.4.6" +version = "1.4.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b2a4719bff48cee6b39d12c020eeb490953ad2443b7055bd0b21fca26bd8c28b" +checksum = "c4db69cba1110affc0e9f7bcd48bbf87b3f4fc7c61fc9155afd4c469eb3d6c1b" dependencies = [ + "errno", "libc", ] @@ -2359,9 +2536,9 @@ checksum = "bbbb5d9659141646ae647b42fe094daf6c6192d1620870b449d9557f748b2daa" [[package]] name = "slab" -version = "0.4.11" +version = "0.4.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7a2ae44ef20feb57a68b23d846850f861394c2e02dc425a50098ae8c90267589" +checksum = "0c790de23124f9ab44544d7ac05d60440adc586479ce501c1d6d7da3cd8c9cf5" [[package]] name = "slog" @@ -2433,9 +2610,9 @@ checksum = "67b1b7a3b5fe4f1376887184045fcf45c69e92af734b7aaddc05fb777b6fbd03" [[package]] name = "socket2" -version = "0.6.1" +version = "0.6.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "17129e116933cf371d018bb80ae557e889637989d8638274fb25622827b03881" +checksum = "86f4aa3ad99f2088c990dfa82d367e19cb29268ed67c574d10d0a4bfe71f07e0" dependencies = [ "libc", "windows-sys 0.60.2", @@ -2453,6 +2630,12 @@ version = "1.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6ce2be8dc25455e1f91df71bfa12ad37d7af1092ae736f3a6cd0e37bc7810596" +[[package]] +name = "stringmetrics" +version = "2.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7b3c8667cd96245cbb600b8dec5680a7319edd719c5aa2b5d23c6bff94f39765" + [[package]] name = "strsim" version = "0.11.1" @@ -2498,9 +2681,9 @@ dependencies = [ [[package]] name = "system-configuration" -version = "0.6.1" +version = "0.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3c879d448e9d986b661742763247d3693ed13609438cf3d006f51f5368a5ba6b" +checksum = "a13f3d0daba03132c0aa9767f98351b3488edc2c100cda2d2ec2b04f3d8d3c8b" dependencies = [ "bitflags", "core-foundation 0.9.4", @@ -2517,6 +2700,15 @@ dependencies = [ "libc", ] +[[package]] +name = "tabwriter" +version = "1.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fce91f2f0ec87dff7e6bcbbeb267439aa1188703003c6055193c821487400432" +dependencies = [ + "unicode-width", +] + [[package]] name = "take_mut" version = "0.2.2" @@ -2525,22 +2717,22 @@ checksum = "f764005d11ee5f36500a149ace24e00e3da98b0158b3e2d53a7495660d3f4d60" [[package]] name = "tempfile" -version = "3.23.0" +version = "3.25.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2d31c77bdf42a745371d260a26ca7163f1e0924b64afa0b688e61b5a9fa02f16" +checksum = "0136791f7c95b1f6dd99f9cc786b91bb81c3800b639b3478e561ddb7be95e5f1" dependencies = [ "fastrand", - "getrandom 0.3.3", + "getrandom 0.4.1", "once_cell", - "rustix 1.1.2", + "rustix 1.1.3", "windows-sys 0.61.2", ] [[package]] name = "term" -version = "1.2.0" +version = "1.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2111ef44dae28680ae9752bb89409e7310ca33a8c621ebe7b106cf5c928b3ac0" +checksum = "d8c27177b12a6399ffc08b98f76f7c9a1f4fe9fc967c784c5a071fa8d93cf7e1" dependencies = [ "windows-sys 0.61.2", ] @@ -2635,9 +2827,9 @@ dependencies = [ [[package]] name = "tinystr" -version = "0.8.1" +version = "0.8.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5d4f6d1145dcb577acf783d4e601bc1d76a13337bb54e6233add580b07344c8b" +checksum = "42d3e9c45c09de15d06dd8acf5f4e0e399e85927b7f00711024eb7ae10fa4869" dependencies = [ "displaydoc", "zerovec", @@ -2703,15 +2895,15 @@ version = "0.26.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1729aa945f29d91ba541258c8df89027d5792d85a8841fb65e8bf0f4ede4ef61" dependencies = [ - "rustls 0.23.32", + "rustls 0.23.36", "tokio", ] [[package]] name = "tokio-util" -version = "0.7.16" +version = "0.7.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "14307c986784f72ef81c89db7d9e28d6ac26d16213b109ea501696195e6e3ce5" +checksum = "9ae9cec805b01e8fc3fd2fe289f89149a9b66dd16786abd8b19cfa7b48cb0098" dependencies = [ "bytes", "futures-core", @@ -2815,9 +3007,9 @@ dependencies = [ [[package]] name = "tower" -version = "0.5.2" +version = "0.5.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d039ad9159c98b70ecfd540b2573b97f7f52c3e8d9f8ad57a24b916a536975f9" +checksum = "ebe5ef63511595f1344e2d5cfa636d973292adc0eec1f0ad45fae9f0851ab1d4" dependencies = [ "futures-core", "futures-util", @@ -2860,19 +3052,32 @@ checksum = "8df9b6e13f2d32c91b9bd719c00d1958837bc7dec474d94952798cc8e69eeec3" [[package]] name = "tracing" -version = "0.1.41" +version = "0.1.44" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "784e0ac535deb450455cbfa28a6f0df145ea1bb7ae51b821cf5e7927fdcfbdd0" +checksum = "63e71662fa4b2a2c3a26f570f037eb95bb1f85397f3cd8076caed2f026a6d100" dependencies = [ + "log", "pin-project-lite", + "tracing-attributes", "tracing-core", ] +[[package]] +name = "tracing-attributes" +version = "0.1.31" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7490cfa5ec963746568740651ac6781f701c9c5ea257c58e057f3ba8cf69e8da" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + [[package]] name = "tracing-core" -version = "0.1.34" +version = "0.1.36" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b9d12581f227e93f094d3af2ae690a574abb8a2b9b7a96e7cfe9647b2b617678" +checksum = "db97caf9d906fbde555dd62fa95ddba9eecfd14cb388e4f491a66d74cd5fb79a" dependencies = [ "once_cell", ] @@ -2938,9 +3143,9 @@ dependencies = [ [[package]] name = "unicode-ident" -version = "1.0.22" +version = "1.0.23" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9312f7c4f6ff9069b165498234ce8be658059c6728633667c526e27dc2cf1df5" +checksum = "537dd038a89878be9b64dd4bd1b260315c1bb94f4d784956b81e27a088d9a09e" [[package]] name = "unicode-segmentation" @@ -3002,7 +3207,7 @@ version = "1.20.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ee48d38b119b0cd71fe4141b30f5ba9c7c5d9f4e7a3a8b4a674e4b6ef789976f" dependencies = [ - "getrandom 0.3.3", + "getrandom 0.3.4", "js-sys", "serde_core", "wasm-bindgen", @@ -3057,22 +3262,13 @@ version = "0.11.1+wasi-snapshot-preview1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ccf3ec651a847eb01de73ccad15eb7d99f80485de043efb2f370cd654f4ea44b" -[[package]] -name = "wasi" -version = "0.14.7+wasi-0.2.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "883478de20367e224c0090af9cf5f9fa85bed63a95c1abf3afc5c083ebc06e8c" -dependencies = [ - "wasip2", -] - [[package]] name = "wasip2" -version = "1.0.1+wasi-0.2.4" +version = "1.0.2+wasi-0.2.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0562428422c63773dad2c345a1882263bbf4d65cf3f42e90921f787ef5ad58e7" +checksum = "9517f9239f02c069db75e65f174b3da828fe5f5b945c4dd26bd25d89c03ebcf5" dependencies = [ - "wit-bindgen 0.46.0", + "wit-bindgen", ] [[package]] @@ -3081,14 +3277,14 @@ version = "0.4.0+wasi-0.3.0-rc-2026-01-06" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5428f8bf88ea5ddc08faddef2ac4a67e390b88186c703ce6dbd955e1c145aca5" dependencies = [ - "wit-bindgen 0.51.0", + "wit-bindgen", ] [[package]] name = "wasm-bindgen" -version = "0.2.104" +version = "0.2.108" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c1da10c01ae9f1ae40cbfac0bac3b1e724b320abfcf52229f80b547c0d250e2d" +checksum = "64024a30ec1e37399cf85a7ffefebdb72205ca1c972291c51512360d90bd8566" dependencies = [ "cfg-if", "once_cell", @@ -3097,27 +3293,14 @@ dependencies = [ "wasm-bindgen-shared", ] -[[package]] -name = "wasm-bindgen-backend" -version = "0.2.104" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "671c9a5a66f49d8a47345ab942e2cb93c7d1d0339065d4f8139c486121b43b19" -dependencies = [ - "bumpalo", - "log", - "proc-macro2", - "quote", - "syn", - "wasm-bindgen-shared", -] - [[package]] name = "wasm-bindgen-futures" -version = "0.4.54" +version = "0.4.58" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7e038d41e478cc73bae0ff9b36c60cff1c98b8f38f8d7e8061e79ee63608ac5c" +checksum = "70a6e77fd0ae8029c9ea0063f87c46fde723e7d887703d74ad2616d792e51e6f" dependencies = [ "cfg-if", + "futures-util", "js-sys", "once_cell", "wasm-bindgen", @@ -3126,9 +3309,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-macro" -version = "0.2.104" +version = "0.2.108" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7ca60477e4c59f5f2986c50191cd972e3a50d8a95603bc9434501cf156a9a119" +checksum = "008b239d9c740232e71bd39e8ef6429d27097518b6b30bdf9086833bd5b6d608" dependencies = [ "quote", "wasm-bindgen-macro-support", @@ -3136,50 +3319,65 @@ dependencies = [ [[package]] name = "wasm-bindgen-macro-support" -version = "0.2.104" +version = "0.2.108" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9f07d2f20d4da7b26400c9f4a0511e6e0345b040694e8a75bd41d578fa4421d7" +checksum = "5256bae2d58f54820e6490f9839c49780dff84c65aeab9e772f15d5f0e913a55" dependencies = [ + "bumpalo", "proc-macro2", "quote", "syn", - "wasm-bindgen-backend", "wasm-bindgen-shared", ] [[package]] name = "wasm-bindgen-shared" -version = "0.2.104" +version = "0.2.108" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bad67dc8b2a1a6e5448428adec4c3e84c43e561d8c9ee8a9e5aabeb193ec41d1" +checksum = "1f01b580c9ac74c8d8f0c0e4afb04eeef2acf145458e52c03845ee9cd23e3d12" dependencies = [ "unicode-ident", ] [[package]] name = "wasm-bindgen-test" -version = "0.3.54" +version = "0.3.58" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4e381134e148c1062f965a42ed1f5ee933eef2927c3f70d1812158f711d39865" +checksum = "45649196a53b0b7a15101d845d44d2dda7374fc1b5b5e2bbf58b7577ff4b346d" dependencies = [ + "async-trait", + "cast", "js-sys", + "libm", "minicov", + "nu-ansi-term", + "num-traits", + "oorandom", + "serde", + "serde_json", "wasm-bindgen", "wasm-bindgen-futures", "wasm-bindgen-test-macro", + "wasm-bindgen-test-shared", ] [[package]] name = "wasm-bindgen-test-macro" -version = "0.3.54" +version = "0.3.58" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b673bca3298fe582aeef8352330ecbad91849f85090805582400850f8270a2e8" +checksum = "f579cdd0123ac74b94e1a4a72bd963cf30ebac343f2df347da0b8df24cdebed2" dependencies = [ "proc-macro2", "quote", "syn", ] +[[package]] +name = "wasm-bindgen-test-shared" +version = "0.2.108" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a8145dd1593bf0fb137dbfa85b8be79ec560a447298955877804640e40c2d6ea" + [[package]] name = "wasm-encoder" version = "0.244.0" @@ -3204,9 +3402,9 @@ dependencies = [ [[package]] name = "wasm-streams" -version = "0.4.2" +version = "0.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "15053d8d85c7eccdbefef60f06769760a563c7f0a9d6902a13d35c7800b0ad65" +checksum = "9d1ec4f6517c9e11ae630e200b2b65d193279042e28edd4a2cda233e46670bbb" dependencies = [ "futures-util", "js-sys", @@ -3229,9 +3427,9 @@ dependencies = [ [[package]] name = "web-sys" -version = "0.3.81" +version = "0.3.85" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9367c417a924a74cae129e6a2ae3b47fabb1f8995595ab474029da749a8be120" +checksum = "312e32e551d92129218ea9a2452120f4aabc03529ef03e4d0d82fb2780608598" dependencies = [ "js-sys", "wasm-bindgen", @@ -3249,9 +3447,9 @@ dependencies = [ [[package]] name = "webpki-root-certs" -version = "1.0.5" +version = "1.0.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "36a29fc0408b113f68cf32637857ab740edfafdf460c326cd2afaa2d84cc05dc" +checksum = "804f18a4ac2676ffb4e8b5b5fa9ae38af06df08162314f96a68d2a363e21a8ca" dependencies = [ "rustls-pki-types", ] @@ -3295,9 +3493,9 @@ checksum = "b8e83a14d34d0623b51dce9581199302a221863196a1dde71a7663a4c2be9deb" dependencies = [ "windows-implement", "windows-interface", - "windows-link 0.2.1", - "windows-result 0.4.1", - "windows-strings 0.5.1", + "windows-link", + "windows-result", + "windows-strings", ] [[package]] @@ -3322,12 +3520,6 @@ dependencies = [ "syn", ] -[[package]] -name = "windows-link" -version = "0.1.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5e6ad25900d524eaabdbbb96d20b4311e1e7ae1699af4fb28c17ae66c80d798a" - [[package]] name = "windows-link" version = "0.2.1" @@ -3336,22 +3528,13 @@ checksum = "f0805222e57f7521d6a62e36fa9163bc891acd422f971defe97d64e70d0a4fe5" [[package]] name = "windows-registry" -version = "0.5.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5b8a9ed28765efc97bbc954883f4e6796c33a06546ebafacbabee9696967499e" -dependencies = [ - "windows-link 0.1.3", - "windows-result 0.3.4", - "windows-strings 0.4.2", -] - -[[package]] -name = "windows-result" -version = "0.3.4" +version = "0.6.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "56f42bd332cc6c8eac5af113fc0c1fd6a8fd2aa08a0119358686e5160d0586c6" +checksum = "02752bf7fbdcce7f2a27a742f798510f3e5ad88dbe84871e5168e2120c3d5720" dependencies = [ - "windows-link 0.1.3", + "windows-link", + "windows-result", + "windows-strings", ] [[package]] @@ -3360,16 +3543,7 @@ version = "0.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7781fa89eaf60850ac3d2da7af8e5242a5ea78d1a11c49bf2910bb5a73853eb5" dependencies = [ - "windows-link 0.2.1", -] - -[[package]] -name = "windows-strings" -version = "0.4.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "56e6c93f3a0c3b36176cb1327a4958a0353d5d166c2a35cb268ace15e91d3b57" -dependencies = [ - "windows-link 0.1.3", + "windows-link", ] [[package]] @@ -3378,7 +3552,7 @@ version = "0.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7837d08f69c77cf6b07689544538e017c1bfcf57e34b4c0ff58e6c2cd3b37091" dependencies = [ - "windows-link 0.2.1", + "windows-link", ] [[package]] @@ -3423,7 +3597,7 @@ version = "0.61.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ae137229bcbd6cdf0f7b80a31df61766145077ddf49416a728b02cb3921ff3fc" dependencies = [ - "windows-link 0.2.1", + "windows-link", ] [[package]] @@ -3463,7 +3637,7 @@ version = "0.53.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4945f9f551b88e0d65f3db0bc25c33b8acea4d9e41163edf90dcd0b19f9069f3" dependencies = [ - "windows-link 0.2.1", + "windows-link", "windows_aarch64_gnullvm 0.53.1", "windows_aarch64_msvc 0.53.1", "windows_i686_gnu 0.53.1", @@ -3614,19 +3788,13 @@ checksum = "d6bbff5f0aada427a1e5a6da5f1f98158182f26556f345ac9e04d36d0ebed650" [[package]] name = "winnow" -version = "0.7.13" +version = "0.7.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "21a0236b59786fed61e2a80582dd500fe61f18b5dca67a4a067d0bc9039339cf" +checksum = "5a5364e9d77fcdeeaa6062ced926ee3381faa2ee02d3eb83a5c27a8825540829" dependencies = [ "memchr", ] -[[package]] -name = "wit-bindgen" -version = "0.46.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f17a85883d4e6d00e8a97c586de764dabcc06133f7f1d55dce5cdc070ad7fe59" - [[package]] name = "wit-bindgen" version = "0.51.0" @@ -3717,17 +3885,16 @@ dependencies = [ [[package]] name = "writeable" -version = "0.6.1" +version = "0.6.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ea2f10b9bb0928dfb1b42b65e1f9e36f7f54dbdf08457afefb38afcdec4fa2bb" +checksum = "9edde0db4769d2dc68579893f2306b26c6ecfbe0ef499b013d731b7b9247e0b9" [[package]] name = "yoke" -version = "0.8.0" +version = "0.8.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5f41bb01b8226ef4bfd589436a297c53d118f65921786300e427be8d487695cc" +checksum = "72d6e5c6afb84d73944e5cedb052c4680d5657337201555f9f2a16b7406d4954" dependencies = [ - "serde", "stable_deref_trait", "yoke-derive", "zerofrom", @@ -3735,9 +3902,9 @@ dependencies = [ [[package]] name = "yoke-derive" -version = "0.8.0" +version = "0.8.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "38da3c9736e16c5d3c8c597a9aaa5d1fa565d0532ae05e27c24aa62fb32c0ab6" +checksum = "b659052874eb698efe5b9e8cf382204678a0086ebf46982b79d6ca3182927e5d" dependencies = [ "proc-macro2", "quote", @@ -3747,18 +3914,18 @@ dependencies = [ [[package]] name = "zerocopy" -version = "0.8.27" +version = "0.8.39" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0894878a5fa3edfd6da3f88c4805f4c8558e2b996227a3d864f47fe11e38282c" +checksum = "db6d35d663eadb6c932438e763b262fe1a70987f9ae936e60158176d710cae4a" dependencies = [ "zerocopy-derive", ] [[package]] name = "zerocopy-derive" -version = "0.8.27" +version = "0.8.39" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "88d2b8d9c68ad2b9e4340d7832716a4d21a22a1154777ad56ea55c51a9cf3831" +checksum = "4122cd3169e94605190e77839c9a40d40ed048d305bfdc146e7df40ab0f3e517" dependencies = [ "proc-macro2", "quote", @@ -3794,9 +3961,9 @@ checksum = "b97154e67e32c85465826e8bcc1c59429aaaf107c1e4a9e53c8d8ccd5eff88d0" [[package]] name = "zerotrie" -version = "0.2.2" +version = "0.2.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "36f0bbd478583f79edad978b407914f61b2972f5af6fa089686016be8f9af595" +checksum = "2a59c17a5562d507e4b54960e8569ebee33bee890c70aa3fe7b97e85a9fd7851" dependencies = [ "displaydoc", "yoke", @@ -3805,9 +3972,9 @@ dependencies = [ [[package]] name = "zerovec" -version = "0.11.4" +version = "0.11.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e7aa2bd55086f1ab526693ecbe444205da57e25f4489879da80635a46d90e73b" +checksum = "6c28719294829477f525be0186d13efa9a3c602f7ec202ca9e353d310fb9a002" dependencies = [ "yoke", "zerofrom", @@ -3816,9 +3983,9 @@ dependencies = [ [[package]] name = "zerovec-derive" -version = "0.11.1" +version = "0.11.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5b96237efa0c878c64bd89c436f661be4e46b2f3eff1ebb976f7ef2321d2f58f" +checksum = "eadce39539ca5cb3985590102671f2567e659fca9666581ad3411d59207951f3" dependencies = [ "proc-macro2", "quote", @@ -3827,6 +3994,6 @@ dependencies = [ [[package]] name = "zmij" -version = "1.0.2" +version = "1.0.20" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0f4a4e8e9dc5c62d159f04fcdbe07f4c3fb710415aab4754bf11505501e3251d" +checksum = "4de98dfa5d5b7fef4ee834d0073d560c9ca7b6c46a71d058c48db7960f8cfaf7" diff --git a/Cargo.toml b/Cargo.toml index 598eaa48..f71598b6 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -38,6 +38,7 @@ futures = "0.3.31" futures-core = "0.3.31" heck = "0.5.0" http = "1.4.0" +httpmock = "0.8.0" hyper = "1.8.1" indexmap = "2.13.0" openapiv3 = "2.2.0" diff --git a/progenitor-client/src/progenitor_client.rs b/progenitor-client/src/progenitor_client.rs index 6f8dcca0..2f781c4e 100644 --- a/progenitor-client/src/progenitor_client.rs +++ b/progenitor-client/src/progenitor_client.rs @@ -526,6 +526,23 @@ pub fn encode_path(pc: &str) -> String { percent_encoding::utf8_percent_encode(pc, PATH_SET).to_string() } +#[doc(hidden)] +/// Serialize a query parameter value into decoded `(key, value)` pairs using +/// the same rules as [`QueryParam`]. +/// +/// Intended for generated clients and mocks; values are not percent-encoded. +pub fn query_param_pairs(name: &str, value: &T) -> Result, String> +where + T: Serialize, +{ + let query = + serde_urlencoded::to_string(QueryParam::new(name, value)).map_err(|err| err.to_string())?; + if query.is_empty() { + return Ok(Vec::new()); + } + serde_urlencoded::from_str::>(&query).map_err(|err| err.to_string()) +} + #[doc(hidden)] pub trait RequestBuilderExt { fn form_urlencoded(self, body: &T) -> Result>; diff --git a/progenitor-client/tests/client_test.rs b/progenitor-client/tests/client_test.rs index 6cd6a0d9..836171bb 100644 --- a/progenitor-client/tests/client_test.rs +++ b/progenitor-client/tests/client_test.rs @@ -5,7 +5,7 @@ use std::{ error::Error, }; -use progenitor_client::{encode_path, QueryParam}; +use progenitor_client::{encode_path, query_param_pairs, QueryParam}; use serde::Serialize; #[test] @@ -24,6 +24,11 @@ fn encode_query_param(param_name: &str, value: &T) -> Result(param_name: &str, value: &T) -> Vec<(String, String)> { + query_param_pairs(param_name, value).expect("failed to serialize query param pairs") +} + #[test] fn test_query_scalars() { let value = "xyz".to_string(); @@ -39,6 +44,18 @@ fn test_query_scalars() { assert_eq!(result, "param_name=-0.05"); } +/// query_param_pairs mirrors QueryParam for scalar values. +#[test] +fn test_query_param_pairs_scalars() { + let value = "xyz".to_string(); + let result = collect_query_pairs("param_name", &value); + assert_eq!(result, vec![("param_name".to_string(), "xyz".to_string())]); + + let value = 42; + let result = collect_query_pairs("param_name", &value); + assert_eq!(result, vec![("param_name".to_string(), "42".to_string())]); +} + #[test] fn test_query_arrays() { let value = vec!["a", "b", "c"]; @@ -65,6 +82,44 @@ fn test_query_arrays() { ); } +/// query_param_pairs repeats keys for array and set values. +#[test] +fn test_query_param_pairs_arrays() { + let value = vec!["a", "b", "c"]; + let result = collect_query_pairs("paramName", &value); + assert_eq!( + result, + vec![ + ("paramName".to_string(), "a".to_string()), + ("paramName".to_string(), "b".to_string()), + ("paramName".to_string(), "c".to_string()), + ] + ); + + let value = ["a", "b", "c"].into_iter().collect::>(); + let result = collect_query_pairs("paramName", &value); + assert_eq!( + result, + vec![ + ("paramName".to_string(), "a".to_string()), + ("paramName".to_string(), "b".to_string()), + ("paramName".to_string(), "c".to_string()), + ] + ); + + let value = ["a", "b", "c"].into_iter().collect::>(); + let mut result = collect_query_pairs("paramName", &value); + result.sort(); + assert_eq!( + result, + vec![ + ("paramName".to_string(), "a".to_string()), + ("paramName".to_string(), "b".to_string()), + ("paramName".to_string(), "c".to_string()), + ] + ); +} + #[test] fn test_query_object() { #[derive(Serialize)] @@ -81,6 +136,40 @@ fn test_query_object() { assert_eq!(result, "a=a+value&b=b+value"); } +/// query_param_pairs emits object fields and map entries as pairs. +#[test] +fn test_query_param_pairs_object_and_map() { + #[derive(Serialize)] + struct Value { + a: String, + b: String, + } + let value = Value { + a: "a value".to_string(), + b: "b value".to_string(), + }; + let result = collect_query_pairs("ignored", &value); + assert_eq!( + result, + vec![ + ("a".to_string(), "a value".to_string()), + ("b".to_string(), "b value".to_string()), + ] + ); + + let value = [("a", "a value"), ("b", "b value")] + .into_iter() + .collect::>(); + let result = collect_query_pairs("ignored", &value); + assert_eq!( + result, + vec![ + ("a".to_string(), "a value".to_string()), + ("b".to_string(), "b value".to_string()), + ] + ); +} + #[test] fn test_query_map() { let value = [("a", "a value"), ("b", "b value")] @@ -115,6 +204,18 @@ fn test_query_enum_external() { encode_query_param("ignored", &value).expect_err("variant not supported"); } +/// query_param_pairs rejects unsupported enum variants. +#[test] +fn test_query_param_pairs_invalid_variant() { + #[derive(Serialize)] + #[serde(rename_all = "snake_case")] + enum Value { + Tuple(u64, u64), + } + let value = Value::Tuple(1, 2); + assert!(query_param_pairs("ignored", &value).is_err()); +} + #[test] fn test_query_enum_internal() { #[derive(Serialize)] @@ -219,3 +320,11 @@ fn test_query_option() { let result = encode_query_param("paramName", &value).unwrap(); assert_eq!(result, "paramName=42"); } + +/// query_param_pairs yields no pairs for empty options. +#[test] +fn test_query_param_pairs_empty() { + let value = Option::::None; + let result = collect_query_pairs("ignored", &value); + assert!(result.is_empty()); +} diff --git a/progenitor-impl/Cargo.toml b/progenitor-impl/Cargo.toml index b80b03c9..04e891ea 100644 --- a/progenitor-impl/Cargo.toml +++ b/progenitor-impl/Cargo.toml @@ -29,6 +29,7 @@ dropshot = { workspace = true } expectorate = { workspace = true } futures = { workspace = true } http = { workspace = true } +httpmock = { workspace = true } hyper = { workspace = true } progenitor-client = { workspace = true } reqwest = { workspace = true } diff --git a/progenitor-impl/src/httpmock.rs b/progenitor-impl/src/httpmock.rs index ed56fbf6..2787d607 100644 --- a/progenitor-impl/src/httpmock.rs +++ b/progenitor-impl/src/httpmock.rs @@ -87,6 +87,17 @@ impl Generator { use #crate_path::*; + /// Apply decoded query parameter pairs to the matcher. + fn apply_query_param_pairs( + mut when: ::httpmock::When, + pairs: &[(String, String)], + ) -> ::httpmock::When { + for (key, value) in pairs { + when = when.query_param(key, value); + } + when + } + #( pub struct #when(::httpmock::When); #when_impl @@ -189,7 +200,12 @@ impl Generator { OperationParameterKind::Query(true) => ( true, quote! { - Self(self.0.query_param(#api_name, value.to_string())) + let expected_pairs = ::progenitor_client::query_param_pairs( + #api_name, + &value, + ) + .expect("failed to serialize query param"); + Self(apply_query_param_pairs(self.0, &expected_pairs)) }, ), OperationParameterKind::Header(true) => ( @@ -203,10 +219,12 @@ impl Generator { false, quote! { if let Some(value) = value.into() { - Self(self.0.query_param( + let expected_pairs = ::progenitor_client::query_param_pairs( #api_name, - value.to_string(), - )) + &value, + ) + .expect("failed to serialize query param"); + Self(apply_query_param_pairs(self.0, &expected_pairs)) } else { Self(self.0.query_param_missing(#api_name)) } diff --git a/progenitor-impl/tests/output/src/buildomat_httpmock.rs b/progenitor-impl/tests/output/src/buildomat_httpmock.rs index 2ebdac0b..88c0b022 100644 --- a/progenitor-impl/tests/output/src/buildomat_httpmock.rs +++ b/progenitor-impl/tests/output/src/buildomat_httpmock.rs @@ -4,6 +4,18 @@ pub mod operations { #![doc = r" its inner type with a call to `into_inner()`. This can"] #![doc = r" be used to explicitly deviate from permitted values."] use crate::buildomat_builder::*; + #[doc = r" Apply decoded query parameter pairs to the matcher."] + fn apply_query_param_pairs( + mut when: ::httpmock::When, + pairs: &[(String, String)], + ) -> ::httpmock::When { + for (key, value) in pairs { + when = when.query_param(key, value); + } + + when + } + pub struct ControlHoldWhen(::httpmock::When); impl ControlHoldWhen { pub fn new(inner: ::httpmock::When) -> Self { @@ -208,7 +220,9 @@ pub mod operations { T: Into>, { if let Some(value) = value.into() { - Self(self.0.query_param("minseq", value.to_string())) + let expected_pairs = ::progenitor_client::query_param_pairs("minseq", &value) + .expect("failed to serialize query param"); + Self(apply_query_param_pairs(self.0, &expected_pairs)) } else { Self(self.0.query_param_missing("minseq")) } @@ -756,7 +770,9 @@ pub mod operations { T: Into>, { if let Some(value) = value.into() { - Self(self.0.query_param("id", value.to_string())) + let expected_pairs = ::progenitor_client::query_param_pairs("id", &value) + .expect("failed to serialize query param"); + Self(apply_query_param_pairs(self.0, &expected_pairs)) } else { Self(self.0.query_param_missing("id")) } diff --git a/progenitor-impl/tests/output/src/cli_gen_httpmock.rs b/progenitor-impl/tests/output/src/cli_gen_httpmock.rs index cebd7878..bf9ef411 100644 --- a/progenitor-impl/tests/output/src/cli_gen_httpmock.rs +++ b/progenitor-impl/tests/output/src/cli_gen_httpmock.rs @@ -4,6 +4,18 @@ pub mod operations { #![doc = r" its inner type with a call to `into_inner()`. This can"] #![doc = r" be used to explicitly deviate from permitted values."] use crate::cli_gen_builder::*; + #[doc = r" Apply decoded query parameter pairs to the matcher."] + fn apply_query_param_pairs( + mut when: ::httpmock::When, + pairs: &[(String, String)], + ) -> ::httpmock::When { + for (key, value) in pairs { + when = when.query_param(key, value); + } + + when + } + pub struct UnoWhen(::httpmock::When); impl UnoWhen { pub fn new(inner: ::httpmock::When) -> Self { @@ -19,7 +31,9 @@ pub mod operations { } pub fn gateway(self, value: &str) -> Self { - Self(self.0.query_param("gateway", value.to_string())) + let expected_pairs = ::progenitor_client::query_param_pairs("gateway", &value) + .expect("failed to serialize query param"); + Self(apply_query_param_pairs(self.0, &expected_pairs)) } pub fn body(self, value: &types::UnoBody) -> Self { diff --git a/progenitor-impl/tests/output/src/httpmock_query_array_builder.rs b/progenitor-impl/tests/output/src/httpmock_query_array_builder.rs new file mode 100644 index 00000000..e9c59fc5 --- /dev/null +++ b/progenitor-impl/tests/output/src/httpmock_query_array_builder.rs @@ -0,0 +1,187 @@ +#[allow(unused_imports)] +use progenitor_client::{encode_path, ClientHooks, OperationInfo, RequestBuilderExt}; +#[allow(unused_imports)] +pub use progenitor_client::{ByteStream, ClientInfo, Error, ResponseValue}; +/// Types used as operation parameters and responses. +#[allow(clippy::all)] +pub mod types { + /// Error types. + pub mod error { + /// Error from a `TryFrom` or `FromStr` implementation. + pub struct ConversionError(::std::borrow::Cow<'static, str>); + impl ::std::error::Error for ConversionError {} + impl ::std::fmt::Display for ConversionError { + fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> Result<(), ::std::fmt::Error> { + ::std::fmt::Display::fmt(&self.0, f) + } + } + + impl ::std::fmt::Debug for ConversionError { + fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> Result<(), ::std::fmt::Error> { + ::std::fmt::Debug::fmt(&self.0, f) + } + } + + impl From<&'static str> for ConversionError { + fn from(value: &'static str) -> Self { + Self(value.into()) + } + } + + impl From for ConversionError { + fn from(value: String) -> Self { + Self(value.into()) + } + } + } +} + +#[derive(Clone, Debug)] +///Client for httpmock-query-array +/// +///Version: 0.0.0 +pub struct Client { + pub(crate) baseurl: String, + pub(crate) client: reqwest::Client, +} + +impl Client { + /// Create a new client. + /// + /// `baseurl` is the base URL provided to the internal + /// `reqwest::Client`, and should include a scheme and hostname, + /// as well as port and a path stem if applicable. + pub fn new(baseurl: &str) -> Self { + #[cfg(not(target_arch = "wasm32"))] + let client = { + let dur = ::std::time::Duration::from_secs(15u64); + reqwest::ClientBuilder::new() + .connect_timeout(dur) + .timeout(dur) + }; + #[cfg(target_arch = "wasm32")] + let client = reqwest::ClientBuilder::new(); + Self::new_with_client(baseurl, client.build().unwrap()) + } + + /// Construct a new client with an existing `reqwest::Client`, + /// allowing more control over its configuration. + /// + /// `baseurl` is the base URL provided to the internal + /// `reqwest::Client`, and should include a scheme and hostname, + /// as well as port and a path stem if applicable. + pub fn new_with_client(baseurl: &str, client: reqwest::Client) -> Self { + Self { + baseurl: baseurl.to_string(), + client, + } + } +} + +impl ClientInfo<()> for Client { + fn api_version() -> &'static str { + "0.0.0" + } + + fn baseurl(&self) -> &str { + self.baseurl.as_str() + } + + fn client(&self) -> &reqwest::Client { + &self.client + } + + fn inner(&self) -> &() { + &() + } +} + +impl ClientHooks<()> for &Client {} +impl Client { + ///Sends a `GET` request to `/widgets` + /// + ///```ignore + /// let response = client.list_widgets() + /// .tags(tags) + /// .send() + /// .await; + /// ``` + pub fn list_widgets(&self) -> builder::ListWidgets<'_> { + builder::ListWidgets::new(self) + } +} + +/// Types for composing operation parameters. +#[allow(clippy::all)] +pub mod builder { + use super::types; + #[allow(unused_imports)] + use super::{ + encode_path, ByteStream, ClientHooks, ClientInfo, Error, OperationInfo, RequestBuilderExt, + ResponseValue, + }; + ///Builder for [`Client::list_widgets`] + /// + ///[`Client::list_widgets`]: super::Client::list_widgets + #[derive(Debug, Clone)] + pub struct ListWidgets<'a> { + client: &'a super::Client, + tags: Result<::std::vec::Vec<::std::string::String>, String>, + } + + impl<'a> ListWidgets<'a> { + pub fn new(client: &'a super::Client) -> Self { + Self { + client: client, + tags: Err("tags was not initialized".to_string()), + } + } + + pub fn tags(mut self, value: V) -> Self + where + V: std::convert::TryInto<::std::vec::Vec<::std::string::String>>, + { + self.tags = value.try_into().map_err(|_| { + "conversion to `:: std :: vec :: Vec < :: std :: string :: String >` for tags \ + failed" + .to_string() + }); + self + } + + ///Sends a `GET` request to `/widgets` + pub async fn send(self) -> Result, Error<()>> { + let Self { client, tags } = self; + let tags = tags.map_err(Error::InvalidRequest)?; + let url = format!("{}/widgets", client.baseurl,); + let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); + header_map.append( + ::reqwest::header::HeaderName::from_static("api-version"), + ::reqwest::header::HeaderValue::from_static(super::Client::api_version()), + ); + #[allow(unused_mut)] + let mut request = client + .client + .get(url) + .query(&progenitor_client::QueryParam::new("tags", &tags)) + .headers(header_map) + .build()?; + let info = OperationInfo { + operation_id: "list_widgets", + }; + client.pre(&mut request, &info).await?; + let result = client.exec(request, &info).await; + client.post(&result, &info).await?; + let response = result?; + match response.status().as_u16() { + 204u16 => Ok(ResponseValue::empty(response)), + _ => Err(Error::UnexpectedResponse(response)), + } + } + } +} + +/// Items consumers will typically use such as the Client. +pub mod prelude { + pub use self::super::Client; +} diff --git a/progenitor-impl/tests/output/src/httpmock_query_array_builder_tagged.rs b/progenitor-impl/tests/output/src/httpmock_query_array_builder_tagged.rs new file mode 100644 index 00000000..94ed7691 --- /dev/null +++ b/progenitor-impl/tests/output/src/httpmock_query_array_builder_tagged.rs @@ -0,0 +1,189 @@ +#[allow(unused_imports)] +use progenitor_client::{encode_path, ClientHooks, OperationInfo, RequestBuilderExt}; +#[allow(unused_imports)] +pub use progenitor_client::{ByteStream, ClientInfo, Error, ResponseValue}; +/// Types used as operation parameters and responses. +#[allow(clippy::all)] +pub mod types { + /// Error types. + pub mod error { + /// Error from a `TryFrom` or `FromStr` implementation. + pub struct ConversionError(::std::borrow::Cow<'static, str>); + impl ::std::error::Error for ConversionError {} + impl ::std::fmt::Display for ConversionError { + fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> Result<(), ::std::fmt::Error> { + ::std::fmt::Display::fmt(&self.0, f) + } + } + + impl ::std::fmt::Debug for ConversionError { + fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> Result<(), ::std::fmt::Error> { + ::std::fmt::Debug::fmt(&self.0, f) + } + } + + impl From<&'static str> for ConversionError { + fn from(value: &'static str) -> Self { + Self(value.into()) + } + } + + impl From for ConversionError { + fn from(value: String) -> Self { + Self(value.into()) + } + } + } +} + +#[derive(Clone, Debug)] +///Client for httpmock-query-array +/// +///Version: 0.0.0 +pub struct Client { + pub(crate) baseurl: String, + pub(crate) client: reqwest::Client, +} + +impl Client { + /// Create a new client. + /// + /// `baseurl` is the base URL provided to the internal + /// `reqwest::Client`, and should include a scheme and hostname, + /// as well as port and a path stem if applicable. + pub fn new(baseurl: &str) -> Self { + #[cfg(not(target_arch = "wasm32"))] + let client = { + let dur = ::std::time::Duration::from_secs(15u64); + reqwest::ClientBuilder::new() + .connect_timeout(dur) + .timeout(dur) + }; + #[cfg(target_arch = "wasm32")] + let client = reqwest::ClientBuilder::new(); + Self::new_with_client(baseurl, client.build().unwrap()) + } + + /// Construct a new client with an existing `reqwest::Client`, + /// allowing more control over its configuration. + /// + /// `baseurl` is the base URL provided to the internal + /// `reqwest::Client`, and should include a scheme and hostname, + /// as well as port and a path stem if applicable. + pub fn new_with_client(baseurl: &str, client: reqwest::Client) -> Self { + Self { + baseurl: baseurl.to_string(), + client, + } + } +} + +impl ClientInfo<()> for Client { + fn api_version() -> &'static str { + "0.0.0" + } + + fn baseurl(&self) -> &str { + self.baseurl.as_str() + } + + fn client(&self) -> &reqwest::Client { + &self.client + } + + fn inner(&self) -> &() { + &() + } +} + +impl ClientHooks<()> for &Client {} +impl Client { + ///Sends a `GET` request to `/widgets` + /// + ///```ignore + /// let response = client.list_widgets() + /// .tags(tags) + /// .send() + /// .await; + /// ``` + pub fn list_widgets(&self) -> builder::ListWidgets<'_> { + builder::ListWidgets::new(self) + } +} + +/// Types for composing operation parameters. +#[allow(clippy::all)] +pub mod builder { + use super::types; + #[allow(unused_imports)] + use super::{ + encode_path, ByteStream, ClientHooks, ClientInfo, Error, OperationInfo, RequestBuilderExt, + ResponseValue, + }; + ///Builder for [`Client::list_widgets`] + /// + ///[`Client::list_widgets`]: super::Client::list_widgets + #[derive(Debug, Clone)] + pub struct ListWidgets<'a> { + client: &'a super::Client, + tags: Result<::std::vec::Vec<::std::string::String>, String>, + } + + impl<'a> ListWidgets<'a> { + pub fn new(client: &'a super::Client) -> Self { + Self { + client: client, + tags: Err("tags was not initialized".to_string()), + } + } + + pub fn tags(mut self, value: V) -> Self + where + V: std::convert::TryInto<::std::vec::Vec<::std::string::String>>, + { + self.tags = value.try_into().map_err(|_| { + "conversion to `:: std :: vec :: Vec < :: std :: string :: String >` for tags \ + failed" + .to_string() + }); + self + } + + ///Sends a `GET` request to `/widgets` + pub async fn send(self) -> Result, Error<()>> { + let Self { client, tags } = self; + let tags = tags.map_err(Error::InvalidRequest)?; + let url = format!("{}/widgets", client.baseurl,); + let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); + header_map.append( + ::reqwest::header::HeaderName::from_static("api-version"), + ::reqwest::header::HeaderValue::from_static(super::Client::api_version()), + ); + #[allow(unused_mut)] + let mut request = client + .client + .get(url) + .query(&progenitor_client::QueryParam::new("tags", &tags)) + .headers(header_map) + .build()?; + let info = OperationInfo { + operation_id: "list_widgets", + }; + client.pre(&mut request, &info).await?; + let result = client.exec(request, &info).await; + client.post(&result, &info).await?; + let response = result?; + match response.status().as_u16() { + 204u16 => Ok(ResponseValue::empty(response)), + _ => Err(Error::UnexpectedResponse(response)), + } + } + } +} + +/// Items consumers will typically use such as the Client and +/// extension traits. +pub mod prelude { + #[allow(unused_imports)] + pub use super::Client; +} diff --git a/progenitor-impl/tests/output/src/httpmock_query_array_cli.rs b/progenitor-impl/tests/output/src/httpmock_query_array_cli.rs new file mode 100644 index 00000000..130b94c5 --- /dev/null +++ b/progenitor-impl/tests/output/src/httpmock_query_array_cli.rs @@ -0,0 +1,99 @@ +use crate::httpmock_query_array_builder::*; +use anyhow::Context as _; +pub struct Cli { + client: Client, + config: T, +} + +impl Cli { + pub fn new(client: Client, config: T) -> Self { + Self { client, config } + } + + pub fn get_command(cmd: CliCommand) -> ::clap::Command { + match cmd { + CliCommand::ListWidgets => Self::cli_list_widgets(), + } + } + + pub fn cli_list_widgets() -> ::clap::Command { + ::clap::Command::new("").arg( + ::clap::Arg::new("tags") + .long("tags") + .value_parser(::clap::value_parser!( + ::std::vec::Vec<::std::string::String> + )) + .required(true), + ) + } + + pub async fn execute( + &self, + cmd: CliCommand, + matches: &::clap::ArgMatches, + ) -> anyhow::Result<()> { + match cmd { + CliCommand::ListWidgets => self.execute_list_widgets(matches).await, + } + } + + pub async fn execute_list_widgets(&self, matches: &::clap::ArgMatches) -> anyhow::Result<()> { + let mut request = self.client.list_widgets(); + if let Some(value) = matches.get_one::<::std::vec::Vec<::std::string::String>>("tags") { + request = request.tags(value.clone()); + } + + self.config.execute_list_widgets(matches, &mut request)?; + let result = request.send().await; + match result { + Ok(r) => { + self.config.success_no_item(&r); + Ok(()) + } + Err(r) => { + self.config.error(&r); + Err(anyhow::Error::new(r)) + } + } + } +} + +pub trait CliConfig { + fn success_item(&self, value: &ResponseValue) + where + T: std::clone::Clone + schemars::JsonSchema + serde::Serialize + std::fmt::Debug; + fn success_no_item(&self, value: &ResponseValue<()>); + fn error(&self, value: &Error) + where + T: std::clone::Clone + schemars::JsonSchema + serde::Serialize + std::fmt::Debug; + fn list_start(&self) + where + T: std::clone::Clone + schemars::JsonSchema + serde::Serialize + std::fmt::Debug; + fn list_item(&self, value: &T) + where + T: std::clone::Clone + schemars::JsonSchema + serde::Serialize + std::fmt::Debug; + fn list_end_success(&self) + where + T: std::clone::Clone + schemars::JsonSchema + serde::Serialize + std::fmt::Debug; + fn list_end_error(&self, value: &Error) + where + T: std::clone::Clone + schemars::JsonSchema + serde::Serialize + std::fmt::Debug; + fn execute_list_widgets( + &self, + matches: &::clap::ArgMatches, + request: &mut builder::ListWidgets, + ) -> anyhow::Result<()> { + Ok(()) + } +} + +#[derive(Copy, Clone, Debug)] +pub enum CliCommand { + ListWidgets, +} + +impl CliCommand { + pub fn iter() -> impl Iterator { + vec![CliCommand::ListWidgets].into_iter() + } +} diff --git a/progenitor-impl/tests/output/src/httpmock_query_array_httpmock.rs b/progenitor-impl/tests/output/src/httpmock_query_array_httpmock.rs new file mode 100644 index 00000000..fec31471 --- /dev/null +++ b/progenitor-impl/tests/output/src/httpmock_query_array_httpmock.rs @@ -0,0 +1,77 @@ +pub mod operations { + #![doc = r" [`When`](::httpmock::When) and [`Then`](::httpmock::Then)"] + #![doc = r" wrappers for each operation. Each can be converted to"] + #![doc = r" its inner type with a call to `into_inner()`. This can"] + #![doc = r" be used to explicitly deviate from permitted values."] + use crate::httpmock_query_array_builder::*; + #[doc = r" Apply decoded query parameter pairs to the matcher."] + fn apply_query_param_pairs( + mut when: ::httpmock::When, + pairs: &[(String, String)], + ) -> ::httpmock::When { + for (key, value) in pairs { + when = when.query_param(key, value); + } + + when + } + + pub struct ListWidgetsWhen(::httpmock::When); + impl ListWidgetsWhen { + pub fn new(inner: ::httpmock::When) -> Self { + Self( + inner + .method(::httpmock::Method::GET) + .path_matches(regex::Regex::new("^/widgets$").unwrap()), + ) + } + + pub fn into_inner(self) -> ::httpmock::When { + self.0 + } + + pub fn tags(self, value: &::std::vec::Vec<::std::string::String>) -> Self { + let expected_pairs = ::progenitor_client::query_param_pairs("tags", &value) + .expect("failed to serialize query param"); + Self(apply_query_param_pairs(self.0, &expected_pairs)) + } + } + + pub struct ListWidgetsThen(::httpmock::Then); + impl ListWidgetsThen { + pub fn new(inner: ::httpmock::Then) -> Self { + Self(inner) + } + + pub fn into_inner(self) -> ::httpmock::Then { + self.0 + } + + pub fn no_content(self) -> Self { + Self(self.0.status(204u16)) + } + } +} + +#[doc = r" An extension trait for [`MockServer`](::httpmock::MockServer) that"] +#[doc = r" adds a method for each operation. These are the equivalent of"] +#[doc = r" type-checked [`mock()`](::httpmock::MockServer::mock) calls."] +pub trait MockServerExt { + fn list_widgets(&self, config_fn: F) -> ::httpmock::Mock<'_> + where + F: FnOnce(operations::ListWidgetsWhen, operations::ListWidgetsThen); +} + +impl MockServerExt for ::httpmock::MockServer { + fn list_widgets(&self, config_fn: F) -> ::httpmock::Mock<'_> + where + F: FnOnce(operations::ListWidgetsWhen, operations::ListWidgetsThen), + { + self.mock(|when, then| { + config_fn( + operations::ListWidgetsWhen::new(when), + operations::ListWidgetsThen::new(then), + ) + }) + } +} diff --git a/progenitor-impl/tests/output/src/httpmock_query_array_positional.rs b/progenitor-impl/tests/output/src/httpmock_query_array_positional.rs new file mode 100644 index 00000000..83329b38 --- /dev/null +++ b/progenitor-impl/tests/output/src/httpmock_query_array_positional.rs @@ -0,0 +1,138 @@ +#[allow(unused_imports)] +use progenitor_client::{encode_path, ClientHooks, OperationInfo, RequestBuilderExt}; +#[allow(unused_imports)] +pub use progenitor_client::{ByteStream, ClientInfo, Error, ResponseValue}; +/// Types used as operation parameters and responses. +#[allow(clippy::all)] +pub mod types { + /// Error types. + pub mod error { + /// Error from a `TryFrom` or `FromStr` implementation. + pub struct ConversionError(::std::borrow::Cow<'static, str>); + impl ::std::error::Error for ConversionError {} + impl ::std::fmt::Display for ConversionError { + fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> Result<(), ::std::fmt::Error> { + ::std::fmt::Display::fmt(&self.0, f) + } + } + + impl ::std::fmt::Debug for ConversionError { + fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> Result<(), ::std::fmt::Error> { + ::std::fmt::Debug::fmt(&self.0, f) + } + } + + impl From<&'static str> for ConversionError { + fn from(value: &'static str) -> Self { + Self(value.into()) + } + } + + impl From for ConversionError { + fn from(value: String) -> Self { + Self(value.into()) + } + } + } +} + +#[derive(Clone, Debug)] +///Client for httpmock-query-array +/// +///Version: 0.0.0 +pub struct Client { + pub(crate) baseurl: String, + pub(crate) client: reqwest::Client, +} + +impl Client { + /// Create a new client. + /// + /// `baseurl` is the base URL provided to the internal + /// `reqwest::Client`, and should include a scheme and hostname, + /// as well as port and a path stem if applicable. + pub fn new(baseurl: &str) -> Self { + #[cfg(not(target_arch = "wasm32"))] + let client = { + let dur = ::std::time::Duration::from_secs(15u64); + reqwest::ClientBuilder::new() + .connect_timeout(dur) + .timeout(dur) + }; + #[cfg(target_arch = "wasm32")] + let client = reqwest::ClientBuilder::new(); + Self::new_with_client(baseurl, client.build().unwrap()) + } + + /// Construct a new client with an existing `reqwest::Client`, + /// allowing more control over its configuration. + /// + /// `baseurl` is the base URL provided to the internal + /// `reqwest::Client`, and should include a scheme and hostname, + /// as well as port and a path stem if applicable. + pub fn new_with_client(baseurl: &str, client: reqwest::Client) -> Self { + Self { + baseurl: baseurl.to_string(), + client, + } + } +} + +impl ClientInfo<()> for Client { + fn api_version() -> &'static str { + "0.0.0" + } + + fn baseurl(&self) -> &str { + self.baseurl.as_str() + } + + fn client(&self) -> &reqwest::Client { + &self.client + } + + fn inner(&self) -> &() { + &() + } +} + +impl ClientHooks<()> for &Client {} +#[allow(clippy::all)] +impl Client { + ///Sends a `GET` request to `/widgets` + pub async fn list_widgets<'a>( + &'a self, + tags: &'a ::std::vec::Vec<::std::string::String>, + ) -> Result, Error<()>> { + let url = format!("{}/widgets", self.baseurl,); + let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize); + header_map.append( + ::reqwest::header::HeaderName::from_static("api-version"), + ::reqwest::header::HeaderValue::from_static(Self::api_version()), + ); + #[allow(unused_mut)] + let mut request = self + .client + .get(url) + .query(&progenitor_client::QueryParam::new("tags", &tags)) + .headers(header_map) + .build()?; + let info = OperationInfo { + operation_id: "list_widgets", + }; + self.pre(&mut request, &info).await?; + let result = self.exec(request, &info).await; + self.post(&result, &info).await?; + let response = result?; + match response.status().as_u16() { + 204u16 => Ok(ResponseValue::empty(response)), + _ => Err(Error::UnexpectedResponse(response)), + } + } +} + +/// Items consumers will typically use such as the Client. +pub mod prelude { + #[allow(unused_imports)] + pub use super::Client; +} diff --git a/progenitor-impl/tests/output/src/keeper_httpmock.rs b/progenitor-impl/tests/output/src/keeper_httpmock.rs index 2aef4025..b2ffaef7 100644 --- a/progenitor-impl/tests/output/src/keeper_httpmock.rs +++ b/progenitor-impl/tests/output/src/keeper_httpmock.rs @@ -4,6 +4,18 @@ pub mod operations { #![doc = r" its inner type with a call to `into_inner()`. This can"] #![doc = r" be used to explicitly deviate from permitted values."] use crate::keeper_builder::*; + #[doc = r" Apply decoded query parameter pairs to the matcher."] + fn apply_query_param_pairs( + mut when: ::httpmock::When, + pairs: &[(String, String)], + ) -> ::httpmock::When { + for (key, value) in pairs { + when = when.query_param(key, value); + } + + when + } + pub struct EnrolWhen(::httpmock::When); impl EnrolWhen { pub fn new(inner: ::httpmock::When) -> Self { diff --git a/progenitor-impl/tests/output/src/nexus_httpmock.rs b/progenitor-impl/tests/output/src/nexus_httpmock.rs index 80969004..1f82fa7b 100644 --- a/progenitor-impl/tests/output/src/nexus_httpmock.rs +++ b/progenitor-impl/tests/output/src/nexus_httpmock.rs @@ -4,6 +4,18 @@ pub mod operations { #![doc = r" its inner type with a call to `into_inner()`. This can"] #![doc = r" be used to explicitly deviate from permitted values."] use crate::nexus_builder::*; + #[doc = r" Apply decoded query parameter pairs to the matcher."] + fn apply_query_param_pairs( + mut when: ::httpmock::When, + pairs: &[(String, String)], + ) -> ::httpmock::When { + for (key, value) in pairs { + when = when.query_param(key, value); + } + + when + } + pub struct DiskViewByIdWhen(::httpmock::When); impl DiskViewByIdWhen { pub fn new(inner: ::httpmock::When) -> Self { @@ -827,7 +839,9 @@ pub mod operations { T: Into>, { if let Some(value) = value.into() { - Self(self.0.query_param("limit", value.to_string())) + let expected_pairs = ::progenitor_client::query_param_pairs("limit", &value) + .expect("failed to serialize query param"); + Self(apply_query_param_pairs(self.0, &expected_pairs)) } else { Self(self.0.query_param_missing("limit")) } @@ -838,7 +852,9 @@ pub mod operations { T: Into>, { if let Some(value) = value.into() { - Self(self.0.query_param("page_token", value.to_string())) + let expected_pairs = ::progenitor_client::query_param_pairs("page_token", &value) + .expect("failed to serialize query param"); + Self(apply_query_param_pairs(self.0, &expected_pairs)) } else { Self(self.0.query_param_missing("page_token")) } @@ -849,7 +865,9 @@ pub mod operations { T: Into>, { if let Some(value) = value.into() { - Self(self.0.query_param("sort_by", value.to_string())) + let expected_pairs = ::progenitor_client::query_param_pairs("sort_by", &value) + .expect("failed to serialize query param"); + Self(apply_query_param_pairs(self.0, &expected_pairs)) } else { Self(self.0.query_param_missing("sort_by")) } @@ -1232,7 +1250,9 @@ pub mod operations { T: Into>, { if let Some(value) = value.into() { - Self(self.0.query_param("limit", value.to_string())) + let expected_pairs = ::progenitor_client::query_param_pairs("limit", &value) + .expect("failed to serialize query param"); + Self(apply_query_param_pairs(self.0, &expected_pairs)) } else { Self(self.0.query_param_missing("limit")) } @@ -1243,7 +1263,9 @@ pub mod operations { T: Into>, { if let Some(value) = value.into() { - Self(self.0.query_param("page_token", value.to_string())) + let expected_pairs = ::progenitor_client::query_param_pairs("page_token", &value) + .expect("failed to serialize query param"); + Self(apply_query_param_pairs(self.0, &expected_pairs)) } else { Self(self.0.query_param_missing("page_token")) } @@ -1254,7 +1276,9 @@ pub mod operations { T: Into>, { if let Some(value) = value.into() { - Self(self.0.query_param("sort_by", value.to_string())) + let expected_pairs = ::progenitor_client::query_param_pairs("sort_by", &value) + .expect("failed to serialize query param"); + Self(apply_query_param_pairs(self.0, &expected_pairs)) } else { Self(self.0.query_param_missing("sort_by")) } @@ -1690,7 +1714,9 @@ pub mod operations { T: Into>, { if let Some(value) = value.into() { - Self(self.0.query_param("limit", value.to_string())) + let expected_pairs = ::progenitor_client::query_param_pairs("limit", &value) + .expect("failed to serialize query param"); + Self(apply_query_param_pairs(self.0, &expected_pairs)) } else { Self(self.0.query_param_missing("limit")) } @@ -1701,7 +1727,9 @@ pub mod operations { T: Into>, { if let Some(value) = value.into() { - Self(self.0.query_param("page_token", value.to_string())) + let expected_pairs = ::progenitor_client::query_param_pairs("page_token", &value) + .expect("failed to serialize query param"); + Self(apply_query_param_pairs(self.0, &expected_pairs)) } else { Self(self.0.query_param_missing("page_token")) } @@ -1712,7 +1740,9 @@ pub mod operations { T: Into>, { if let Some(value) = value.into() { - Self(self.0.query_param("sort_by", value.to_string())) + let expected_pairs = ::progenitor_client::query_param_pairs("sort_by", &value) + .expect("failed to serialize query param"); + Self(apply_query_param_pairs(self.0, &expected_pairs)) } else { Self(self.0.query_param_missing("sort_by")) } @@ -2077,7 +2107,9 @@ pub mod operations { T: Into>, { if let Some(value) = value.into() { - Self(self.0.query_param("limit", value.to_string())) + let expected_pairs = ::progenitor_client::query_param_pairs("limit", &value) + .expect("failed to serialize query param"); + Self(apply_query_param_pairs(self.0, &expected_pairs)) } else { Self(self.0.query_param_missing("limit")) } @@ -2088,7 +2120,9 @@ pub mod operations { T: Into>, { if let Some(value) = value.into() { - Self(self.0.query_param("page_token", value.to_string())) + let expected_pairs = ::progenitor_client::query_param_pairs("page_token", &value) + .expect("failed to serialize query param"); + Self(apply_query_param_pairs(self.0, &expected_pairs)) } else { Self(self.0.query_param_missing("page_token")) } @@ -2099,7 +2133,9 @@ pub mod operations { T: Into>, { if let Some(value) = value.into() { - Self(self.0.query_param("sort_by", value.to_string())) + let expected_pairs = ::progenitor_client::query_param_pairs("sort_by", &value) + .expect("failed to serialize query param"); + Self(apply_query_param_pairs(self.0, &expected_pairs)) } else { Self(self.0.query_param_missing("sort_by")) } @@ -2434,7 +2470,9 @@ pub mod operations { T: Into>>, { if let Some(value) = value.into() { - Self(self.0.query_param("end_time", value.to_string())) + let expected_pairs = ::progenitor_client::query_param_pairs("end_time", &value) + .expect("failed to serialize query param"); + Self(apply_query_param_pairs(self.0, &expected_pairs)) } else { Self(self.0.query_param_missing("end_time")) } @@ -2445,7 +2483,9 @@ pub mod operations { T: Into>, { if let Some(value) = value.into() { - Self(self.0.query_param("limit", value.to_string())) + let expected_pairs = ::progenitor_client::query_param_pairs("limit", &value) + .expect("failed to serialize query param"); + Self(apply_query_param_pairs(self.0, &expected_pairs)) } else { Self(self.0.query_param_missing("limit")) } @@ -2456,7 +2496,9 @@ pub mod operations { T: Into>, { if let Some(value) = value.into() { - Self(self.0.query_param("page_token", value.to_string())) + let expected_pairs = ::progenitor_client::query_param_pairs("page_token", &value) + .expect("failed to serialize query param"); + Self(apply_query_param_pairs(self.0, &expected_pairs)) } else { Self(self.0.query_param_missing("page_token")) } @@ -2467,7 +2509,9 @@ pub mod operations { T: Into>>, { if let Some(value) = value.into() { - Self(self.0.query_param("start_time", value.to_string())) + let expected_pairs = ::progenitor_client::query_param_pairs("start_time", &value) + .expect("failed to serialize query param"); + Self(apply_query_param_pairs(self.0, &expected_pairs)) } else { Self(self.0.query_param_missing("start_time")) } @@ -2549,7 +2593,9 @@ pub mod operations { T: Into>, { if let Some(value) = value.into() { - Self(self.0.query_param("limit", value.to_string())) + let expected_pairs = ::progenitor_client::query_param_pairs("limit", &value) + .expect("failed to serialize query param"); + Self(apply_query_param_pairs(self.0, &expected_pairs)) } else { Self(self.0.query_param_missing("limit")) } @@ -2560,7 +2606,9 @@ pub mod operations { T: Into>, { if let Some(value) = value.into() { - Self(self.0.query_param("page_token", value.to_string())) + let expected_pairs = ::progenitor_client::query_param_pairs("page_token", &value) + .expect("failed to serialize query param"); + Self(apply_query_param_pairs(self.0, &expected_pairs)) } else { Self(self.0.query_param_missing("page_token")) } @@ -2571,7 +2619,9 @@ pub mod operations { T: Into>, { if let Some(value) = value.into() { - Self(self.0.query_param("sort_by", value.to_string())) + let expected_pairs = ::progenitor_client::query_param_pairs("sort_by", &value) + .expect("failed to serialize query param"); + Self(apply_query_param_pairs(self.0, &expected_pairs)) } else { Self(self.0.query_param_missing("sort_by")) } @@ -2883,7 +2933,9 @@ pub mod operations { T: Into>, { if let Some(value) = value.into() { - Self(self.0.query_param("limit", value.to_string())) + let expected_pairs = ::progenitor_client::query_param_pairs("limit", &value) + .expect("failed to serialize query param"); + Self(apply_query_param_pairs(self.0, &expected_pairs)) } else { Self(self.0.query_param_missing("limit")) } @@ -2894,7 +2946,9 @@ pub mod operations { T: Into>, { if let Some(value) = value.into() { - Self(self.0.query_param("page_token", value.to_string())) + let expected_pairs = ::progenitor_client::query_param_pairs("page_token", &value) + .expect("failed to serialize query param"); + Self(apply_query_param_pairs(self.0, &expected_pairs)) } else { Self(self.0.query_param_missing("page_token")) } @@ -2905,7 +2959,9 @@ pub mod operations { T: Into>, { if let Some(value) = value.into() { - Self(self.0.query_param("sort_by", value.to_string())) + let expected_pairs = ::progenitor_client::query_param_pairs("sort_by", &value) + .expect("failed to serialize query param"); + Self(apply_query_param_pairs(self.0, &expected_pairs)) } else { Self(self.0.query_param_missing("sort_by")) } @@ -3231,7 +3287,9 @@ pub mod operations { T: Into>, { if let Some(value) = value.into() { - Self(self.0.query_param("limit", value.to_string())) + let expected_pairs = ::progenitor_client::query_param_pairs("limit", &value) + .expect("failed to serialize query param"); + Self(apply_query_param_pairs(self.0, &expected_pairs)) } else { Self(self.0.query_param_missing("limit")) } @@ -3242,7 +3300,9 @@ pub mod operations { T: Into>, { if let Some(value) = value.into() { - Self(self.0.query_param("page_token", value.to_string())) + let expected_pairs = ::progenitor_client::query_param_pairs("page_token", &value) + .expect("failed to serialize query param"); + Self(apply_query_param_pairs(self.0, &expected_pairs)) } else { Self(self.0.query_param_missing("page_token")) } @@ -3253,7 +3313,9 @@ pub mod operations { T: Into>, { if let Some(value) = value.into() { - Self(self.0.query_param("sort_by", value.to_string())) + let expected_pairs = ::progenitor_client::query_param_pairs("sort_by", &value) + .expect("failed to serialize query param"); + Self(apply_query_param_pairs(self.0, &expected_pairs)) } else { Self(self.0.query_param_missing("sort_by")) } @@ -3701,7 +3763,9 @@ pub mod operations { T: Into>, { if let Some(value) = value.into() { - Self(self.0.query_param("limit", value.to_string())) + let expected_pairs = ::progenitor_client::query_param_pairs("limit", &value) + .expect("failed to serialize query param"); + Self(apply_query_param_pairs(self.0, &expected_pairs)) } else { Self(self.0.query_param_missing("limit")) } @@ -3712,7 +3776,9 @@ pub mod operations { T: Into>, { if let Some(value) = value.into() { - Self(self.0.query_param("page_token", value.to_string())) + let expected_pairs = ::progenitor_client::query_param_pairs("page_token", &value) + .expect("failed to serialize query param"); + Self(apply_query_param_pairs(self.0, &expected_pairs)) } else { Self(self.0.query_param_missing("page_token")) } @@ -3723,7 +3789,9 @@ pub mod operations { T: Into>, { if let Some(value) = value.into() { - Self(self.0.query_param("sort_by", value.to_string())) + let expected_pairs = ::progenitor_client::query_param_pairs("sort_by", &value) + .expect("failed to serialize query param"); + Self(apply_query_param_pairs(self.0, &expected_pairs)) } else { Self(self.0.query_param_missing("sort_by")) } @@ -4277,7 +4345,9 @@ pub mod operations { T: Into>, { if let Some(value) = value.into() { - Self(self.0.query_param("from_start", value.to_string())) + let expected_pairs = ::progenitor_client::query_param_pairs("from_start", &value) + .expect("failed to serialize query param"); + Self(apply_query_param_pairs(self.0, &expected_pairs)) } else { Self(self.0.query_param_missing("from_start")) } @@ -4288,7 +4358,9 @@ pub mod operations { T: Into>, { if let Some(value) = value.into() { - Self(self.0.query_param("max_bytes", value.to_string())) + let expected_pairs = ::progenitor_client::query_param_pairs("max_bytes", &value) + .expect("failed to serialize query param"); + Self(apply_query_param_pairs(self.0, &expected_pairs)) } else { Self(self.0.query_param_missing("max_bytes")) } @@ -4299,7 +4371,9 @@ pub mod operations { T: Into>, { if let Some(value) = value.into() { - Self(self.0.query_param("most_recent", value.to_string())) + let expected_pairs = ::progenitor_client::query_param_pairs("most_recent", &value) + .expect("failed to serialize query param"); + Self(apply_query_param_pairs(self.0, &expected_pairs)) } else { Self(self.0.query_param_missing("most_recent")) } @@ -4760,7 +4834,9 @@ pub mod operations { T: Into>, { if let Some(value) = value.into() { - Self(self.0.query_param("limit", value.to_string())) + let expected_pairs = ::progenitor_client::query_param_pairs("limit", &value) + .expect("failed to serialize query param"); + Self(apply_query_param_pairs(self.0, &expected_pairs)) } else { Self(self.0.query_param_missing("limit")) } @@ -4771,7 +4847,9 @@ pub mod operations { T: Into>, { if let Some(value) = value.into() { - Self(self.0.query_param("page_token", value.to_string())) + let expected_pairs = ::progenitor_client::query_param_pairs("page_token", &value) + .expect("failed to serialize query param"); + Self(apply_query_param_pairs(self.0, &expected_pairs)) } else { Self(self.0.query_param_missing("page_token")) } @@ -4782,7 +4860,9 @@ pub mod operations { T: Into>, { if let Some(value) = value.into() { - Self(self.0.query_param("sort_by", value.to_string())) + let expected_pairs = ::progenitor_client::query_param_pairs("sort_by", &value) + .expect("failed to serialize query param"); + Self(apply_query_param_pairs(self.0, &expected_pairs)) } else { Self(self.0.query_param_missing("sort_by")) } @@ -5094,7 +5174,9 @@ pub mod operations { T: Into>, { if let Some(value) = value.into() { - Self(self.0.query_param("limit", value.to_string())) + let expected_pairs = ::progenitor_client::query_param_pairs("limit", &value) + .expect("failed to serialize query param"); + Self(apply_query_param_pairs(self.0, &expected_pairs)) } else { Self(self.0.query_param_missing("limit")) } @@ -5105,7 +5187,9 @@ pub mod operations { T: Into>, { if let Some(value) = value.into() { - Self(self.0.query_param("page_token", value.to_string())) + let expected_pairs = ::progenitor_client::query_param_pairs("page_token", &value) + .expect("failed to serialize query param"); + Self(apply_query_param_pairs(self.0, &expected_pairs)) } else { Self(self.0.query_param_missing("page_token")) } @@ -5116,7 +5200,9 @@ pub mod operations { T: Into>, { if let Some(value) = value.into() { - Self(self.0.query_param("sort_by", value.to_string())) + let expected_pairs = ::progenitor_client::query_param_pairs("sort_by", &value) + .expect("failed to serialize query param"); + Self(apply_query_param_pairs(self.0, &expected_pairs)) } else { Self(self.0.query_param_missing("sort_by")) } @@ -5698,7 +5784,9 @@ pub mod operations { T: Into>, { if let Some(value) = value.into() { - Self(self.0.query_param("limit", value.to_string())) + let expected_pairs = ::progenitor_client::query_param_pairs("limit", &value) + .expect("failed to serialize query param"); + Self(apply_query_param_pairs(self.0, &expected_pairs)) } else { Self(self.0.query_param_missing("limit")) } @@ -5709,7 +5797,9 @@ pub mod operations { T: Into>, { if let Some(value) = value.into() { - Self(self.0.query_param("page_token", value.to_string())) + let expected_pairs = ::progenitor_client::query_param_pairs("page_token", &value) + .expect("failed to serialize query param"); + Self(apply_query_param_pairs(self.0, &expected_pairs)) } else { Self(self.0.query_param_missing("page_token")) } @@ -5720,7 +5810,9 @@ pub mod operations { T: Into>, { if let Some(value) = value.into() { - Self(self.0.query_param("sort_by", value.to_string())) + let expected_pairs = ::progenitor_client::query_param_pairs("sort_by", &value) + .expect("failed to serialize query param"); + Self(apply_query_param_pairs(self.0, &expected_pairs)) } else { Self(self.0.query_param_missing("sort_by")) } @@ -6193,7 +6285,9 @@ pub mod operations { T: Into>, { if let Some(value) = value.into() { - Self(self.0.query_param("limit", value.to_string())) + let expected_pairs = ::progenitor_client::query_param_pairs("limit", &value) + .expect("failed to serialize query param"); + Self(apply_query_param_pairs(self.0, &expected_pairs)) } else { Self(self.0.query_param_missing("limit")) } @@ -6204,7 +6298,9 @@ pub mod operations { T: Into>, { if let Some(value) = value.into() { - Self(self.0.query_param("page_token", value.to_string())) + let expected_pairs = ::progenitor_client::query_param_pairs("page_token", &value) + .expect("failed to serialize query param"); + Self(apply_query_param_pairs(self.0, &expected_pairs)) } else { Self(self.0.query_param_missing("page_token")) } @@ -6215,7 +6311,9 @@ pub mod operations { T: Into>, { if let Some(value) = value.into() { - Self(self.0.query_param("sort_by", value.to_string())) + let expected_pairs = ::progenitor_client::query_param_pairs("sort_by", &value) + .expect("failed to serialize query param"); + Self(apply_query_param_pairs(self.0, &expected_pairs)) } else { Self(self.0.query_param_missing("sort_by")) } @@ -6718,7 +6816,9 @@ pub mod operations { T: Into>, { if let Some(value) = value.into() { - Self(self.0.query_param("limit", value.to_string())) + let expected_pairs = ::progenitor_client::query_param_pairs("limit", &value) + .expect("failed to serialize query param"); + Self(apply_query_param_pairs(self.0, &expected_pairs)) } else { Self(self.0.query_param_missing("limit")) } @@ -6729,7 +6829,9 @@ pub mod operations { T: Into>, { if let Some(value) = value.into() { - Self(self.0.query_param("page_token", value.to_string())) + let expected_pairs = ::progenitor_client::query_param_pairs("page_token", &value) + .expect("failed to serialize query param"); + Self(apply_query_param_pairs(self.0, &expected_pairs)) } else { Self(self.0.query_param_missing("page_token")) } @@ -6740,7 +6842,9 @@ pub mod operations { T: Into>, { if let Some(value) = value.into() { - Self(self.0.query_param("sort_by", value.to_string())) + let expected_pairs = ::progenitor_client::query_param_pairs("sort_by", &value) + .expect("failed to serialize query param"); + Self(apply_query_param_pairs(self.0, &expected_pairs)) } else { Self(self.0.query_param_missing("sort_by")) } @@ -7214,7 +7318,9 @@ pub mod operations { T: Into>, { if let Some(value) = value.into() { - Self(self.0.query_param("limit", value.to_string())) + let expected_pairs = ::progenitor_client::query_param_pairs("limit", &value) + .expect("failed to serialize query param"); + Self(apply_query_param_pairs(self.0, &expected_pairs)) } else { Self(self.0.query_param_missing("limit")) } @@ -7225,7 +7331,9 @@ pub mod operations { T: Into>, { if let Some(value) = value.into() { - Self(self.0.query_param("page_token", value.to_string())) + let expected_pairs = ::progenitor_client::query_param_pairs("page_token", &value) + .expect("failed to serialize query param"); + Self(apply_query_param_pairs(self.0, &expected_pairs)) } else { Self(self.0.query_param_missing("page_token")) } @@ -7236,7 +7344,9 @@ pub mod operations { T: Into>, { if let Some(value) = value.into() { - Self(self.0.query_param("sort_by", value.to_string())) + let expected_pairs = ::progenitor_client::query_param_pairs("sort_by", &value) + .expect("failed to serialize query param"); + Self(apply_query_param_pairs(self.0, &expected_pairs)) } else { Self(self.0.query_param_missing("sort_by")) } @@ -7416,7 +7526,9 @@ pub mod operations { T: Into>, { if let Some(value) = value.into() { - Self(self.0.query_param("limit", value.to_string())) + let expected_pairs = ::progenitor_client::query_param_pairs("limit", &value) + .expect("failed to serialize query param"); + Self(apply_query_param_pairs(self.0, &expected_pairs)) } else { Self(self.0.query_param_missing("limit")) } @@ -7427,7 +7539,9 @@ pub mod operations { T: Into>, { if let Some(value) = value.into() { - Self(self.0.query_param("page_token", value.to_string())) + let expected_pairs = ::progenitor_client::query_param_pairs("page_token", &value) + .expect("failed to serialize query param"); + Self(apply_query_param_pairs(self.0, &expected_pairs)) } else { Self(self.0.query_param_missing("page_token")) } @@ -7608,7 +7722,9 @@ pub mod operations { T: Into>, { if let Some(value) = value.into() { - Self(self.0.query_param("limit", value.to_string())) + let expected_pairs = ::progenitor_client::query_param_pairs("limit", &value) + .expect("failed to serialize query param"); + Self(apply_query_param_pairs(self.0, &expected_pairs)) } else { Self(self.0.query_param_missing("limit")) } @@ -7619,7 +7735,9 @@ pub mod operations { T: Into>, { if let Some(value) = value.into() { - Self(self.0.query_param("page_token", value.to_string())) + let expected_pairs = ::progenitor_client::query_param_pairs("page_token", &value) + .expect("failed to serialize query param"); + Self(apply_query_param_pairs(self.0, &expected_pairs)) } else { Self(self.0.query_param_missing("page_token")) } @@ -7630,7 +7748,9 @@ pub mod operations { T: Into>, { if let Some(value) = value.into() { - Self(self.0.query_param("sort_by", value.to_string())) + let expected_pairs = ::progenitor_client::query_param_pairs("sort_by", &value) + .expect("failed to serialize query param"); + Self(apply_query_param_pairs(self.0, &expected_pairs)) } else { Self(self.0.query_param_missing("sort_by")) } @@ -7696,7 +7816,9 @@ pub mod operations { T: Into>, { if let Some(value) = value.into() { - Self(self.0.query_param("limit", value.to_string())) + let expected_pairs = ::progenitor_client::query_param_pairs("limit", &value) + .expect("failed to serialize query param"); + Self(apply_query_param_pairs(self.0, &expected_pairs)) } else { Self(self.0.query_param_missing("limit")) } @@ -7707,7 +7829,9 @@ pub mod operations { T: Into>, { if let Some(value) = value.into() { - Self(self.0.query_param("page_token", value.to_string())) + let expected_pairs = ::progenitor_client::query_param_pairs("page_token", &value) + .expect("failed to serialize query param"); + Self(apply_query_param_pairs(self.0, &expected_pairs)) } else { Self(self.0.query_param_missing("page_token")) } @@ -7718,7 +7842,9 @@ pub mod operations { T: Into>, { if let Some(value) = value.into() { - Self(self.0.query_param("sort_by", value.to_string())) + let expected_pairs = ::progenitor_client::query_param_pairs("sort_by", &value) + .expect("failed to serialize query param"); + Self(apply_query_param_pairs(self.0, &expected_pairs)) } else { Self(self.0.query_param_missing("sort_by")) } @@ -8143,7 +8269,9 @@ pub mod operations { T: Into>, { if let Some(value) = value.into() { - Self(self.0.query_param("limit", value.to_string())) + let expected_pairs = ::progenitor_client::query_param_pairs("limit", &value) + .expect("failed to serialize query param"); + Self(apply_query_param_pairs(self.0, &expected_pairs)) } else { Self(self.0.query_param_missing("limit")) } @@ -8154,7 +8282,9 @@ pub mod operations { T: Into>, { if let Some(value) = value.into() { - Self(self.0.query_param("page_token", value.to_string())) + let expected_pairs = ::progenitor_client::query_param_pairs("page_token", &value) + .expect("failed to serialize query param"); + Self(apply_query_param_pairs(self.0, &expected_pairs)) } else { Self(self.0.query_param_missing("page_token")) } @@ -8165,7 +8295,9 @@ pub mod operations { T: Into>, { if let Some(value) = value.into() { - Self(self.0.query_param("sort_by", value.to_string())) + let expected_pairs = ::progenitor_client::query_param_pairs("sort_by", &value) + .expect("failed to serialize query param"); + Self(apply_query_param_pairs(self.0, &expected_pairs)) } else { Self(self.0.query_param_missing("sort_by")) } @@ -8407,7 +8539,9 @@ pub mod operations { T: Into>, { if let Some(value) = value.into() { - Self(self.0.query_param("limit", value.to_string())) + let expected_pairs = ::progenitor_client::query_param_pairs("limit", &value) + .expect("failed to serialize query param"); + Self(apply_query_param_pairs(self.0, &expected_pairs)) } else { Self(self.0.query_param_missing("limit")) } @@ -8418,7 +8552,9 @@ pub mod operations { T: Into>, { if let Some(value) = value.into() { - Self(self.0.query_param("page_token", value.to_string())) + let expected_pairs = ::progenitor_client::query_param_pairs("page_token", &value) + .expect("failed to serialize query param"); + Self(apply_query_param_pairs(self.0, &expected_pairs)) } else { Self(self.0.query_param_missing("page_token")) } @@ -8429,7 +8565,9 @@ pub mod operations { T: Into>, { if let Some(value) = value.into() { - Self(self.0.query_param("sort_by", value.to_string())) + let expected_pairs = ::progenitor_client::query_param_pairs("sort_by", &value) + .expect("failed to serialize query param"); + Self(apply_query_param_pairs(self.0, &expected_pairs)) } else { Self(self.0.query_param_missing("sort_by")) } @@ -8495,7 +8633,9 @@ pub mod operations { T: Into>, { if let Some(value) = value.into() { - Self(self.0.query_param("limit", value.to_string())) + let expected_pairs = ::progenitor_client::query_param_pairs("limit", &value) + .expect("failed to serialize query param"); + Self(apply_query_param_pairs(self.0, &expected_pairs)) } else { Self(self.0.query_param_missing("limit")) } @@ -8506,7 +8646,9 @@ pub mod operations { T: Into>, { if let Some(value) = value.into() { - Self(self.0.query_param("page_token", value.to_string())) + let expected_pairs = ::progenitor_client::query_param_pairs("page_token", &value) + .expect("failed to serialize query param"); + Self(apply_query_param_pairs(self.0, &expected_pairs)) } else { Self(self.0.query_param_missing("page_token")) } @@ -8517,7 +8659,9 @@ pub mod operations { T: Into>, { if let Some(value) = value.into() { - Self(self.0.query_param("sort_by", value.to_string())) + let expected_pairs = ::progenitor_client::query_param_pairs("sort_by", &value) + .expect("failed to serialize query param"); + Self(apply_query_param_pairs(self.0, &expected_pairs)) } else { Self(self.0.query_param_missing("sort_by")) } @@ -8644,7 +8788,9 @@ pub mod operations { T: Into>, { if let Some(value) = value.into() { - Self(self.0.query_param("limit", value.to_string())) + let expected_pairs = ::progenitor_client::query_param_pairs("limit", &value) + .expect("failed to serialize query param"); + Self(apply_query_param_pairs(self.0, &expected_pairs)) } else { Self(self.0.query_param_missing("limit")) } @@ -8655,7 +8801,9 @@ pub mod operations { T: Into>, { if let Some(value) = value.into() { - Self(self.0.query_param("page_token", value.to_string())) + let expected_pairs = ::progenitor_client::query_param_pairs("page_token", &value) + .expect("failed to serialize query param"); + Self(apply_query_param_pairs(self.0, &expected_pairs)) } else { Self(self.0.query_param_missing("page_token")) } @@ -8666,7 +8814,9 @@ pub mod operations { T: Into>, { if let Some(value) = value.into() { - Self(self.0.query_param("sort_by", value.to_string())) + let expected_pairs = ::progenitor_client::query_param_pairs("sort_by", &value) + .expect("failed to serialize query param"); + Self(apply_query_param_pairs(self.0, &expected_pairs)) } else { Self(self.0.query_param_missing("sort_by")) } @@ -8802,7 +8952,9 @@ pub mod operations { T: Into>, { if let Some(value) = value.into() { - Self(self.0.query_param("limit", value.to_string())) + let expected_pairs = ::progenitor_client::query_param_pairs("limit", &value) + .expect("failed to serialize query param"); + Self(apply_query_param_pairs(self.0, &expected_pairs)) } else { Self(self.0.query_param_missing("limit")) } @@ -8813,7 +8965,9 @@ pub mod operations { T: Into>, { if let Some(value) = value.into() { - Self(self.0.query_param("page_token", value.to_string())) + let expected_pairs = ::progenitor_client::query_param_pairs("page_token", &value) + .expect("failed to serialize query param"); + Self(apply_query_param_pairs(self.0, &expected_pairs)) } else { Self(self.0.query_param_missing("page_token")) } @@ -8824,7 +8978,9 @@ pub mod operations { T: Into>, { if let Some(value) = value.into() { - Self(self.0.query_param("sort_by", value.to_string())) + let expected_pairs = ::progenitor_client::query_param_pairs("sort_by", &value) + .expect("failed to serialize query param"); + Self(apply_query_param_pairs(self.0, &expected_pairs)) } else { Self(self.0.query_param_missing("sort_by")) } @@ -8890,7 +9046,9 @@ pub mod operations { T: Into>, { if let Some(value) = value.into() { - Self(self.0.query_param("limit", value.to_string())) + let expected_pairs = ::progenitor_client::query_param_pairs("limit", &value) + .expect("failed to serialize query param"); + Self(apply_query_param_pairs(self.0, &expected_pairs)) } else { Self(self.0.query_param_missing("limit")) } @@ -8901,7 +9059,9 @@ pub mod operations { T: Into>, { if let Some(value) = value.into() { - Self(self.0.query_param("page_token", value.to_string())) + let expected_pairs = ::progenitor_client::query_param_pairs("page_token", &value) + .expect("failed to serialize query param"); + Self(apply_query_param_pairs(self.0, &expected_pairs)) } else { Self(self.0.query_param_missing("page_token")) } @@ -8912,7 +9072,9 @@ pub mod operations { T: Into>, { if let Some(value) = value.into() { - Self(self.0.query_param("sort_by", value.to_string())) + let expected_pairs = ::progenitor_client::query_param_pairs("sort_by", &value) + .expect("failed to serialize query param"); + Self(apply_query_param_pairs(self.0, &expected_pairs)) } else { Self(self.0.query_param_missing("sort_by")) } @@ -9152,7 +9314,9 @@ pub mod operations { T: Into>, { if let Some(value) = value.into() { - Self(self.0.query_param("limit", value.to_string())) + let expected_pairs = ::progenitor_client::query_param_pairs("limit", &value) + .expect("failed to serialize query param"); + Self(apply_query_param_pairs(self.0, &expected_pairs)) } else { Self(self.0.query_param_missing("limit")) } @@ -9163,7 +9327,9 @@ pub mod operations { T: Into>, { if let Some(value) = value.into() { - Self(self.0.query_param("page_token", value.to_string())) + let expected_pairs = ::progenitor_client::query_param_pairs("page_token", &value) + .expect("failed to serialize query param"); + Self(apply_query_param_pairs(self.0, &expected_pairs)) } else { Self(self.0.query_param_missing("page_token")) } @@ -9174,7 +9340,9 @@ pub mod operations { T: Into>, { if let Some(value) = value.into() { - Self(self.0.query_param("sort_by", value.to_string())) + let expected_pairs = ::progenitor_client::query_param_pairs("sort_by", &value) + .expect("failed to serialize query param"); + Self(apply_query_param_pairs(self.0, &expected_pairs)) } else { Self(self.0.query_param_missing("sort_by")) } @@ -9487,7 +9655,9 @@ pub mod operations { T: Into>, { if let Some(value) = value.into() { - Self(self.0.query_param("limit", value.to_string())) + let expected_pairs = ::progenitor_client::query_param_pairs("limit", &value) + .expect("failed to serialize query param"); + Self(apply_query_param_pairs(self.0, &expected_pairs)) } else { Self(self.0.query_param_missing("limit")) } @@ -9498,7 +9668,9 @@ pub mod operations { T: Into>, { if let Some(value) = value.into() { - Self(self.0.query_param("page_token", value.to_string())) + let expected_pairs = ::progenitor_client::query_param_pairs("page_token", &value) + .expect("failed to serialize query param"); + Self(apply_query_param_pairs(self.0, &expected_pairs)) } else { Self(self.0.query_param_missing("page_token")) } @@ -9750,7 +9922,9 @@ pub mod operations { T: Into>, { if let Some(value) = value.into() { - Self(self.0.query_param("limit", value.to_string())) + let expected_pairs = ::progenitor_client::query_param_pairs("limit", &value) + .expect("failed to serialize query param"); + Self(apply_query_param_pairs(self.0, &expected_pairs)) } else { Self(self.0.query_param_missing("limit")) } @@ -9761,7 +9935,9 @@ pub mod operations { T: Into>, { if let Some(value) = value.into() { - Self(self.0.query_param("page_token", value.to_string())) + let expected_pairs = ::progenitor_client::query_param_pairs("page_token", &value) + .expect("failed to serialize query param"); + Self(apply_query_param_pairs(self.0, &expected_pairs)) } else { Self(self.0.query_param_missing("page_token")) } @@ -9944,14 +10120,18 @@ pub mod operations { T: Into>>, { if let Some(value) = value.into() { - Self(self.0.query_param("end_time", value.to_string())) + let expected_pairs = ::progenitor_client::query_param_pairs("end_time", &value) + .expect("failed to serialize query param"); + Self(apply_query_param_pairs(self.0, &expected_pairs)) } else { Self(self.0.query_param_missing("end_time")) } } pub fn id(self, value: &::uuid::Uuid) -> Self { - Self(self.0.query_param("id", value.to_string())) + let expected_pairs = ::progenitor_client::query_param_pairs("id", &value) + .expect("failed to serialize query param"); + Self(apply_query_param_pairs(self.0, &expected_pairs)) } pub fn limit(self, value: T) -> Self @@ -9959,7 +10139,9 @@ pub mod operations { T: Into>, { if let Some(value) = value.into() { - Self(self.0.query_param("limit", value.to_string())) + let expected_pairs = ::progenitor_client::query_param_pairs("limit", &value) + .expect("failed to serialize query param"); + Self(apply_query_param_pairs(self.0, &expected_pairs)) } else { Self(self.0.query_param_missing("limit")) } @@ -9970,7 +10152,9 @@ pub mod operations { T: Into>, { if let Some(value) = value.into() { - Self(self.0.query_param("page_token", value.to_string())) + let expected_pairs = ::progenitor_client::query_param_pairs("page_token", &value) + .expect("failed to serialize query param"); + Self(apply_query_param_pairs(self.0, &expected_pairs)) } else { Self(self.0.query_param_missing("page_token")) } @@ -9981,7 +10165,9 @@ pub mod operations { T: Into>>, { if let Some(value) = value.into() { - Self(self.0.query_param("start_time", value.to_string())) + let expected_pairs = ::progenitor_client::query_param_pairs("start_time", &value) + .expect("failed to serialize query param"); + Self(apply_query_param_pairs(self.0, &expected_pairs)) } else { Self(self.0.query_param_missing("start_time")) } @@ -10161,7 +10347,9 @@ pub mod operations { T: Into>, { if let Some(value) = value.into() { - Self(self.0.query_param("limit", value.to_string())) + let expected_pairs = ::progenitor_client::query_param_pairs("limit", &value) + .expect("failed to serialize query param"); + Self(apply_query_param_pairs(self.0, &expected_pairs)) } else { Self(self.0.query_param_missing("limit")) } @@ -10172,7 +10360,9 @@ pub mod operations { T: Into>, { if let Some(value) = value.into() { - Self(self.0.query_param("page_token", value.to_string())) + let expected_pairs = ::progenitor_client::query_param_pairs("page_token", &value) + .expect("failed to serialize query param"); + Self(apply_query_param_pairs(self.0, &expected_pairs)) } else { Self(self.0.query_param_missing("page_token")) } @@ -10183,7 +10373,9 @@ pub mod operations { T: Into>, { if let Some(value) = value.into() { - Self(self.0.query_param("sort_by", value.to_string())) + let expected_pairs = ::progenitor_client::query_param_pairs("sort_by", &value) + .expect("failed to serialize query param"); + Self(apply_query_param_pairs(self.0, &expected_pairs)) } else { Self(self.0.query_param_missing("sort_by")) } @@ -10309,7 +10501,9 @@ pub mod operations { T: Into>, { if let Some(value) = value.into() { - Self(self.0.query_param("limit", value.to_string())) + let expected_pairs = ::progenitor_client::query_param_pairs("limit", &value) + .expect("failed to serialize query param"); + Self(apply_query_param_pairs(self.0, &expected_pairs)) } else { Self(self.0.query_param_missing("limit")) } @@ -10320,7 +10514,9 @@ pub mod operations { T: Into>, { if let Some(value) = value.into() { - Self(self.0.query_param("page_token", value.to_string())) + let expected_pairs = ::progenitor_client::query_param_pairs("page_token", &value) + .expect("failed to serialize query param"); + Self(apply_query_param_pairs(self.0, &expected_pairs)) } else { Self(self.0.query_param_missing("page_token")) } @@ -10331,7 +10527,9 @@ pub mod operations { T: Into>, { if let Some(value) = value.into() { - Self(self.0.query_param("sort_by", value.to_string())) + let expected_pairs = ::progenitor_client::query_param_pairs("sort_by", &value) + .expect("failed to serialize query param"); + Self(apply_query_param_pairs(self.0, &expected_pairs)) } else { Self(self.0.query_param_missing("sort_by")) } @@ -10578,7 +10776,9 @@ pub mod operations { T: Into>, { if let Some(value) = value.into() { - Self(self.0.query_param("limit", value.to_string())) + let expected_pairs = ::progenitor_client::query_param_pairs("limit", &value) + .expect("failed to serialize query param"); + Self(apply_query_param_pairs(self.0, &expected_pairs)) } else { Self(self.0.query_param_missing("limit")) } @@ -10589,7 +10789,9 @@ pub mod operations { T: Into>, { if let Some(value) = value.into() { - Self(self.0.query_param("page_token", value.to_string())) + let expected_pairs = ::progenitor_client::query_param_pairs("page_token", &value) + .expect("failed to serialize query param"); + Self(apply_query_param_pairs(self.0, &expected_pairs)) } else { Self(self.0.query_param_missing("page_token")) } @@ -10600,7 +10802,9 @@ pub mod operations { T: Into>, { if let Some(value) = value.into() { - Self(self.0.query_param("sort_by", value.to_string())) + let expected_pairs = ::progenitor_client::query_param_pairs("sort_by", &value) + .expect("failed to serialize query param"); + Self(apply_query_param_pairs(self.0, &expected_pairs)) } else { Self(self.0.query_param_missing("sort_by")) } @@ -11145,7 +11349,9 @@ pub mod operations { T: Into>, { if let Some(value) = value.into() { - Self(self.0.query_param("limit", value.to_string())) + let expected_pairs = ::progenitor_client::query_param_pairs("limit", &value) + .expect("failed to serialize query param"); + Self(apply_query_param_pairs(self.0, &expected_pairs)) } else { Self(self.0.query_param_missing("limit")) } @@ -11156,7 +11362,9 @@ pub mod operations { T: Into>, { if let Some(value) = value.into() { - Self(self.0.query_param("page_token", value.to_string())) + let expected_pairs = ::progenitor_client::query_param_pairs("page_token", &value) + .expect("failed to serialize query param"); + Self(apply_query_param_pairs(self.0, &expected_pairs)) } else { Self(self.0.query_param_missing("page_token")) } @@ -11167,7 +11375,9 @@ pub mod operations { T: Into>, { if let Some(value) = value.into() { - Self(self.0.query_param("sort_by", value.to_string())) + let expected_pairs = ::progenitor_client::query_param_pairs("sort_by", &value) + .expect("failed to serialize query param"); + Self(apply_query_param_pairs(self.0, &expected_pairs)) } else { Self(self.0.query_param_missing("sort_by")) } @@ -11306,7 +11516,9 @@ pub mod operations { T: Into>, { if let Some(value) = value.into() { - Self(self.0.query_param("limit", value.to_string())) + let expected_pairs = ::progenitor_client::query_param_pairs("limit", &value) + .expect("failed to serialize query param"); + Self(apply_query_param_pairs(self.0, &expected_pairs)) } else { Self(self.0.query_param_missing("limit")) } @@ -11317,7 +11529,9 @@ pub mod operations { T: Into>, { if let Some(value) = value.into() { - Self(self.0.query_param("page_token", value.to_string())) + let expected_pairs = ::progenitor_client::query_param_pairs("page_token", &value) + .expect("failed to serialize query param"); + Self(apply_query_param_pairs(self.0, &expected_pairs)) } else { Self(self.0.query_param_missing("page_token")) } @@ -11328,7 +11542,9 @@ pub mod operations { T: Into>, { if let Some(value) = value.into() { - Self(self.0.query_param("sort_by", value.to_string())) + let expected_pairs = ::progenitor_client::query_param_pairs("sort_by", &value) + .expect("failed to serialize query param"); + Self(apply_query_param_pairs(self.0, &expected_pairs)) } else { Self(self.0.query_param_missing("sort_by")) } @@ -11454,7 +11670,9 @@ pub mod operations { T: Into>, { if let Some(value) = value.into() { - Self(self.0.query_param("limit", value.to_string())) + let expected_pairs = ::progenitor_client::query_param_pairs("limit", &value) + .expect("failed to serialize query param"); + Self(apply_query_param_pairs(self.0, &expected_pairs)) } else { Self(self.0.query_param_missing("limit")) } @@ -11465,7 +11683,9 @@ pub mod operations { T: Into>, { if let Some(value) = value.into() { - Self(self.0.query_param("page_token", value.to_string())) + let expected_pairs = ::progenitor_client::query_param_pairs("page_token", &value) + .expect("failed to serialize query param"); + Self(apply_query_param_pairs(self.0, &expected_pairs)) } else { Self(self.0.query_param_missing("page_token")) } @@ -11531,7 +11751,9 @@ pub mod operations { T: Into>, { if let Some(value) = value.into() { - Self(self.0.query_param("limit", value.to_string())) + let expected_pairs = ::progenitor_client::query_param_pairs("limit", &value) + .expect("failed to serialize query param"); + Self(apply_query_param_pairs(self.0, &expected_pairs)) } else { Self(self.0.query_param_missing("limit")) } @@ -11542,7 +11764,9 @@ pub mod operations { T: Into>, { if let Some(value) = value.into() { - Self(self.0.query_param("page_token", value.to_string())) + let expected_pairs = ::progenitor_client::query_param_pairs("page_token", &value) + .expect("failed to serialize query param"); + Self(apply_query_param_pairs(self.0, &expected_pairs)) } else { Self(self.0.query_param_missing("page_token")) } @@ -11553,7 +11777,9 @@ pub mod operations { T: Into>, { if let Some(value) = value.into() { - Self(self.0.query_param("sort_by", value.to_string())) + let expected_pairs = ::progenitor_client::query_param_pairs("sort_by", &value) + .expect("failed to serialize query param"); + Self(apply_query_param_pairs(self.0, &expected_pairs)) } else { Self(self.0.query_param_missing("sort_by")) } @@ -11619,7 +11845,9 @@ pub mod operations { T: Into>, { if let Some(value) = value.into() { - Self(self.0.query_param("limit", value.to_string())) + let expected_pairs = ::progenitor_client::query_param_pairs("limit", &value) + .expect("failed to serialize query param"); + Self(apply_query_param_pairs(self.0, &expected_pairs)) } else { Self(self.0.query_param_missing("limit")) } @@ -11630,7 +11858,9 @@ pub mod operations { T: Into>, { if let Some(value) = value.into() { - Self(self.0.query_param("organization", value.to_string())) + let expected_pairs = ::progenitor_client::query_param_pairs("organization", &value) + .expect("failed to serialize query param"); + Self(apply_query_param_pairs(self.0, &expected_pairs)) } else { Self(self.0.query_param_missing("organization")) } @@ -11641,7 +11871,9 @@ pub mod operations { T: Into>, { if let Some(value) = value.into() { - Self(self.0.query_param("page_token", value.to_string())) + let expected_pairs = ::progenitor_client::query_param_pairs("page_token", &value) + .expect("failed to serialize query param"); + Self(apply_query_param_pairs(self.0, &expected_pairs)) } else { Self(self.0.query_param_missing("page_token")) } @@ -11652,7 +11884,9 @@ pub mod operations { T: Into>, { if let Some(value) = value.into() { - Self(self.0.query_param("project", value.to_string())) + let expected_pairs = ::progenitor_client::query_param_pairs("project", &value) + .expect("failed to serialize query param"); + Self(apply_query_param_pairs(self.0, &expected_pairs)) } else { Self(self.0.query_param_missing("project")) } @@ -11663,7 +11897,9 @@ pub mod operations { T: Into>, { if let Some(value) = value.into() { - Self(self.0.query_param("sort_by", value.to_string())) + let expected_pairs = ::progenitor_client::query_param_pairs("sort_by", &value) + .expect("failed to serialize query param"); + Self(apply_query_param_pairs(self.0, &expected_pairs)) } else { Self(self.0.query_param_missing("sort_by")) } @@ -11729,14 +11965,18 @@ pub mod operations { T: Into>, { if let Some(value) = value.into() { - Self(self.0.query_param("organization", value.to_string())) + let expected_pairs = ::progenitor_client::query_param_pairs("organization", &value) + .expect("failed to serialize query param"); + Self(apply_query_param_pairs(self.0, &expected_pairs)) } else { Self(self.0.query_param_missing("organization")) } } pub fn project(self, value: &types::NameOrId) -> Self { - Self(self.0.query_param("project", value.to_string())) + let expected_pairs = ::progenitor_client::query_param_pairs("project", &value) + .expect("failed to serialize query param"); + Self(apply_query_param_pairs(self.0, &expected_pairs)) } pub fn body(self, value: &types::DiskCreate) -> Self { @@ -11808,7 +12048,9 @@ pub mod operations { T: Into>, { if let Some(value) = value.into() { - Self(self.0.query_param("organization", value.to_string())) + let expected_pairs = ::progenitor_client::query_param_pairs("organization", &value) + .expect("failed to serialize query param"); + Self(apply_query_param_pairs(self.0, &expected_pairs)) } else { Self(self.0.query_param_missing("organization")) } @@ -11819,7 +12061,9 @@ pub mod operations { T: Into>, { if let Some(value) = value.into() { - Self(self.0.query_param("project", value.to_string())) + let expected_pairs = ::progenitor_client::query_param_pairs("project", &value) + .expect("failed to serialize query param"); + Self(apply_query_param_pairs(self.0, &expected_pairs)) } else { Self(self.0.query_param_missing("project")) } @@ -11890,7 +12134,9 @@ pub mod operations { T: Into>, { if let Some(value) = value.into() { - Self(self.0.query_param("organization", value.to_string())) + let expected_pairs = ::progenitor_client::query_param_pairs("organization", &value) + .expect("failed to serialize query param"); + Self(apply_query_param_pairs(self.0, &expected_pairs)) } else { Self(self.0.query_param_missing("organization")) } @@ -11901,7 +12147,9 @@ pub mod operations { T: Into>, { if let Some(value) = value.into() { - Self(self.0.query_param("project", value.to_string())) + let expected_pairs = ::progenitor_client::query_param_pairs("project", &value) + .expect("failed to serialize query param"); + Self(apply_query_param_pairs(self.0, &expected_pairs)) } else { Self(self.0.query_param_missing("project")) } @@ -11962,7 +12210,9 @@ pub mod operations { T: Into>, { if let Some(value) = value.into() { - Self(self.0.query_param("limit", value.to_string())) + let expected_pairs = ::progenitor_client::query_param_pairs("limit", &value) + .expect("failed to serialize query param"); + Self(apply_query_param_pairs(self.0, &expected_pairs)) } else { Self(self.0.query_param_missing("limit")) } @@ -11973,7 +12223,9 @@ pub mod operations { T: Into>, { if let Some(value) = value.into() { - Self(self.0.query_param("organization", value.to_string())) + let expected_pairs = ::progenitor_client::query_param_pairs("organization", &value) + .expect("failed to serialize query param"); + Self(apply_query_param_pairs(self.0, &expected_pairs)) } else { Self(self.0.query_param_missing("organization")) } @@ -11984,7 +12236,9 @@ pub mod operations { T: Into>, { if let Some(value) = value.into() { - Self(self.0.query_param("page_token", value.to_string())) + let expected_pairs = ::progenitor_client::query_param_pairs("page_token", &value) + .expect("failed to serialize query param"); + Self(apply_query_param_pairs(self.0, &expected_pairs)) } else { Self(self.0.query_param_missing("page_token")) } @@ -11995,7 +12249,9 @@ pub mod operations { T: Into>, { if let Some(value) = value.into() { - Self(self.0.query_param("project", value.to_string())) + let expected_pairs = ::progenitor_client::query_param_pairs("project", &value) + .expect("failed to serialize query param"); + Self(apply_query_param_pairs(self.0, &expected_pairs)) } else { Self(self.0.query_param_missing("project")) } @@ -12006,7 +12262,9 @@ pub mod operations { T: Into>, { if let Some(value) = value.into() { - Self(self.0.query_param("sort_by", value.to_string())) + let expected_pairs = ::progenitor_client::query_param_pairs("sort_by", &value) + .expect("failed to serialize query param"); + Self(apply_query_param_pairs(self.0, &expected_pairs)) } else { Self(self.0.query_param_missing("sort_by")) } @@ -12072,14 +12330,18 @@ pub mod operations { T: Into>, { if let Some(value) = value.into() { - Self(self.0.query_param("organization", value.to_string())) + let expected_pairs = ::progenitor_client::query_param_pairs("organization", &value) + .expect("failed to serialize query param"); + Self(apply_query_param_pairs(self.0, &expected_pairs)) } else { Self(self.0.query_param_missing("organization")) } } pub fn project(self, value: &types::NameOrId) -> Self { - Self(self.0.query_param("project", value.to_string())) + let expected_pairs = ::progenitor_client::query_param_pairs("project", &value) + .expect("failed to serialize query param"); + Self(apply_query_param_pairs(self.0, &expected_pairs)) } pub fn body(self, value: &types::InstanceCreate) -> Self { @@ -12151,7 +12413,9 @@ pub mod operations { T: Into>, { if let Some(value) = value.into() { - Self(self.0.query_param("organization", value.to_string())) + let expected_pairs = ::progenitor_client::query_param_pairs("organization", &value) + .expect("failed to serialize query param"); + Self(apply_query_param_pairs(self.0, &expected_pairs)) } else { Self(self.0.query_param_missing("organization")) } @@ -12162,7 +12426,9 @@ pub mod operations { T: Into>, { if let Some(value) = value.into() { - Self(self.0.query_param("project", value.to_string())) + let expected_pairs = ::progenitor_client::query_param_pairs("project", &value) + .expect("failed to serialize query param"); + Self(apply_query_param_pairs(self.0, &expected_pairs)) } else { Self(self.0.query_param_missing("project")) } @@ -12233,7 +12499,9 @@ pub mod operations { T: Into>, { if let Some(value) = value.into() { - Self(self.0.query_param("organization", value.to_string())) + let expected_pairs = ::progenitor_client::query_param_pairs("organization", &value) + .expect("failed to serialize query param"); + Self(apply_query_param_pairs(self.0, &expected_pairs)) } else { Self(self.0.query_param_missing("organization")) } @@ -12244,7 +12512,9 @@ pub mod operations { T: Into>, { if let Some(value) = value.into() { - Self(self.0.query_param("project", value.to_string())) + let expected_pairs = ::progenitor_client::query_param_pairs("project", &value) + .expect("failed to serialize query param"); + Self(apply_query_param_pairs(self.0, &expected_pairs)) } else { Self(self.0.query_param_missing("project")) } @@ -12311,7 +12581,9 @@ pub mod operations { T: Into>, { if let Some(value) = value.into() { - Self(self.0.query_param("limit", value.to_string())) + let expected_pairs = ::progenitor_client::query_param_pairs("limit", &value) + .expect("failed to serialize query param"); + Self(apply_query_param_pairs(self.0, &expected_pairs)) } else { Self(self.0.query_param_missing("limit")) } @@ -12322,7 +12594,9 @@ pub mod operations { T: Into>, { if let Some(value) = value.into() { - Self(self.0.query_param("organization", value.to_string())) + let expected_pairs = ::progenitor_client::query_param_pairs("organization", &value) + .expect("failed to serialize query param"); + Self(apply_query_param_pairs(self.0, &expected_pairs)) } else { Self(self.0.query_param_missing("organization")) } @@ -12333,7 +12607,9 @@ pub mod operations { T: Into>, { if let Some(value) = value.into() { - Self(self.0.query_param("page_token", value.to_string())) + let expected_pairs = ::progenitor_client::query_param_pairs("page_token", &value) + .expect("failed to serialize query param"); + Self(apply_query_param_pairs(self.0, &expected_pairs)) } else { Self(self.0.query_param_missing("page_token")) } @@ -12344,7 +12620,9 @@ pub mod operations { T: Into>, { if let Some(value) = value.into() { - Self(self.0.query_param("project", value.to_string())) + let expected_pairs = ::progenitor_client::query_param_pairs("project", &value) + .expect("failed to serialize query param"); + Self(apply_query_param_pairs(self.0, &expected_pairs)) } else { Self(self.0.query_param_missing("project")) } @@ -12355,7 +12633,9 @@ pub mod operations { T: Into>, { if let Some(value) = value.into() { - Self(self.0.query_param("sort_by", value.to_string())) + let expected_pairs = ::progenitor_client::query_param_pairs("sort_by", &value) + .expect("failed to serialize query param"); + Self(apply_query_param_pairs(self.0, &expected_pairs)) } else { Self(self.0.query_param_missing("sort_by")) } @@ -12430,7 +12710,9 @@ pub mod operations { T: Into>, { if let Some(value) = value.into() { - Self(self.0.query_param("organization", value.to_string())) + let expected_pairs = ::progenitor_client::query_param_pairs("organization", &value) + .expect("failed to serialize query param"); + Self(apply_query_param_pairs(self.0, &expected_pairs)) } else { Self(self.0.query_param_missing("organization")) } @@ -12441,7 +12723,9 @@ pub mod operations { T: Into>, { if let Some(value) = value.into() { - Self(self.0.query_param("project", value.to_string())) + let expected_pairs = ::progenitor_client::query_param_pairs("project", &value) + .expect("failed to serialize query param"); + Self(apply_query_param_pairs(self.0, &expected_pairs)) } else { Self(self.0.query_param_missing("project")) } @@ -12520,7 +12804,9 @@ pub mod operations { T: Into>, { if let Some(value) = value.into() { - Self(self.0.query_param("organization", value.to_string())) + let expected_pairs = ::progenitor_client::query_param_pairs("organization", &value) + .expect("failed to serialize query param"); + Self(apply_query_param_pairs(self.0, &expected_pairs)) } else { Self(self.0.query_param_missing("organization")) } @@ -12531,7 +12817,9 @@ pub mod operations { T: Into>, { if let Some(value) = value.into() { - Self(self.0.query_param("project", value.to_string())) + let expected_pairs = ::progenitor_client::query_param_pairs("project", &value) + .expect("failed to serialize query param"); + Self(apply_query_param_pairs(self.0, &expected_pairs)) } else { Self(self.0.query_param_missing("project")) } @@ -12607,7 +12895,9 @@ pub mod operations { T: Into>, { if let Some(value) = value.into() { - Self(self.0.query_param("organization", value.to_string())) + let expected_pairs = ::progenitor_client::query_param_pairs("organization", &value) + .expect("failed to serialize query param"); + Self(apply_query_param_pairs(self.0, &expected_pairs)) } else { Self(self.0.query_param_missing("organization")) } @@ -12618,7 +12908,9 @@ pub mod operations { T: Into>, { if let Some(value) = value.into() { - Self(self.0.query_param("project", value.to_string())) + let expected_pairs = ::progenitor_client::query_param_pairs("project", &value) + .expect("failed to serialize query param"); + Self(apply_query_param_pairs(self.0, &expected_pairs)) } else { Self(self.0.query_param_missing("project")) } @@ -12694,7 +12986,9 @@ pub mod operations { T: Into>, { if let Some(value) = value.into() { - Self(self.0.query_param("organization", value.to_string())) + let expected_pairs = ::progenitor_client::query_param_pairs("organization", &value) + .expect("failed to serialize query param"); + Self(apply_query_param_pairs(self.0, &expected_pairs)) } else { Self(self.0.query_param_missing("organization")) } @@ -12705,7 +12999,9 @@ pub mod operations { T: Into>, { if let Some(value) = value.into() { - Self(self.0.query_param("project", value.to_string())) + let expected_pairs = ::progenitor_client::query_param_pairs("project", &value) + .expect("failed to serialize query param"); + Self(apply_query_param_pairs(self.0, &expected_pairs)) } else { Self(self.0.query_param_missing("project")) } @@ -12780,7 +13076,9 @@ pub mod operations { T: Into>, { if let Some(value) = value.into() { - Self(self.0.query_param("from_start", value.to_string())) + let expected_pairs = ::progenitor_client::query_param_pairs("from_start", &value) + .expect("failed to serialize query param"); + Self(apply_query_param_pairs(self.0, &expected_pairs)) } else { Self(self.0.query_param_missing("from_start")) } @@ -12791,7 +13089,9 @@ pub mod operations { T: Into>, { if let Some(value) = value.into() { - Self(self.0.query_param("max_bytes", value.to_string())) + let expected_pairs = ::progenitor_client::query_param_pairs("max_bytes", &value) + .expect("failed to serialize query param"); + Self(apply_query_param_pairs(self.0, &expected_pairs)) } else { Self(self.0.query_param_missing("max_bytes")) } @@ -12802,7 +13102,9 @@ pub mod operations { T: Into>, { if let Some(value) = value.into() { - Self(self.0.query_param("most_recent", value.to_string())) + let expected_pairs = ::progenitor_client::query_param_pairs("most_recent", &value) + .expect("failed to serialize query param"); + Self(apply_query_param_pairs(self.0, &expected_pairs)) } else { Self(self.0.query_param_missing("most_recent")) } @@ -12813,7 +13115,9 @@ pub mod operations { T: Into>, { if let Some(value) = value.into() { - Self(self.0.query_param("organization", value.to_string())) + let expected_pairs = ::progenitor_client::query_param_pairs("organization", &value) + .expect("failed to serialize query param"); + Self(apply_query_param_pairs(self.0, &expected_pairs)) } else { Self(self.0.query_param_missing("organization")) } @@ -12824,7 +13128,9 @@ pub mod operations { T: Into>, { if let Some(value) = value.into() { - Self(self.0.query_param("project", value.to_string())) + let expected_pairs = ::progenitor_client::query_param_pairs("project", &value) + .expect("failed to serialize query param"); + Self(apply_query_param_pairs(self.0, &expected_pairs)) } else { Self(self.0.query_param_missing("project")) } @@ -12897,7 +13203,9 @@ pub mod operations { T: Into>, { if let Some(value) = value.into() { - Self(self.0.query_param("organization", value.to_string())) + let expected_pairs = ::progenitor_client::query_param_pairs("organization", &value) + .expect("failed to serialize query param"); + Self(apply_query_param_pairs(self.0, &expected_pairs)) } else { Self(self.0.query_param_missing("organization")) } @@ -12908,7 +13216,9 @@ pub mod operations { T: Into>, { if let Some(value) = value.into() { - Self(self.0.query_param("project", value.to_string())) + let expected_pairs = ::progenitor_client::query_param_pairs("project", &value) + .expect("failed to serialize query param"); + Self(apply_query_param_pairs(self.0, &expected_pairs)) } else { Self(self.0.query_param_missing("project")) } @@ -12959,7 +13269,9 @@ pub mod operations { T: Into>, { if let Some(value) = value.into() { - Self(self.0.query_param("organization", value.to_string())) + let expected_pairs = ::progenitor_client::query_param_pairs("organization", &value) + .expect("failed to serialize query param"); + Self(apply_query_param_pairs(self.0, &expected_pairs)) } else { Self(self.0.query_param_missing("organization")) } @@ -12970,7 +13282,9 @@ pub mod operations { T: Into>, { if let Some(value) = value.into() { - Self(self.0.query_param("project", value.to_string())) + let expected_pairs = ::progenitor_client::query_param_pairs("project", &value) + .expect("failed to serialize query param"); + Self(apply_query_param_pairs(self.0, &expected_pairs)) } else { Self(self.0.query_param_missing("project")) } @@ -13042,7 +13356,9 @@ pub mod operations { T: Into>, { if let Some(value) = value.into() { - Self(self.0.query_param("organization", value.to_string())) + let expected_pairs = ::progenitor_client::query_param_pairs("organization", &value) + .expect("failed to serialize query param"); + Self(apply_query_param_pairs(self.0, &expected_pairs)) } else { Self(self.0.query_param_missing("organization")) } @@ -13053,7 +13369,9 @@ pub mod operations { T: Into>, { if let Some(value) = value.into() { - Self(self.0.query_param("project", value.to_string())) + let expected_pairs = ::progenitor_client::query_param_pairs("project", &value) + .expect("failed to serialize query param"); + Self(apply_query_param_pairs(self.0, &expected_pairs)) } else { Self(self.0.query_param_missing("project")) } @@ -13119,7 +13437,9 @@ pub mod operations { T: Into>, { if let Some(value) = value.into() { - Self(self.0.query_param("limit", value.to_string())) + let expected_pairs = ::progenitor_client::query_param_pairs("limit", &value) + .expect("failed to serialize query param"); + Self(apply_query_param_pairs(self.0, &expected_pairs)) } else { Self(self.0.query_param_missing("limit")) } @@ -13130,7 +13450,9 @@ pub mod operations { T: Into>, { if let Some(value) = value.into() { - Self(self.0.query_param("page_token", value.to_string())) + let expected_pairs = ::progenitor_client::query_param_pairs("page_token", &value) + .expect("failed to serialize query param"); + Self(apply_query_param_pairs(self.0, &expected_pairs)) } else { Self(self.0.query_param_missing("page_token")) } @@ -13141,7 +13463,9 @@ pub mod operations { T: Into>, { if let Some(value) = value.into() { - Self(self.0.query_param("sort_by", value.to_string())) + let expected_pairs = ::progenitor_client::query_param_pairs("sort_by", &value) + .expect("failed to serialize query param"); + Self(apply_query_param_pairs(self.0, &expected_pairs)) } else { Self(self.0.query_param_missing("sort_by")) } @@ -13576,7 +13900,9 @@ pub mod operations { T: Into>, { if let Some(value) = value.into() { - Self(self.0.query_param("limit", value.to_string())) + let expected_pairs = ::progenitor_client::query_param_pairs("limit", &value) + .expect("failed to serialize query param"); + Self(apply_query_param_pairs(self.0, &expected_pairs)) } else { Self(self.0.query_param_missing("limit")) } @@ -13587,7 +13913,9 @@ pub mod operations { T: Into>, { if let Some(value) = value.into() { - Self(self.0.query_param("organization", value.to_string())) + let expected_pairs = ::progenitor_client::query_param_pairs("organization", &value) + .expect("failed to serialize query param"); + Self(apply_query_param_pairs(self.0, &expected_pairs)) } else { Self(self.0.query_param_missing("organization")) } @@ -13598,7 +13926,9 @@ pub mod operations { T: Into>, { if let Some(value) = value.into() { - Self(self.0.query_param("page_token", value.to_string())) + let expected_pairs = ::progenitor_client::query_param_pairs("page_token", &value) + .expect("failed to serialize query param"); + Self(apply_query_param_pairs(self.0, &expected_pairs)) } else { Self(self.0.query_param_missing("page_token")) } @@ -13609,7 +13939,9 @@ pub mod operations { T: Into>, { if let Some(value) = value.into() { - Self(self.0.query_param("sort_by", value.to_string())) + let expected_pairs = ::progenitor_client::query_param_pairs("sort_by", &value) + .expect("failed to serialize query param"); + Self(apply_query_param_pairs(self.0, &expected_pairs)) } else { Self(self.0.query_param_missing("sort_by")) } @@ -13671,7 +14003,9 @@ pub mod operations { } pub fn organization(self, value: &types::NameOrId) -> Self { - Self(self.0.query_param("organization", value.to_string())) + let expected_pairs = ::progenitor_client::query_param_pairs("organization", &value) + .expect("failed to serialize query param"); + Self(apply_query_param_pairs(self.0, &expected_pairs)) } pub fn body(self, value: &types::ProjectCreate) -> Self { @@ -13743,7 +14077,9 @@ pub mod operations { T: Into>, { if let Some(value) = value.into() { - Self(self.0.query_param("organization", value.to_string())) + let expected_pairs = ::progenitor_client::query_param_pairs("organization", &value) + .expect("failed to serialize query param"); + Self(apply_query_param_pairs(self.0, &expected_pairs)) } else { Self(self.0.query_param_missing("organization")) } @@ -13814,7 +14150,9 @@ pub mod operations { T: Into>, { if let Some(value) = value.into() { - Self(self.0.query_param("organization", value.to_string())) + let expected_pairs = ::progenitor_client::query_param_pairs("organization", &value) + .expect("failed to serialize query param"); + Self(apply_query_param_pairs(self.0, &expected_pairs)) } else { Self(self.0.query_param_missing("organization")) } @@ -13889,7 +14227,9 @@ pub mod operations { T: Into>, { if let Some(value) = value.into() { - Self(self.0.query_param("organization", value.to_string())) + let expected_pairs = ::progenitor_client::query_param_pairs("organization", &value) + .expect("failed to serialize query param"); + Self(apply_query_param_pairs(self.0, &expected_pairs)) } else { Self(self.0.query_param_missing("organization")) } @@ -13956,7 +14296,9 @@ pub mod operations { T: Into>, { if let Some(value) = value.into() { - Self(self.0.query_param("organization", value.to_string())) + let expected_pairs = ::progenitor_client::query_param_pairs("organization", &value) + .expect("failed to serialize query param"); + Self(apply_query_param_pairs(self.0, &expected_pairs)) } else { Self(self.0.query_param_missing("organization")) } @@ -14028,7 +14370,9 @@ pub mod operations { T: Into>, { if let Some(value) = value.into() { - Self(self.0.query_param("organization", value.to_string())) + let expected_pairs = ::progenitor_client::query_param_pairs("organization", &value) + .expect("failed to serialize query param"); + Self(apply_query_param_pairs(self.0, &expected_pairs)) } else { Self(self.0.query_param_missing("organization")) } @@ -14098,7 +14442,9 @@ pub mod operations { T: Into>, { if let Some(value) = value.into() { - Self(self.0.query_param("limit", value.to_string())) + let expected_pairs = ::progenitor_client::query_param_pairs("limit", &value) + .expect("failed to serialize query param"); + Self(apply_query_param_pairs(self.0, &expected_pairs)) } else { Self(self.0.query_param_missing("limit")) } @@ -14109,7 +14455,9 @@ pub mod operations { T: Into>, { if let Some(value) = value.into() { - Self(self.0.query_param("page_token", value.to_string())) + let expected_pairs = ::progenitor_client::query_param_pairs("page_token", &value) + .expect("failed to serialize query param"); + Self(apply_query_param_pairs(self.0, &expected_pairs)) } else { Self(self.0.query_param_missing("page_token")) } @@ -14120,7 +14468,9 @@ pub mod operations { T: Into>, { if let Some(value) = value.into() { - Self(self.0.query_param("sort_by", value.to_string())) + let expected_pairs = ::progenitor_client::query_param_pairs("sort_by", &value) + .expect("failed to serialize query param"); + Self(apply_query_param_pairs(self.0, &expected_pairs)) } else { Self(self.0.query_param_missing("sort_by")) } @@ -14186,7 +14536,9 @@ pub mod operations { T: Into>, { if let Some(value) = value.into() { - Self(self.0.query_param("limit", value.to_string())) + let expected_pairs = ::progenitor_client::query_param_pairs("limit", &value) + .expect("failed to serialize query param"); + Self(apply_query_param_pairs(self.0, &expected_pairs)) } else { Self(self.0.query_param_missing("limit")) } @@ -14197,7 +14549,9 @@ pub mod operations { T: Into>, { if let Some(value) = value.into() { - Self(self.0.query_param("page_token", value.to_string())) + let expected_pairs = ::progenitor_client::query_param_pairs("page_token", &value) + .expect("failed to serialize query param"); + Self(apply_query_param_pairs(self.0, &expected_pairs)) } else { Self(self.0.query_param_missing("page_token")) } @@ -14208,7 +14562,9 @@ pub mod operations { T: Into>, { if let Some(value) = value.into() { - Self(self.0.query_param("sort_by", value.to_string())) + let expected_pairs = ::progenitor_client::query_param_pairs("sort_by", &value) + .expect("failed to serialize query param"); + Self(apply_query_param_pairs(self.0, &expected_pairs)) } else { Self(self.0.query_param_missing("sort_by")) } @@ -14497,7 +14853,9 @@ pub mod operations { T: Into>, { if let Some(value) = value.into() { - Self(self.0.query_param("limit", value.to_string())) + let expected_pairs = ::progenitor_client::query_param_pairs("limit", &value) + .expect("failed to serialize query param"); + Self(apply_query_param_pairs(self.0, &expected_pairs)) } else { Self(self.0.query_param_missing("limit")) } @@ -14508,7 +14866,9 @@ pub mod operations { T: Into>, { if let Some(value) = value.into() { - Self(self.0.query_param("page_token", value.to_string())) + let expected_pairs = ::progenitor_client::query_param_pairs("page_token", &value) + .expect("failed to serialize query param"); + Self(apply_query_param_pairs(self.0, &expected_pairs)) } else { Self(self.0.query_param_missing("page_token")) } @@ -14519,7 +14879,9 @@ pub mod operations { T: Into>, { if let Some(value) = value.into() { - Self(self.0.query_param("sort_by", value.to_string())) + let expected_pairs = ::progenitor_client::query_param_pairs("sort_by", &value) + .expect("failed to serialize query param"); + Self(apply_query_param_pairs(self.0, &expected_pairs)) } else { Self(self.0.query_param_missing("sort_by")) } diff --git a/progenitor-impl/tests/output/src/param_collision_httpmock.rs b/progenitor-impl/tests/output/src/param_collision_httpmock.rs index 0a15bff9..375c9039 100644 --- a/progenitor-impl/tests/output/src/param_collision_httpmock.rs +++ b/progenitor-impl/tests/output/src/param_collision_httpmock.rs @@ -4,6 +4,18 @@ pub mod operations { #![doc = r" its inner type with a call to `into_inner()`. This can"] #![doc = r" be used to explicitly deviate from permitted values."] use crate::param_collision_builder::*; + #[doc = r" Apply decoded query parameter pairs to the matcher."] + fn apply_query_param_pairs( + mut when: ::httpmock::When, + pairs: &[(String, String)], + ) -> ::httpmock::When { + for (key, value) in pairs { + when = when.query_param(key, value); + } + + when + } + pub struct KeyGetWhen(::httpmock::When); impl KeyGetWhen { pub fn new(inner: ::httpmock::When) -> Self { @@ -24,23 +36,33 @@ pub mod operations { } pub fn client(self, value: bool) -> Self { - Self(self.0.query_param("client", value.to_string())) + let expected_pairs = ::progenitor_client::query_param_pairs("client", &value) + .expect("failed to serialize query param"); + Self(apply_query_param_pairs(self.0, &expected_pairs)) } pub fn request(self, value: bool) -> Self { - Self(self.0.query_param("request", value.to_string())) + let expected_pairs = ::progenitor_client::query_param_pairs("request", &value) + .expect("failed to serialize query param"); + Self(apply_query_param_pairs(self.0, &expected_pairs)) } pub fn response(self, value: bool) -> Self { - Self(self.0.query_param("response", value.to_string())) + let expected_pairs = ::progenitor_client::query_param_pairs("response", &value) + .expect("failed to serialize query param"); + Self(apply_query_param_pairs(self.0, &expected_pairs)) } pub fn result(self, value: bool) -> Self { - Self(self.0.query_param("result", value.to_string())) + let expected_pairs = ::progenitor_client::query_param_pairs("result", &value) + .expect("failed to serialize query param"); + Self(apply_query_param_pairs(self.0, &expected_pairs)) } pub fn url(self, value: bool) -> Self { - Self(self.0.query_param("url", value.to_string())) + let expected_pairs = ::progenitor_client::query_param_pairs("url", &value) + .expect("failed to serialize query param"); + Self(apply_query_param_pairs(self.0, &expected_pairs)) } } diff --git a/progenitor-impl/tests/output/src/param_overrides_httpmock.rs b/progenitor-impl/tests/output/src/param_overrides_httpmock.rs index ab3aef72..6cb59ef4 100644 --- a/progenitor-impl/tests/output/src/param_overrides_httpmock.rs +++ b/progenitor-impl/tests/output/src/param_overrides_httpmock.rs @@ -4,6 +4,18 @@ pub mod operations { #![doc = r" its inner type with a call to `into_inner()`. This can"] #![doc = r" be used to explicitly deviate from permitted values."] use crate::param_overrides_builder::*; + #[doc = r" Apply decoded query parameter pairs to the matcher."] + fn apply_query_param_pairs( + mut when: ::httpmock::When, + pairs: &[(String, String)], + ) -> ::httpmock::When { + for (key, value) in pairs { + when = when.query_param(key, value); + } + + when + } + pub struct KeyGetWhen(::httpmock::When); impl KeyGetWhen { pub fn new(inner: ::httpmock::When) -> Self { @@ -23,7 +35,9 @@ pub mod operations { T: Into>, { if let Some(value) = value.into() { - Self(self.0.query_param("key", value.to_string())) + let expected_pairs = ::progenitor_client::query_param_pairs("key", &value) + .expect("failed to serialize query param"); + Self(apply_query_param_pairs(self.0, &expected_pairs)) } else { Self(self.0.query_param_missing("key")) } @@ -34,7 +48,9 @@ pub mod operations { T: Into>, { if let Some(value) = value.into() { - Self(self.0.query_param("uniqueKey", value.to_string())) + let expected_pairs = ::progenitor_client::query_param_pairs("uniqueKey", &value) + .expect("failed to serialize query param"); + Self(apply_query_param_pairs(self.0, &expected_pairs)) } else { Self(self.0.query_param_missing("uniqueKey")) } diff --git a/progenitor-impl/tests/output/src/propolis_server_httpmock.rs b/progenitor-impl/tests/output/src/propolis_server_httpmock.rs index ba8ee1c5..6692a047 100644 --- a/progenitor-impl/tests/output/src/propolis_server_httpmock.rs +++ b/progenitor-impl/tests/output/src/propolis_server_httpmock.rs @@ -4,6 +4,18 @@ pub mod operations { #![doc = r" its inner type with a call to `into_inner()`. This can"] #![doc = r" be used to explicitly deviate from permitted values."] use crate::propolis_server_builder::*; + #[doc = r" Apply decoded query parameter pairs to the matcher."] + fn apply_query_param_pairs( + mut when: ::httpmock::When, + pairs: &[(String, String)], + ) -> ::httpmock::When { + for (key, value) in pairs { + when = when.query_param(key, value); + } + + when + } + pub struct InstanceGetWhen(::httpmock::When); impl InstanceGetWhen { pub fn new(inner: ::httpmock::When) -> Self { diff --git a/progenitor-impl/tests/test_httpmock_query_arrays.rs b/progenitor-impl/tests/test_httpmock_query_arrays.rs new file mode 100644 index 00000000..169b5629 --- /dev/null +++ b/progenitor-impl/tests/test_httpmock_query_arrays.rs @@ -0,0 +1,19 @@ +// Copyright 2025 Oxide Computer Company + +//! Compile-only coverage for array query parameters in httpmock output. + +/// Generated builder output for the query-array spec. +#[allow(dead_code, unused_imports)] +mod httpmock_query_array_builder { + include!("output/src/httpmock_query_array_builder.rs"); +} + +/// Generated httpmock output for the query-array spec. +#[allow(dead_code, unused_imports)] +mod httpmock_query_array_httpmock { + include!("output/src/httpmock_query_array_httpmock.rs"); +} + +/// Ensures the generated httpmock code type-checks. +#[test] +fn test_httpmock_query_array_param_compiles() {} diff --git a/progenitor-impl/tests/test_output.rs b/progenitor-impl/tests/test_output.rs index 010315d9..99aa626a 100644 --- a/progenitor-impl/tests/test_output.rs +++ b/progenitor-impl/tests/test_output.rs @@ -163,6 +163,12 @@ fn test_cli_gen() { verify_apis("cli-gen.json"); } +/// Exercises httpmock output for array query parameters. +#[test] +fn test_httpmock_query_array() { + verify_apis("httpmock-query-array.yaml"); +} + #[test] fn test_nexus_with_different_timeout() { const OPENAPI_FILE: &'static str = "nexus.json"; diff --git a/sample_openapi/httpmock-query-array.yaml b/sample_openapi/httpmock-query-array.yaml new file mode 100644 index 00000000..a75b9a74 --- /dev/null +++ b/sample_openapi/httpmock-query-array.yaml @@ -0,0 +1,19 @@ +openapi: 3.0.0 +info: + title: httpmock-query-array + version: "0.0.0" +paths: + /widgets: + get: + operationId: listWidgets + parameters: + - name: tags + in: query + required: true + schema: + type: array + items: + type: string + responses: + "204": + description: no-content